Bitter
01/23/2025, 12:14 PMproductFlavors {
create("usa") {
isDefault = true
dimension = "exchange"
applicationIdSuffix = ".usa"
versionCode = gitCommitCount
versionName = "3.0.${gitCommitCount}"
buildConfigField("String", "BASE_URL", "\"<https://usa.xyz.com/api/>\"")
}
create("canada") {
dimension = "exchange"
applicationIdSuffix = ".canada"
versionCode = gitCommitCount
versionName = "3.0.${gitCommitCount}"
buildConfigField("String", "BASE_URL", "\"<https://canada.xyz.com/api/>\"")
}
}
I have been googling for hours and the only thing i got close to was BuildKonfig library but that too doesn't support flavors .
I am finding difficult to believe that there isn't a solution for this out there ?MarkRS
01/23/2025, 12:42 PMPablichjenkov
01/23/2025, 1:14 PMBitter
01/23/2025, 1:17 PMPablichjenkov
01/23/2025, 1:20 PMthemeFlavorProvider
in this project: https://github.com/pablichjenkov/macao-marketplace/blob/dev/composeApp%2Fbuild.gradle.kts#L14Pablichjenkov
01/23/2025, 1:24 PMBitter
01/23/2025, 1:25 PMPablichjenkov
01/23/2025, 1:31 PMBitter
01/23/2025, 7:43 PMPablichjenkov
01/23/2025, 8:33 PMapp-build-config.json
in the ci pipeline. Depending on the workflow/flavor to build, it will pick the right file for the given environment.
If you don't have a pipeline. You can host a simple service that provides the file based on the flavor.
You can set this in the App as part of a prepare build script . Or you can do the request programmatically in Gradle codePablichjenkov
01/23/2025, 8:34 PM