Package
Represents a single package in the graph (either the root or a dependency).
struct Package
Represents a single package in the graph (either the root or a dependency).
struct Package
import PackagePlugin
let dependencies: [PackageDependency]
Any dependencies on other packages, in the same order as they are specified in the package manifest.
let directoryURL: URL
The absolute path of the package directory in the local file system.
let displayName: String
The name of the package (for display purposes only).
let id: ID
Unique identifier for the package.
let origin: PackageOrigin
The origin of the package (root, local, repository, registry, etc).
let products: [Product]
Any regular products defined in this package (except plugin products), in the same order as they are specified in the package manifest.
var sourceModules: [SourceModuleTarget] { get }
let targets: [Target]
Any regular targets defined in this package (except plugin targets), in the same order as they are specified in the package manifest.
let toolsVersion: ToolsVersion
The tools version specified by the resolved version of the package. Behavior is often gated on the tools version, to make sure older packages continue to work as intended.
func products(named productNames: [String]) throws -> [Product]
The list of products matching the given names. Throws an error if any of the products cannot be found.
func products<T>(ofType: T.Type) -> [T] where T : Product
The products in this package that conform to a specific type.
func targets(named targetNames: [String]) throws -> [Target]
The list of targets matching the given names. Throws an error if any of the targets cannot be found.
func targets<T>(ofType: T.Type) -> [T] where T : Target
The targets in this package that conform to a specific type.
typealias ID = String
let directory: Path
The absolute path of the package directory in the local file system.