ToolsVersion
Tools version represents version of the Swift toolchain.
struct ToolsVersion
Tools version represents version of the Swift toolchain.
struct ToolsVersion
import PackageModel
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Decodable
A type that can decode itself from an external 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
init(from decoder: any Decoder) throws
init?(string: String)
Create an instance of tools version from a given string.
init(version: Version)
Create instance of tools version from a given version.
static let current: ToolsVersion
The current tools version in use.
static let minimumRequired: ToolsVersion
The minimum tools version that is required by the package manager.
static let v3: ToolsVersion
static let v4: ToolsVersion
static let v4_2: ToolsVersion
static let v5: ToolsVersion
static let v5_10: ToolsVersion
static let v5_2: ToolsVersion
static let v5_3: ToolsVersion
static let v5_4: ToolsVersion
static let v5_5: ToolsVersion
static let v5_6: ToolsVersion
static let v5_7: ToolsVersion
static let v5_8: ToolsVersion
static let v5_9: ToolsVersion
static let v6_0: ToolsVersion
static let vNext: ToolsVersion
var description: String { get }
var major: Int { get }
The major version number.
var minor: Int { get }
The minor version number.
var patch: Int { get }
The patch version number.
var runtimeSubpath: RelativePath { get }
The subpath to the PackageDescription runtime library.
var swiftLanguageVersion: SwiftLanguageVersion { get }
The swift language version based on this tools version.
var versionSpecificKeys: [String] { get }
The list of version specific identifiers to search when attempting to load version specific package or version information, in order of preference.
var zeroedPatch: ToolsVersion { get }
Returns the tools version with zeroed patch number.
static func < (lhs: ToolsVersion, rhs: ToolsVersion) -> Bool
func specification(roundedTo leastSignificantVersion: LeastSignificantVersion = .automatic) -> String
Returns a Swift tools version specification specifying the version to the given precision.
func validateToolsVersion(_ currentToolsVersion: ToolsVersion) -> Bool
Returns true if the tools version is valid and can be used by this version of the package manager.
func validateToolsVersion(_ currentToolsVersion: ToolsVersion, packageIdentity: PackageIdentity, packageVersion: String? = .none) throws
enum LeastSignificantVersion
The least significant version to round to.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.