Hi, I'm starting with multiplatform development an...
# multiplatform
j
Hi, I'm starting with multiplatform development and right now I am struggling if there is a way to create a binary SPM zip. I found https://github.com/ge-org/multiplatform-swiftpackage a KMMBridge. The former seems abandoned and the later seems not to support precompiled binaries in SPM. But I could have missed something easily. Thank you.
h
What do you mean with binary spm zip? I just create the package.swift file and include the XCFramework as binary targets: https://github.com/hfhbd/testing-coroutines/blob/67801abf94403f2abeaa312635fcfae9207c8437/build.gradle.kts#L54
If you want to distribute it, you need to publish the package.swift file as well as the XCFramework and you need to include the checksum in package.swift
p
All of those steps (publish the package.swift file along with the ZIP of the compiled binary framework along with the correct computed checksum) are steps that KMMBridge does when you configure it to publish to SPM.
j
Thanks for the replies. So I'll explore it more, I'm a bit lost but that's beceause I'm new to this.
I need to publish it to gitlab package registry, so I'm a bit lost there if it is even possible, how to produce the zip and upload on my own.
p
KMMBridge makes use of the gradle maven artifact publishing under the hood. If you setup Gitlab package hosting, configured in your gradle file with appropriate deploy keys (and I believe .netrc - our docs talk about that for Github) you should be able to host the binaries. The Package.swift file is committed back to your repo, along with tags for versions. Its been a little while, but I had all that working as an experiment, so the details are a little vague in my head right now.
👍 1