Hello, all! I've got a simple question that is pro...
# multiplatform
s
Hello, all! I've got a simple question that is proving surprisingly hard to google: What's the best way to check environment in a KMM project? That is, for the hypothetical code
if (isProduction) ...
, how would you define
isProduction
?
d
You could use a plugin like BuildKonfig to generate constants, and you can set the value as part of your gradle build setup
s
Ah, this looks like it could work, thanks!
a
It’s possible to generate a file with a Gradle task too: https://stackoverflow.com/a/74771876/4161471