TargetKind
The target kind.
enum TargetKind
The target kind.
enum TargetKind
import PackageModel
struct TargetDescription
The description of an individual module.
case regular
case executable
case test
case system
case binary
case plugin
case macro
init(name: String, dependencies: [Dependency] = [], path: String? = nil, url: String? = nil, exclude: [String] = [], sources: [String]? = nil, resources: [Resource] = [], publicHeadersPath: String? = nil, type: TargetKind = .regular, packageAccess: Bool = true, pkgConfig: String? = nil, providers: [SystemPackageProviderDescription]? = nil, pluginCapability: PluginCapability? = nil, settings: [TargetBuildSettingDescription.Setting] = [], checksum: String? = nil, pluginUsages: [PluginUsage]? = nil) throws
let checksum: String?
The binary target checksum.
var dependencies: [Dependency] { get }
The declared target dependencies.
let exclude: [String]
The exclude patterns.
var isTest: Bool { get }
Returns true if the target type is test.
let name: String
The name of the target.
let packageAccess: Bool
If true, access to package declarations from other targets is allowed. APIs is not allowed from outside.
let path: String?
The custom path of the target.
let pkgConfig: String?
The pkg-config name of a system library target.
let pluginCapability: PluginCapability?
The declared capability for a package plugin target.
let pluginUsages: [PluginUsage]?
The usages of package plugins by the target.
let providers: [SystemPackageProviderDescription]?
The providers of a system library target.
let publicHeadersPath: String?
The custom public headers path.
let resources: [Resource]
The explicitly declared resources of the target.
let settings: [TargetBuildSettingDescription.Setting]
The target-specific build settings declared in this target.
let sources: [String]?
The custom sources of the target.
let type: TargetKind
The type of target.
let url: String?
The url of the binary target artifact.
enum Dependency
Represents a target’s dependency on another entity.
enum PluginCapability
Represents the declared capability of a package plugin.
enum PluginCommandIntent
enum PluginNetworkPermissionScope
enum PluginPermission
enum PluginUsage
Represents a target’s usage of a plugin target or product.
struct Resource
typealias TargetType = TargetKind
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init?(rawValue: String)
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func encode(to encoder: any Encoder) throws
Encodes this value into the given encoder, when the type’s RawValue
is String
.
func hash(into hasher: inout Hasher)