Has anyone had success with custom build configura...
# ios
e
Has anyone had success with custom build configurations in xcode (those apart from debug and release) together with a MPP shared library? I have created a configuration called PreProd that targets a different server url. When trying to build that configuration in iOS I get
No enum constant org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.PREPROD
. (Im using cocoapods)
b
You want build config from Xcode exposed to Kotlin?
e
Well really I'd be fine with an option that let me use the release version of my Kotlin lib for the preProd config of the iOS app. So Kotlin would not need to know about the config.
b
Hm okay. I think I'm still confused about what you're trying to do
e
Oh, sorry. In addition to the debug and release configurations in iOS I'd like a preProd configuration. When I create that in xcode and build I get the above error. I get the feeling that xcode is expecting a configuration of my mpp library with the same name.
b
Do you have an example of where you're trying to use that constant (gradle code)?
e
I’m not sure what you mean. Which constant?
Oh the Enum constant in the error? I’m not referencing it anywhere. I get a feeling that xcode is expecting for it to exist somewhere
Solved it with some help in #multiplatform. The trick was to edit the configuration in the common.podspec file so that if the configuration from iOS was PreProd I should build the release version of common.
Copy code
`-Pkotlin.native.cocoapods.configuration=$(if [ $CONFIGURATION = "PreProd" ]; then echo "Release"; else echo $CONFIGURATION; fi)  \`
👍 2