Reputation: 3307
So I am working on two packages in tandem, where Package A depends on Package B.
Package A -> Package B
Each package is in a separate git repository, and I would like to avoid having to push changes from Package B to remote every time I make a change just to be able to use it with Package A.
Using the documentation here, I have put Package B in edit mode like so:
$ cd /path/to/package_a/checkout/location
$ swift package edit PackageB --path /path/to/package_b/checkout/location
Based on my understanding, this should basically tell SPM to reference the local checkout of the package, at the specified --path
, rather than managing its own checkout.
But the thing is, if I open package A in XCode:
open /path/to/package_a/checkout/location/Package.swift
And I go to "show source" on Package B, it's showing me the checkout in the derived data folder.
So it seems like XCode is not observing the edit mode configuration provided by SPM? Or else how do I achieve having XCode point to a local checkout of a package rather than the default behavior?
Upvotes: 2
Views: 162
Reputation: 3910
You can use Xcode to work on a Swift Package (Package.swift
) and also edit a dependency of that package, but it requires the creation of an empty xcworkspace
rather than using the swift package edit
command, which doesn't seem to be supported in Xcode. Full details in this blog post but the summary is:
Step #4 is tricky because you need to make sure to drag it to the root of the workspace and not into the package you added in #2. Xcode makes this hard.
Upvotes: 0