Is there a way to define dependency in Package.swift
that would point at a certain branch latest commit, or even to just a specific commit ID (just like it is possible with Carthage)?
Use case would be, let's say I have a library repo where I would like to branch out and make some changes, and then be able to test them out in a dependent project.
It is possible.
As of Swift 4 you can use .branch()
and .revision()
as described in PackageDescription.md.
Not yet, but swiftpm team is working on. Now you must specify a package version when declaring a dependency.
import PackageDescription
let package = Package(
name: "Example",
dependencies: [
.Package(url: "https://github.com/somePackage", "1.0.0")
]
)
In the future it will be possible, there was a discussion to add Version Locking but its not accepted and implemented yet.
For your use case you can fork the repo, do the changes, test them and then add a version tag to your fork. Now it's much more easier to do changes with Editable Packages functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With