ToolProperties
Properties of a known tool in a Toolset
.
struct ToolProperties
Properties of a known tool in a Toolset
.
struct ToolProperties
import PackageModel
struct Toolset
A set of paths and flags for tools used for building Swift packages. This type unifies pre-existing assorted ways to specify these properties across SwiftPM codebase.
init(from toolsetPath: AbsolutePath, at fileSystem: FileSystem, _ observabilityScope: ObservabilityScope) throws
Initialize a toolset from an encoded file on a file system.
init(toolchainBinDir: AbsolutePath, buildFlags: BuildFlags = .init())
Initialize a new ad-hoc toolset that wasn’t previously serialized, but created in memory.
var knownTools: [KnownTool : ToolProperties] { get }
A dictionary of known tools in this toolset.
var rootPaths: [AbsolutePath] { get }
An array of paths specified as rootPath
in toolset files from which this toolset was formed. May be used for locating tools that aren’t currently listed in KnownTool
.
mutating func merge(with newToolset: Toolset)
Merges toolsets together into a single configuration. Tools passed in a new toolset will shadow tools with same names from previous toolsets. When no path
is specified for a new tool, its extraCLIOptions
are appended to extraCLIOptions
of a tool from a previous toolset, which allows augmenting existing tools instead of replacing them.
enum KnownTool
Tools currently known and used by SwiftPM.
protocol Equatable
A type that can be compared for value equality.
var extraCLIOptions: [String] { get }
Command-line options to be passed to the tool when it’s invoked.
var path: AbsolutePath? { get }
Absolute path to the tool on the filesystem. If absent, implies a default tool is used.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.