https://kotlinlang.org logo
#ios
Title
# ios
j

Jacob Rhoda

10/17/2023, 3:19 PM
Is there a way to specify extra Gradle build options when building the KMP library through Cocoapods?
a

a-dd

10/17/2023, 3:34 PM
There is no built-in way, can you share why do you need this?
You can modify the podspec-generation task, but it’s not really robust
Copy code
tasks.named<PodspecTask>("podspec")() {
    doLast {
        outputFile.editGradleCommand()
    }
}
j

Jacob Rhoda

10/17/2023, 3:37 PM
I am trying to use this Gradle plugin called “BuildKonfig” to have different “flavors”, so that I can change the default environment that is selected when I build my app for release versus building for debugging.
a

a-dd

10/17/2023, 3:44 PM
You can access Xcode project configuration via
project.findProperty(KotlinCocoapodsPlugin.CONFIGURATION_PROPERTY)
, by default there will be
Debug
/
Release
values
j

Jacob Rhoda

10/17/2023, 3:51 PM
Ah I might be able to use that. Thanks!