https://kotlinlang.org logo
k

Kris Wong

04/15/2019, 9:37 PM
looks like the new cocoa pods plugin expects certain configurations names: "No enum constant org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.SECUREDEBUG"
what would be the best way to workaround that?
i

ilya.matveev

04/16/2019, 8:07 AM
You can change the pospec file generated by the CocoaPods plugin. The plugin uses the
kotlin.native.cocoapods.configuration
property to configure what type of framework (release or debug) should be passed to Xcode. This property is configured in the podspec file to be equal to the Xcode
CONFIGURATION
variable. But you can manually change the file and specify it depending on your configuration names. There are two valid values for this property:
RELEASE
and
DEBUG
.
k

Kris Wong

04/16/2019, 12:57 PM
yes, and i've done that just to test it. the question is, can I do some string manipulation conditional in the podspec file to derive the value that kotlin is expecting?
i don't really know anything about the podspec DSL. haven't found the relevant info yet.
i

ilya.matveev

04/16/2019, 1:07 PM
can I do some string manipulation conditional in the podspec file to derive the value that kotlin is expecting
Yes, you can. Code after the
:script => <<-SCRIPT
line is just a shell script executing the Gradle build. So you can check any conditions there and modify Gradle parameters accordingly.
k

Kris Wong

04/16/2019, 1:08 PM
cool thank you
-Pkotlin.native.cocoapods.configuration="${CONFIGURATION/Secure}" .. simple enough