Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference .kt files from a swift package manager pulled repo #31

Closed
TrevorStoneEpic opened this issue Nov 5, 2020 · 3 comments
Closed

Comments

@TrevorStoneEpic
Copy link

So far the plugin has worked great for me, but I think there is an opportunity to make it even smoother. I have a Kotlin/Native project that generates an xcframework which I then pull in via swift package manager. When I have the Kotlin/Native project locally and registered as a Folder Reference in XCode it works great, but on a new machine where I don't have the original repo synced I cannot easily add breakpoints. Because SPM is based on the git repo it already is syncing all of the .kt files associated with the xcframework. Is there an easy way to make the plugin have access to these files? It would make it much easier for an iOS developer to debug the internals without needing a lot of additional steps.

The files get synced to
/Users/username/Library/Developer/Xcode/DerivedData/Packagename-byqdevosfmstyigxngorlffhsqub/SourcePackages/checkouts

@kpgalligan
Copy link
Collaborator

llvm adds absolute paths to files for debugging purposes. The kotlin compiler certainly does this, and as I understand it, so does Swift. That means, if you have a binary built on your machine, you can debug it. If you get a binary from another machine (with different source paths), you can't. There are ways to fix this, which we're looking into. Packaging and distributing binaries is a big internal focus right now (both cocoapods and SPM/xcframework).

What are you using for xcframework and SPM, by the way? Curious. I've gotten xcframeworks to build locally, but haven't tried SPM integration yet.

@TrevorStoneEpic
Copy link
Author

Oh that makes sense. Thank you for the clarification. I'll be excited to see what's coming down the line!

I currently have a pretty simple gradle task that calls out to xcodebuild and passes in the framework and dsym files to generate the xcframework and puts it in a specific frameworks folder in the github repo. I then defined a top level Package.swift file that defines a binaryTarget. Then with our standard release flow/tagging it's available for our iOS project. My biggest frustration so far is how to switch from a remote package to using a local one (don't seem to have a good alternative for something like mavenLocal), but otherwise it is an extremely easy way to have a versioned package for iOS.

The project isn't open source, but if you would like to see examples of any of those steps I would be happy to post generic versions

@kpgalligan
Copy link
Collaborator

Closing this. We are internally building tools for publishing and additions to the Xcode plugin to allow debugging of code built on other machines (CI, etc). This will also include SPM publishing tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants