Static Methodswift-package-manager 6.0.1PackageDescription
package(id:_:)
Adds a package dependency starting with a specific minimum version, up to but not including a specified maximum version.
PackageDependency.swift:641- SwiftPM
- 5.7+
static func package(id: String, _ range: Range<Version>) -> Package.Dependency
Parameters
Returns
A Package.Dependency
instance.
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(id: "scope.name", "1.2.3"..<"1.2.6"),
The following example allows the Swift Package Manager to pick versions between 1.0.0 and 2.0.0
.package(id: "scope.name", .upToNextMajor(from: "1.0.0"),
The following example allows the Swift Package Manager to pick versions between 1.0.0 and 1.1.0
.package(id: "scope.name", .upToNextMinor(from: "1.0.0"),
Other members in extension
Types
enum Kind
The type of dependency.
enum RegistryRequirement
An enum that represents the requirement for a package dependency.
enum SourceControlRequirement
An enum that represents the requirement for a package dependency.
Show obsolete interfaces (1)
Hide obsolete interfaces
enum Requirement
An enum that represents the requirement for a package dependency.
Type members
static func package(id: String, ClosedRange<Version>
) -> Package.Dependency Adds a package dependency starting with a specific minimum version, going up to and including a specific maximum version.
static func package(id: String, exact: Version
) -> Package.Dependency Adds a package dependency that uses the exact version requirement.
static func package(id: String, from: Version
) -> Package.Dependency Adds a package dependency that uses the version requirement, starting with the given minimum version, going up to the next major version.
static func package(name: String, path: String
) -> Package.Dependency Adds a dependency to a package located at the given path on the filesystem.
static func package(path: String
) -> Package.Dependency Adds a dependency to a package located at the given path.
static func package(url: String, ClosedRange<Version>
) -> Package.Dependency Adds a package dependency starting with a specific minimum version, going up to and including a specific maximum version.
static func package(url: String, Range<Version>
) -> Package.Dependency Adds a package dependency starting with a specific minimum version, up to but not including a specified maximum version.
static func package(url: String, branch: String
) -> Package.Dependency Adds a remote package dependency given a branch requirement.
static func package(url: String, exact: Version
) -> Package.Dependency Adds a package dependency that uses the exact version requirement.
static func package(url: String, from: Version
) -> Package.Dependency Adds a package dependency that uses the version requirement, starting with the given minimum version, going up to the next major version.
static func package(url: String, revision: String
) -> Package.Dependency Adds a remote package dependency given a revision requirement.
Show obsolete interfaces (7)
Hide obsolete interfaces
static func package(name: String?, url: String, Package.Dependency.Requirement
) -> Package.Dependency Adds a remote package dependency with a given version requirement.
static func package(name: String, url: String, ClosedRange<Version>
) -> Package.Dependency Adds a package dependency starting with a specific minimum version, going up to and including a specific maximum version.
static func package(name: String, url: String, Range<Version>
) -> Package.Dependency Adds a package dependency starting with a specific minimum version, up to but not including a specified maximum version.
static func package(name: String, url: String, branch: String
) -> Package.Dependency Adds a remote package dependency given a branch requirement.
static func package(name: String, url: String, from: Version
) -> Package.Dependency Adds a package dependency that uses the version requirement, starting with the given minimum version, going up to the next major version.
static func package(name: String, url: String, revision: String
) -> Package.Dependency Adds a remote package dependency given a revision requirement.
static func package(url: String, Package.Dependency.Requirement
) -> Package.Dependency Adds a remote package dependency given a version requirement.
Instance members
let kind: Kind
A description of the package dependency.
Show obsolete interfaces (3)
Hide obsolete interfaces
var name: String?
The name of the dependency.
var requirement: Requirement
The dependency requirement of the package dependency.
var url: String?
The Git URL of the package dependency.