Use .product() to reference package dependency. Fixes package usage for git mirror.#485
Open
dvshelley wants to merge 1 commit intoAlamofire:masterfrom
Open
Use .product() to reference package dependency. Fixes package usage for git mirror.#485dvshelley wants to merge 1 commit intoAlamofire:masterfrom
dvshelley wants to merge 1 commit intoAlamofire:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goals ⚽
If you are accessing this repo via a git mirror, the SPM dependency reference by name/string will fail if the mirror's URL doesn't end in the package name (Alamofire). This can happen if the pattern used for mirroring requires a change to the URL.
e.g. dependencies: ["Alamofire"],
You must explicitly reference the dependency with a .product() that defines the name to be used for the dependency.
e.g. .product(name: "Alamofire", package: "Alamofire")
Implementation Details 🚧
I believe usage of the .product() explicit reference was introduced in Swift 5.2 to the SwiftPM manifest API for the PackageDescription module. The
swift-tools-version:5.9reference in the current Package.swft should be good to make sure that this change doesn't break anyone that currently uses AlamofireImage.Testing Details 🔍
We have tested this change that it works with a git mirror.