Top of tree development of unpublished packages

Maybe I’m missing something here but it looks like a dependency must resolve to an existing repo before I can switch to top of tree development. That’s inconvenient when I’m working on a new package and want to try using it before I’m prepared to publish.

From what I can see, given a package with a dependency:

.package(url: "https://github.com/this_repo_doesnt_exist_yet.git", from: "0.0.0"),

swift package edit my_new_package --path local_repo_path will fail with error: Could not find dependency 'my_new_package'

I need to create the repo and a 0.0.0 tag so the dependency resolves before I can swap it out with a local symlink. Is there an alternate dependency declaration I should be using to avoid this?

We need to improve this area but for now you can create a git repo locally and refer to it using file path + branch name.

.package(url: "../my_dependency", .branch("master")),

1 Like