I’m using the new Experimental DSL to produce an X...
# multiplatform
b
I’m using the new Experimental DSL to produce an XCFramework for iOS. My setup is pretty basic (a single module), and it seems to work (I can see the output xcframework in my build folder when I run the
assembleMyLibXCFramework
task. So far so good. Here’s how I have it configured:
Copy code
kotlinArtifacts {
    Native.XCFramework("MyLib") {
        targets(iosX64, iosArm64, iosSimulatorArm64)
        modes(NativeBuildType.DEBUG, NativeBuildType.RELEASE)

        linkerOptions = linkerOptions + listOf("-lsqlite3")
    }
}
Sooo … Now I want to publish the xcframework via cocoapods (eventually SPM as well, but one thing at a time…). I don’t see how the new DSL to produce the framework works with the existing
cocoapods
DSL provided by the
native.cocoapods
plugin? Or maybe they don’t work together at all? Can I publish an XCFramework generated with the Experimental DSL using cocoapods? How so?
s
My understanding is that they not work together even if they do similar. The
native.cocoapods
is an all-included where it create a
.framework
and produce a
podspec
file to work with. I would say you are better dealing with cocoapods directly. Because yes you can publish an XCFramework using Cocoapods. You can have a look here starting from the
How to distribute XCFrameworks using Cocoapods
part https://anuragajwani.medium.com/distributing-universal-ios-frameworks-as-xcframeworks-using-cocoapods-699c70a5c961
a
In 1.8.20 there will be some integration that would allow you to generate podspec together with a XCFramework. But you can distribute it now too, you’ll just need to write a basic podspec by hand