I'm wondering about the Package.swift file and thi...
# touchlab-tools
d
I'm wondering about the Package.swift file and this line in it: path: "./allshared/build/XCFrameworks/debug/\(packageName).xcframework" no build folder is usually checked in, so how does this work? Shouldn't this point to the zip file in Releases?
k
That's for local builds.
Package.swift
at the git tag points at the release url. Example, 0.1.6 in the quick start repo: https://github.com/touchlab/KMMBridgeSPMQuickStart/commit/c237ec345bfca6b924e8e3b4140123152b7f4881
👍 1
d
OK, I see, but then I in Xcode I need to put the URL of the tag or the root folder?
Because according to docs it seems that the root URL, but if so I wonder how Xcode knows that it need to fetch the tag instead of the root.
k
Package.swift
needs to be in your root folder. Xcode/SPM uses git tags for versions.
In Xcode, when you add an SPM package, it asks how you want to handle versions, and (generally) defaults to "Up to Next Major Version": https://touchlab.co/kmmbridge/spm/iosspm#xcode-configuration. That's all SPM. SPM relies on git tags for versions.
🙏 1
d
ahhh interesting
we are still not being able to add it correctly, we have 2 issues, the first one, tried now also with the template repository, when you add that on Xcode I get the same screen that there is on the docs: but when you press add package, the entire source code is downloaded (the kmm code, not the iOS code), is that what is expected? We expected just the relevant zip to be downloaded
now we have the source code, but no iOS binary :S
is this maybe related to authentication, and if the authentication is correct I would get the right binary? Or maybe some Xcode caching issue? We are lost with this.
It seem that the issue is really regarding authentication as you note here: https://touchlab.co/kmmbridge/xcodeauth The question is if we can require that from our users, that's complicated to ask from them just to add a dependency, we are not sure what to do
the question would be why you don't simply push the zip content to the root of the tag instead of referencing a zip? then you would not need a separate authentication configuration for the binary 🤔
k
but when you press add package, the entire source code is downloaded (the kmm code, not the iOS code), is that what is expected? We expected just the relevant zip to be downloaded
Yes. That's how Xcode works. If you publish to a different repo, that won't happen.
is this maybe related to authentication
Probably
The question is if we can require that from our users, that's complicated to ask from them just to add a dependency, we are not sure what to do
Yeah, it sucks, but to download binaries, GitHub requires auth even for public binaries. However, one of our devs reported getting binary download of public binaries to work without auth. That would still need verification. During initial KMMBridge research, we tried many methods of doing this without success. I'm concerned that download without auth seems to work because of some kind of caching issue.
the question would be why you don't simply push the zip content to the root of the tag instead of referencing a zip?
I don't know what you mean. Check the zip into the repo itself? If yes, sure, you can. That doesn't work well for ongoing dev scenarios because the repo becomes huge. You can try it, though.
d
"I don't know what you mean." normally when you build locally, you get the Framework in a folder, if you check that in and reference that in Package.swift you can import that dependeny into Xcode also, not needing the .zip
k
Yeah, you can do that. I'd say that's where most people start when they try to set this up manually. It "works" until it doesn't, basically. Those builds can be large, and Xcode starts to really dislike git once you get into gigabytes of repo size. If each build is 50m+, for a dev repo, that means you get 50-100 builds before it's not usable. If you're not doing many builds, you can try it.
d
what I meant is that this could be an option for kmmbridge, to pushing the non-zip version to the tag and referencing that instead of the zip in Package.swift
do you know by chance if for getting the github binary a classic PAT should also work, or ONLY a fine PAT?