ciauri
(Stephen Ciauri)
1
Hello!
I'd like to include little sample projects for my Swift Packages in the same repo as the package and I was wondering if relative local file paths are supported with the repositoryURL parameter. The Xcode UI doesn't seem to like them (file://../).
Cheers,
Stephen
Aciid
(Ankit Aggarwal)
2
You can drag and drop the package directory into the project.
1 Like
ciauri
(Stephen Ciauri)
3
Brilliant, thanks!
I also noticed that if I update a dependency version in the "drag and dropped" instance of the swift package that it doesn't pull the updated version.
dependencies: [
.package(url: "https://github.com/daltoniam/Starscream.git", from: "3.0.6" /* Update to 3.1.0 */)
],
Is a commit required for that to happen?
Cheers,
Stephen
Aciid
(Ankit Aggarwal)
4
Xcode should automatically update the dependencies unless the previously resolved version of Starscream already satisfied from: 3.1.0 (or maybe it failed to detect the change, in that case you can manually trigger a resolution File -> Swift Packages -> Resolve Package Versions).
ciauri
(Stephen Ciauri)
5
Ah, I see the issue. 3.1.0 satisfies the .from("3.0.6") requirement because it's within the "up to next major version". Changing it to ._exactItem("3.0.6") exhibits the behavior I was curious about.
Thanks again Aciid!
Aciid
(Ankit Aggarwal)
6
Just a minor note: _exactItem is an internal API, please use the public one instead:
.package(url: "https://github.com/daltoniam/Starscream.git", .exact("3.0.6"))