Skwiggs
Skwiggs

Reputation: 1435

Swift Package Manager - Dependency on active branch doesn’t pull new commits

I'm writing a Swift Package that relies on another package that I manage (Netswift). I've setup a bleeding_edge branch there, where I commit every few hours (i.e when I notice access control is wrong, or any other minor edit).

Now my current package has a dependency on the github repo for Netswift, with that bleeding_edge branch, as pictured below:

dependencies: [
    .package(url: "https://github.com/MrSkwiggs/Netswift", .branch("bleeding_edge")),
]

Unfortunately, resolving the dependency graph by any of the following means (updating Package.swift with an empty space somewhere, running swift package update) does not pull new commits from that branch.

The only way I found to force-update is to specify a different branch, resolve dependency graph, then revert back to the branch I actually need, then resolve dependency graph again.

Is there a better way to force-update the dependency graph?

I also don't want to add a target with an absolute path to this other local package, as colleagues will also need to rely on this at some point in the future.

Upvotes: 4

Views: 2795

Answers (1)

Skwiggs
Skwiggs

Reputation: 1435

You need to use XCode's built-in package update functionality, which can be found under:

File -> Swift Packages -> Update to Latest Package Versions

Running swift package update only works when the package is being worked on as a standalone; if the package is being edited through an existing XCode project/workspace then you need to let XCode handle it.

Upvotes: 6

Related Questions