Hi there is there alternative to buildKonfig? for ...
# multiplatform
s
Hi there is there alternative to buildKonfig? for multimodular KMM projects?, currently we are facing issue in multimodular KMM projects
m
I’d encourage you to open an issue in the GitHub repo with your problem. It could potentially help others
👍 2
Otherwise, I’ve used https://github.com/gmazzo/gradle-buildconfig-plugin successfully in the past
s
Have used in multi module apps?
m
Can’t remember but most likely yes, most my apps are multi module
f
Is it multiplatform type of buildConfig you used on repo fethji/Rijksmuseum
If so how can we change build varients for iOS?
f
it's multiplatform. You can probably have your fields defined in a commom module and have other module that need it depend on that common module. Make sure to add it as
api(project:common)
instead of
implementation(project:common)
and add
internalVisibility = false
so other modules that depend on it can see the generated class.
Copy code
buildConfig {
    packageName = "com.example.project"
    useKotlinOutput { internalVisibility = false }
    buildConfigField(
        "String",
        "API_KEY",
        "\"${secretKeyProperties["api.key"]}\""
    )
}
To answer your variants/flavors question look at this thread.
180 Views