Hi, is there support for flavor and buildtype in K...
# compose
z
Hi, is there support for flavor and buildtype in Kotlin Multiplatform like android? For example, let’s say I use same code base for different flavors. Flavor A should load resources in that flavor folder (i.e red theme), and Flavor B will load resources in flavor B folder (i.e blue theme)
k
No. Use gradle modules for this
z
Is there an example/guide on how to use gradle modules?
k
google gradle multimodule project
p
I have pointed some folks to this project which does what Konstantin mentioned. https://github.com/pablichjenkov/macao-marketplace/blob/dev/composeApp%2Fbuild.gradle.kts#L91 You can get more fancy with a custom Gradle plug-in but this should give you a rough idea
z
wow, it works, just implemented it
👍 1
thank you @Konstantin Tskhovrebov and @Pablichjenkov for the help
p
You could get fancier and build a ktor service that gives you a build-config.json file where you set this properties per build or so. The example just uses the gradle.properties file, you can override that value from the build script when you invoke the Gradle task
354 Views