Hi there! Does anyone know if we can create a swif...
# multiplatform
m
Hi there! Does anyone know if we can create a swiftpackage with standard Kotlin tooling (so not using the https://github.com/ge-org/multiplatform-swiftpackage gradle plugin?) We would love to use that one, but it does not support creating 3 architectures at once for now, and it creates & uses a new
createXCFramework
task, which is different from the
assembleMyModuleReleaseXCFramework
task that the official Kotlin tooling provides, but does not support the arm64-simulator slice at the moment. I’m kind of tempted to write some custom Gradle tooling already, because creating the swiftpackage is basically: creating the xcframework (which
assembleMyModuleReleaseXCFramework
already does), creating a simple
Package.swift
file, and zipping that. Thanks a lot for helping! 👏
g
Not that I'm aware of. Sharing our process if it can help: we defined a Package.swift with some keys (%BINARY_URL% for example) to replace. Then a gradle task copy (with replace) and zip:
Copy code
copy {
    from("$projectDir/src/iosMain/Package.swift")
    into(...)
    filter {
      it.replace("%BINARY_URL%", remoteBinaryUrl)
        .replace("%BINARY_CHECKSUM%", checksum)
    }
}
Copy code
tasks.register<Zip>("zipXCFramework") {
    from(tasks.findByName("assembleMyModuleReleaseXCFramework"))
    into("MyModule.xcframework")
}
👍 1
m
yeah, doing the same here
e
btw there's a template engine already, you don't need to build your own https://docs.gradle.org/current/javadoc/org/gradle/api/file/ContentFilterable.html#expand-java.util.Map-
👌 1
k
we’re doing the same thing but a bit more manually (but soon via github actions) as we’re creating the frameworks from a private repo and publishing them using a swift package to a public repo. mainly using a couple of small custom gradle tasks similar to the above.