Dependency
The different types of a target’s dependency on another entity.
Target.swift:45Target-Dependency.mdenum Dependency
Creating a Target Dependency
static func product(name: String, package: String, condition: TargetDependencyCondition?
) -> Target.Dependency Creates a target dependency on a product from a package dependency.
static func product(name: String, package: String?
) -> Target.Dependency Creates a dependency on a product from a package dependency.
static func product(name: String, package: String
) -> Target.Dependency Creates a dependency on a product from a package dependency.
static func product(name: String, package: String?, moduleAliases: [String : String]?
) -> Target.Dependency Creates a dependency on a product from a dependent package.
static func product(name: String, package: String, moduleAliases: [String : String]?, condition: TargetDependencyCondition?
) -> Target.Dependency Creates a target dependency on a product from a package dependency.
static func target(name: String, condition: TargetDependencyCondition?
) -> Target.Dependency Creates a dependency on a target in the same package.
static func target(name: String
) -> Target.Dependency Creates a dependency on a target in the same package.
static func byName(name: String, condition: TargetDependencyCondition?
) -> Target.Dependency Creates a dependency that resolves to either a target or a product with the specified name.
static func byName(name: String
) -> Target.Dependency Creates a dependency that resolves to either a target or a product with the specified name.
struct TargetDependencyCondition
A condition that limits the application of a target’s dependency.
init(stringLiteral: String
) Creates a target dependency instance with the given value.
init(extendedGraphemeClusterLiteral: Self.StringLiteralType
) init(unicodeScalarLiteral: Self.ExtendedGraphemeClusterLiteralType
)
Identifying related types
ExtendedGraphemeClusterLiteralType
typealias StringLiteralType
The default type for an otherwise-unconstrained string literal.
UnicodeScalarLiteralType
Cases
case targetItem(name: String, condition: TargetDependencyCondition?)
A dependency on a target.
case productItem(name: String, package: String?, moduleAliases: [String : String]?, condition: TargetDependencyCondition?)
A dependency on a product.
case byNameItem(name: String, condition: TargetDependencyCondition?)
A by-name dependency on either a target or a product.
See also
var dependencies: [Target.Dependency]
The target’s dependencies on other entities inside or outside the package.
struct TargetDependencyCondition
A condition that limits the application of a target’s dependency.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (41) members.
Types
enum PluginCapability
The different types of capability that a plug-in can provide.
enum PluginUsage
A plug-in used in a target.
enum TargetType
The different types of a target.
Type members
static func binaryTarget(name: String, path: String
) -> Target Creates a binary target that references an artifact on disk.
static func binaryTarget(name: String, url: String, checksum: String
) -> Target Creates a binary target that references a remote artifact.
static func executableTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, packageAccess: Bool, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, plugins: [Target.PluginUsage]?
) -> Target Creates an executable target.
static func plugin(name: String, capability: Target.PluginCapability, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, packageAccess: Bool
) -> Target Defines a new package plug-in target.
static func systemLibrary(name: String, path: String?, pkgConfig: String?, providers: [SystemPackageProvider]?
) -> Target Creates a system library target.
static func target(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, packageAccess: Bool, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, plugins: [Target.PluginUsage]?
) -> Target Creates a regular target.
static func testTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, packageAccess: Bool, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, plugins: [Target.PluginUsage]?
) -> Target Creates a test target.
Show obsolete interfaces (11)
Hide obsolete interfaces
static func executableTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?
) -> Target Creates an executable target.
static func executableTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, plugins: [Target.PluginUsage]?
) -> Target Creates an executable target.
static func plugin(name: String, capability: Target.PluginCapability, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?
) -> Target Defines a new package plugin target.
static func target(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, publicHeadersPath: String?
) -> Target Creates a library or executable target.
static func target(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, publicHeadersPath: String?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?
) -> Target Creates a library or executable target.
static func target(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?
) -> Target Creates a regular target.
static func target(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, plugins: [Target.PluginUsage]?
) -> Target Creates a regular target.
static func testTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?
) -> Target Creates a test target.
static func testTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?
) -> Target Creates a test target.
static func testTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?
) -> Target Creates a test target.
static func testTarget(name: String, dependencies: [Target.Dependency], path: String?, exclude: [String], sources: [String]?, resources: [Resource]?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, plugins: [Target.PluginUsage]?
) -> Target Creates a test target.
Show system interfaces (1)
Hide system interfaces
init(name: String, dependencies: [Target.Dependency], path: String?, url: String?, exclude: [String], sources: [String]?, resources: [Resource]?, publicHeadersPath: String?, type: Target.TargetType, packageAccess: Bool, pkgConfig: String?, providers: [SystemPackageProvider]?, pluginCapability: Target.PluginCapability?, cSettings: [CSetting]?, cxxSettings: [CXXSetting]?, swiftSettings: [SwiftSetting]?, linkerSettings: [LinkerSetting]?, checksum: String?, plugins: [Target.PluginUsage]?
) Construct a target.
Instance members
var cSettings: [CSetting]?
The target’s C build settings.
var checksum: String?
The checksum for the archive file that contains the referenced binary artifact.
var cxxSettings: [CXXSetting]?
The target’s C++ build settings.
var exclude: [String]
The paths to source and resource files that you don’t want to include in the target.
var isTest: Bool
A Boolean value that indicates whether this is a test target.
var linkerSettings: [LinkerSetting]?
The target’s linker settings.
var name: String
The name of the target.
let packageAccess: Bool
If true, access to package declarations from other targets in the package is allowed.
var path: String?
The path of the target, relative to the package root.
let pkgConfig: String?
The name of the package configuration file, without extension, for the system library target.
var pluginCapability: Target.PluginCapability?
The capability provided by a package plug-in target.
var plugins: [Target.PluginUsage]?
The uses of package plug-ins by the target.
let providers: [SystemPackageProvider]?
The providers array for a system library target.
var publicHeadersPath: String?
The path to the directory that contains public headers of a C-family target.
var resources: [Resource]?
The explicit list of resource files in the target.
var sources: [String]?
The source files in this target.
var swiftSettings: [SwiftSetting]?
The target’s Swift build settings.
let type: Target.TargetType
The type of the target.
var url: String?
The URL of a binary target.
Citizens in PackageDescription
Conformances
protocol ExpressibleByExtendedGraphemeClusterLiteral
A type that can be initialized with a string literal containing a single extended grapheme cluster.
protocol ExpressibleByStringLiteral
A type that can be initialized with a string literal.
protocol ExpressibleByUnicodeScalarLiteral
A type that can be initialized with a string literal containing a single Unicode scalar value.