Contents

package(url:_:traits:)

Adds a remote package dependency starting with a specific minimum version, up to but not including a specified maximum version.

Declaration

static func package(url: String, _ range: Range<Version>, traits: Set<Package.Dependency.Trait> = [.defaults]) -> Package.Dependency

Parameters

  • url:

    The valid Git URL of the package.

  • range:

    The custom version range requirement.

  • traits:

    The trait configuration of this dependency. The default value enables the default traits of the package.

Return Value

A Package.Dependency instance.

Discussion

The following example allows the Swift Package Manager to pick versions 1.2.3, 1.2.4, 1.2.5, but not 1.2.6.

.package(url: "https://example.com/example-package.git", "1.2.3"..<"1.2.6"),

See Also

Creating a package dependency from a URL