ENUM
TargetDependency
Contents
- Cases
target(name:status:condition:)macro(name:)project(target:path:status:condition:)framework(path:status:condition:)library(path:publicHeaders:swiftModuleMap:condition:)package(product:type:condition:)sdk(name:type:status:condition:)xcframework(path:expectedSignature:status:condition:)xctestexternal(name:condition:)
- Properties
typeName
- Methods
sdk(name:type:condition:)target(_:condition:)
public enum TargetDependency: Codable, Hashable, SendableA target dependency.
Cases
target(name:status:condition:)
case target(name: String, status: LinkingStatus = .required, condition: PlatformCondition? = nil)Dependency on another target within the same project
- Parameters:
- name: Name of the target to depend on
- status: The dependency status (optional dependencies are weakly linked)
- condition: condition under which to use this dependency,
nilif this should always be used
macro(name:)
case macro(name: String)Dependency on a macro target within the same project
- Parameters:
- name: Name of the target to depend on
project(target:path:status:condition:)
case project(target: String, path: Path, status: LinkingStatus = .required, condition: PlatformCondition? = nil)Dependency on a target within another project
- Parameters:
- target: Name of the target to depend on
- path: Relative path to the other project directory
- status: The dependency status (optional dependencies are weakly linked)
- condition: condition under which to use this dependency,
nilif this should always be used
framework(path:status:condition:)
case framework(path: Path, status: LinkingStatus = .required, condition: PlatformCondition? = nil)Dependency on a prebuilt framework
- Parameters:
- path: Relative path to the prebuilt framework
- status: The dependency status (optional dependencies are weakly linked)
- condition: condition under which to use this dependency,
nilif this should always be used
library(path:publicHeaders:swiftModuleMap:condition:)
case library(path: Path, publicHeaders: Path, swiftModuleMap: Path?, condition: PlatformCondition? = nil)Dependency on prebuilt library
- Parameters:
- path: Relative path to the prebuilt library
- publicHeaders: Relative path to the library's public headers directory
- swiftModuleMap: Relative path to the library's swift module map file
- condition: condition under which to use this dependency,
nilif this should always be used
package(product:type:condition:)
case package(product: String, type: PackageType = .runtime, condition: PlatformCondition? = nil)Dependency on a swift package manager product using Xcode native integration. It's recommended to use external instead. For more info, check the external dependencies documentation .
- Parameters:
- product: The name of the output product. ${PRODUCT_NAME} inside Xcode. e.g. RxSwift
- type: The type of package being integrated.
- condition: condition under which to use this dependency,
nilif this should always be used
sdk(name:type:status:condition:)
case sdk(name: String, type: SDKType, status: LinkingStatus, condition: PlatformCondition? = nil)Dependency on system library or framework
- Parameters:
- name: Name of the system library or framework (not including extension) e.g.
ARKit,c++ - type: The dependency type
- status: The dependency status (optional dependencies are weakly linked)
- condition: condition under which to use this dependency,
nilif this should always be used
- name: Name of the system library or framework (not including extension) e.g.
xcframework(path:expectedSignature:status:condition:)
case xcframework(
path: Path,
expectedSignature: XCFrameworkSignature? = nil,
status: LinkingStatus = .required,
condition: PlatformCondition? = nil
)Dependency on a xcframework
- Parameters:
- path: Relative path to the xcframework
- expectedSignature: The expected signature if the xcframework is signed. Used for verifying the xcframework's integrity against the actual fingerprint derived from the given xcframeowrk
- status: The dependency status (optional dependencies are weakly linked)
- condition: condition under which to use this dependency,
nilif this should always be used
xctest
case xctestDependency on XCTest.
external(name:condition:)
case external(name: String, condition: PlatformCondition? = nil)Dependency on an external dependency imported through Package.swift.
- Parameters:
- name: Name of the external dependency
- condition: condition under which to use this dependency,
nilif this should always be used
Properties
typeName
public var typeName: StringMethods
sdk(name:type:condition:)
public static func sdk(name: String, type: SDKType, condition: PlatformCondition? = nil) -> TargetDependencyDependency on system library or framework
- Parameters:
- name: Name of the system library or framework (including extension) e.g.
ARKit.framework,libc++.tbd - type: Whether or not this dependecy is required. Defaults to
.required - condition: condition under which to use this dependency,
nilif this should always be used
- name: Name of the system library or framework (including extension) e.g.
Parameters
| Name | Description |
|---|---|
| name | Name of the system library or framework (including extension) e.g. ARKit.framework, libc++.tbd |
| type | Whether or not this dependecy is required. Defaults to .required |
| condition | condition under which to use this dependency, nil if this should always be used |
target(_:condition:)
public static func target(_ target: Target, condition: PlatformCondition? = nil) -> TargetDependencyDependency on another target within the same project. This is just syntactic sugar for .target(name: target.name).
- Parameters:
- target: Instance of the target to depend on
- condition: condition under which to use this dependency,
nilif this should always be used
Parameters
| Name | Description |
|---|---|
| target | Instance of the target to depend on |
| condition | condition under which to use this dependency, nil if this should always be used |
