Skip to content

Use .product() to reference package dependency. Fixes package usage for git mirror.#485

Open
dvshelley wants to merge 1 commit intoAlamofire:masterfrom
dvshelley:master
Open

Use .product() to reference package dependency. Fixes package usage for git mirror.#485
dvshelley wants to merge 1 commit intoAlamofire:masterfrom
dvshelley:master

Conversation

@dvshelley
Copy link

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.9 reference 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant