Hi, is it possible to combine exporting an umbrell...
# ios
i
Hi, is it possible to combine exporting an umbrella framework (containing dependencies) with the CocoaPods plugin? https://kotlinlang.org/docs/mpp-build-native-binaries.html#export-dependencies-to-binaries Is there an example of this somewhere? Basically, is there a way to automate creating a .podspec file for such umbrella framework so that it can be integrated into iOS projects via CocoaPods?
Omitting the CocoaPods plugin would also do, as long as the podspec can also include the script to build the umbrella framework and embed it
k
I'm overdue to test this (sorry @russhwolf), but it should work: https://github.com/touchlab/KaMPKit/blob/rw/official-cocoapods/shared/build.gradle.kts#L104
Add an extension function for config
Copy code
fun CocoapodsExtension.framework(configuration: Framework.() -> Unit) {
    kotlin.targets.withType<KotlinNativeTarget> {
        binaries.withType<Framework> {
            configuration()
        }
    }
}
Then your cocoapods config looks like this:
Copy code
cocoapods {
        summary = "Common library for the KaMP starter kit"
        homepage = "<https://github.com/touchlab/KaMPKit>"
        framework {
            export(Deps.kermit)
            transitiveExport = true
        }
    }
i
Thanks!