is there a way to reference/detect the iOS schema ...
# multiplatform
c
is there a way to reference/detect the iOS schema in kotlin? (ie - the equivalent of
#if Debug
in Swift)
f
no possible, you need to use expect/actual kotlin feature
👍 1
or inject the parameter from swift code.
c
Is there a way to access it from the actual iOS, kotlin code? I've done it before via injecting from the swift side, but am curious if there's a way to keep it all inside the kotlin modules
d
I use BuildKonfig 'flavours' feature and nominate a flavour when building from Xcode by adding the
buildkonfig.flavor
Gradle param to the
shared
module's Xcode Run Script Build Phase, i.e:
Copy code
./gradlew -Pbuildkonfig.flavor=$CONFIGURATION :shared:embedAndSignAppleFrameworkForXcode
...where
$CONFIGURATION
is the Xcode provided Configuration name implied by the selected scheme. Then the BuildKonfig setup in Gradle compiles in suitable values for my Xcode-selected environment - no Swift needed.