Closed aiongg closed 1 year ago
I've actually never used our Swift package stuff (I'm still using the Xcode + cargo
setup, another contributor named Jomy10
contributed Swift package support) so I don't have a good answer for you.
This is mainly because I currently use swift-bridge
for one application and that application was set up before we had Swift packages.
I think that most people using swift-bridge
within their own applications are using Swift
packages though.
So, hopefully someone else sees this issue. If you look through some of the issues you might be able to find someone that you can email to ask about their setup. Then we can document the answer to your question.
In the meantime, I'll tag @NiwakaDev to see if he has any thoughts here?
Also, this sounds like more of an issue with Xcode
than swift-bridge
, so you might first consider trying:
So this is definitely not related to swift-bridge
packages, they seem to work just fine. I'll leave some notes here for future readers who might find it useful, and close this issue.
I tried everything under the sun related XCode settings/caches/data dirs/etc. Even uninstalling and reinstalling app store vs. dev portal download versions. In case anyone else runs into this issue, the following is my solution:
As near as I can tell, XCode does not like importing a local folder directly, whether created by swift-bridge
or otherwise. It wants a git repo, and a local folder that overrides the git repo. There are some suggestions out there about making a fake local git repo, providing Xcode with the "file URL", and then overriding it, but none of these worked for me.
Using XcodeGen
works perfectly. If you are a rust dev new to swift/ios/mac and struggling with Xcode, try this:
swift-bridge
and put it in any local folder you like (mine goes right into the same folder as the rest of my swift code)XcodeGen
project.yml
that references your local swift-bridge
package folder, and use that package as normal (see the xcodegen docs for details on how to point to a local package).xcodeproj
file from git, delete it, and recreate it with xcodegen
every time you make changes (make sure you get all of the necessary build settings into a separate Info.plist
first)
Is it possible to use the packages created by swift bridge locally, or is it necessary to set up a separate git repo and load them that way? I seemed to be OK building my bridge package in a folder under my project's monorepo and choosing "Add Local..." in XCode, at first. Then it started being very flaky, and now XCode cannot load any packages at all into my project (which is also under the monorepo). I have Googling and trying everything under the sun to fix it for a full day with no results.
What should my folder / git repo structure be for: