Contents

package(id:_:traits:)

Adds a remote package dependency starting with a specific minimum version, going up to and including a specific maximum version.

Declaration

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

Parameters

  • id:

    The identity of the package.

  • range:

    The closed 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, as well as 1.2.6.

.package(id: "scope.name", "1.2.3"..."1.2.6"),

See Also

Creating a package dependency from a registry