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

Jan Skrasek

10/04/2023, 1:31 PM
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

hfhbd

10/04/2023, 1:50 PM
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

psh

10/04/2023, 2:33 PM
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

Jan Skrasek

10/04/2023, 2:34 PM
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

psh

10/04/2023, 2:39 PM
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
3 Views