Hey! In a Kotlin multiplatform project I have thr...
# multiplatform
n
Hey! In a Kotlin multiplatform project I have three different Gradle modules (not Gradle projects), one for Android, one for Web and one for the shared code. When trying to build the web project that uses the shared module, but not the Android one (obviously), I got errors for some missing properties that should be on
gradle.local.properties
that are only used for the Android project. Does it make sense to separate Gradle projects instead of them being just different modules?
For now, this works:
Copy code
// project settings.gradle.kts

val isAndroidBuild: String by settings
val isWebBuild: String by settings

if (isWebBuild.toBoolean()) {
    include(
        ":web:app",
        ...
    )
}

if (isAndroidBuild.toBoolean()) {
    include(
        ":android:app",
        ...
    )
}
Is this a good approach?
Well, this is actually described in Heroku and they say it’s the desired approach: https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku#multiple-application-types-in-the-same-project