Package
Represents a single package in the graph (either the root or a dependency).
struct PackageRepresents a single package in the graph (either the root or a dependency).
struct Packageimport PackagePluginlet dependencies: [PackageDependency]Any dependencies on other packages, in the same order as they are specified in the package manifest.
let directoryURL: URLThe absolute path of the package directory in the local file system.
let displayName: StringThe name of the package (for display purposes only).
let id: Package.IDUnique identifier for the package.
let origin: PackageOriginThe origin of the package (root, local, repository, registry, etc).
let products: [any 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: [any SourceModuleTarget] { get }let targets: [any 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: ToolsVersionThe 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 -> [any 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 -> [any 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 = Stringlet directory: PathThe absolute path of the package directory in the local file system.