Kurt Renzo Acosta

    Kurt Renzo Acosta

    2 years ago
    Hi, guys! How do you declare flavors for Kotlin/Native? In Android I have two release types (Debug and Release) and two flavors (Dev and Production) so I have:- devDebug - devRelease - productionDebug - productionRelease I wanted to have these in iOS too but I can't seem to find any configuration so I only have Debug and Release for it. If I'm missing something, please do point me in the right direction. Many thanks!
    Artyom Degtyarev [JB]

    Artyom Degtyarev [JB]

    2 years ago
    Please share some details on your use-case. What for do you want to use these configurations? There was a conversation on this here(https://kotlinlang.slack.com/archives/C3PQML5NU/p1569574970173000?thread_ts=1569503173.151400&cid=C3PQML5NU), but I’m not sure is this relevant for you.
    Kurt Renzo Acosta

    Kurt Renzo Acosta

    2 years ago
    Thanks for the thread. I'll take a look at it tomorrow. Basically, we have two environments, one for us and one for end-users and with Android, we switch out URLs, API secrets, etc using flavors and BuildConfigs. Flavors still work on Android using multiplatform but we can't seem to find anything on how to make flavors for iOS (Kotlin/Native target)
    alexfacciorusso

    alexfacciorusso

    2 years ago
    Flavours are a feature exclusive to the Android Gradle plugin. What you can do for iOS is to create an entry point in your core module, where you can pass the name/id of the configuration. Then, based on that name/id you can select which configuration you want to sent to the app. I bet in iOS you can send this to gradlew using an environment variable set via different target types in the Xcode project
    y

    yshrsmz

    2 years ago
    If what you need is to change constant variables, BuildKonfig is here for youhttps://github.com/yshrsmz/BuildKonfig
    Kurt Renzo Acosta

    Kurt Renzo Acosta

    2 years ago
    And that's actually what I just finished doing right now. Thank you for the library!