Kind
The kind of package reference.
enum Kind
The kind of package reference.
enum Kind
import PackageModel
struct PackageReference
A package reference.
case root(AbsolutePath)
A root package.
case fileSystem(AbsolutePath)
A non-root local package.
case localSourceControl(AbsolutePath)
A local source package.
case remoteSourceControl(SourceControlURL)
A remote source package.
case registry(PackageIdentity)
A package from a registry.
init(identity: PackageIdentity, kind: Kind, name: String? = nil)
Create a package reference given its identity and kind.
static func fileSystem(identity: PackageIdentity, path: AbsolutePath) -> PackageReference
static func localSourceControl(identity: PackageIdentity, path: AbsolutePath) -> PackageReference
static func registry(identity: PackageIdentity) -> PackageReference
static func remoteSourceControl(identity: PackageIdentity, url: SourceControlURL) -> PackageReference
static func root(identity: PackageIdentity, path: AbsolutePath) -> PackageReference
var canonicalLocation: CanonicalPackageLocation { get }
var deprecatedName: String { get }
The name of the package, if available.
var description: String { get }
var diagnosticsMetadata: ObservabilityMetadata { get }
let identity: PackageIdentity
The identity of the package.
let kind: Kind
The kind of package: root, local, or remote.
var locationString: String { get }
The location of the package.
static func == (lhs: PackageReference, rhs: PackageReference) -> Bool
func equalsIncludingLocation(_ other: PackageReference) -> Bool
func hash(into hasher: inout Hasher)
func withName(_ newName: String) -> PackageReference
Create a new package reference object with the given name.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
var canonicalLocation: CanonicalPackageLocation { get }
var description: String { get }
var isRoot: Bool { get }
var locationString: String { get }
func encode(to encoder: Encoder) throws
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.