Hey everyone, I’m looking into creating different ...
# multiplatform
d
Hey everyone, I’m looking into creating different flavors for common in my KMM project. I’ve setup the commonDev and commonProd but it still reads the api models from commonMain. I’m not sure what I’m doing wrong, or if I’m missing to register the flavors somewhere. I have setup the sourceSets, so they are configured properly and I have android flavors as well. I was thinking about using the buildKonfig library but I’m not sure if it’s going to solve the issue. any help is appreciated 🙏
c
I’ve been setting this up recently for a new project. I did look in to BuildKonfig. But for the moment I am going with defining the flavors in native code and passing configuration in to common Kotlin. The main reason for me was that the native code would need to know about build flavors somehow, e.g. for internationalisation, resources/assets etc. So it didn’t make sense to configure it in BuildKonfig and then duplicate for iOS and Android native builds. Currently the problem is we are left with separate, identical configuration files for iOS and Android, rather than a single source of truth for both. But as these are unlikely to change often once configured I’m currently thinking this isn’t too bad.
102 Views