Hello, is something like buildConfigField with Bui...
# multiplatform
a
Hello, is something like buildConfigField with BuildTypes is possible with the Kotlin Multiplatform Project gradle file ? I want to do something similar to this into my Android/iOS shared lib : https://stackoverflow.com/questions/27875748/android-studio-switching-a-url-depending-on-buildtype-used-for-testing-in-deb
c
My team uses #serialization and loads this type of config from JSON at runtime. Not quite as safe as Android’s build configs and the properties aren’t constants, but it works quite well for us.
l
The same technique should work for Android. For JS, I think nothing exists for that. For #kotlin-native, I don't think it's supported, but I know there's a DEBUG vs RELEASE notion as you can see here: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html You could create a feature request for that on kotl.in/issue, you'll definitely not be the last person to want this.
g
There is a library for that https://github.com/yshrsmz/BuildKonfig
👍 1
a
Thx, I will open a request about that. In the meantime I will try the BuildKonfig lib
l
Once you open the issue, please link it here.