Русский (Russian)
Appearance
STRUCT
Target
Contents
name
destinations
product
productName
bundleId
deploymentTargets
infoPlist
sources
resources
copyFiles
headers
entitlements
scripts
dependencies
settings
coreDataModels
environmentVariables
launchArguments
additionalFiles
buildRules
mergedBinaryType
mergeable
onDemandResourcesTags
metadata
target(name:destinations:product:productName:bundleId:deploymentTargets:infoPlist:sources:resources:copyFiles:headers:entitlements:scripts:dependencies:settings:coreDataModels:environmentVariables:launchArguments:additionalFiles:buildRules:mergedBinaryType:mergeable:onDemandResourcesTags:metadata:)
public struct Target: Codable, Equatable, Sendable
A target of a project.
name
public var name: String
The name of the target. Also, the product name if not specified with productName
.
destinations
public var destinations: Destinations
The destinations this target supports, e.g. iPhone, appleVision, macCatalyst
product
public var product: Product
The type of build product this target will output.
productName
public var productName: String?
The built product name. If nil, it will be equal to name
.
bundleId
public var bundleId: String
The product bundle identifier.
deploymentTargets
public var deploymentTargets: DeploymentTargets?
The minimum deployment targets your product will support.
infoPlist
public var infoPlist: InfoPlist?
The Info.plist representation.
sources
public var sources: SourceFilesList?
The source files of the target. Note: any playgrounds matched by the globs used in this property will be automatically added.
resources
public var resources: ResourceFileElements?
The resource files of target. Note: localizable files, *.lproj
, are supported.
copyFiles
public var copyFiles: [CopyFilesAction]?
The build phase copy files actions for the target.
headers
public var headers: Headers?
The headers for the target.
entitlements
public var entitlements: Entitlements?
The entitlements representation.
Note: For per-configuration entitlements, you should:
- Keep this property as
nil
- Set the
CODE_SIGN_ENTITLEMENTS
build setting usingTarget.settings
for each configuration- If you want the entitlement files to be included in the project navigator, add them using
Project.additionalFiles
Example:
swiftlet target = Target( name: "MyApp", // ... other properties entitlements: nil, // Important: keep this as nil settings: .settings( configurations: [ .debug(name: "Debug", settings: ["CODE_SIGN_ENTITLEMENTS": "Debug.entitlements"]), .release(name: "Release", settings: ["CODE_SIGN_ENTITLEMENTS": "Release.entitlements"]) ] ) ) let project = Project( name: "MyProject", targets: [target], additionalFiles: [ "Debug.entitlements", "Release.entitlements" ] )
scripts
public var scripts: [TargetScript]
The build phase scripts actions for the target.
dependencies
public var dependencies: [TargetDependency]
The target's dependencies.
settings
public var settings: Settings?
The target's settings.
coreDataModels
public var coreDataModels: [CoreDataModel]
The Core Data models.
environmentVariables
public var environmentVariables: [String: EnvironmentVariable]
The environment variables. Used by autogenerated schemes for the target.
launchArguments
public var launchArguments: [LaunchArgument]
The launch arguments. Used by autogenerated schemes for the target.
additionalFiles
public var additionalFiles: [FileElement]
The additional files for the target. For project's additional files, see Project/additionalFiles
.
buildRules
public var buildRules: [BuildRule]
The build rules used for transformation of source files during compilation.
mergedBinaryType
public var mergedBinaryType: MergedBinaryType
Specifies whether if the target can merge or not the dynamic dependencies as part of its binary
mergeable
public var mergeable: Bool
Specifies whether if the target can be merged as part of another binary or not
onDemandResourcesTags
public var onDemandResourcesTags: OnDemandResourcesTags?
The target's tags associated with on demand resources
metadata
public var metadata: TargetMetadata
The target's metadata.
target(name:destinations:product:productName:bundleId:deploymentTargets:infoPlist:sources:resources:copyFiles:headers:entitlements:scripts:dependencies:settings:coreDataModels:environmentVariables:launchArguments:additionalFiles:buildRules:mergedBinaryType:mergeable:onDemandResourcesTags:metadata:)
public static func target(
name: String,
destinations: Destinations,
product: Product,
productName: String? = nil,
bundleId: String,
deploymentTargets: DeploymentTargets? = nil,
infoPlist: InfoPlist? = .default,
sources: SourceFilesList? = nil,
resources: ResourceFileElements? = nil,
copyFiles: [CopyFilesAction]? = nil,
headers: Headers? = nil,
entitlements: Entitlements? = nil,
scripts: [TargetScript] = [],
dependencies: [TargetDependency] = [],
settings: Settings? = nil,
coreDataModels: [CoreDataModel] = [],
environmentVariables: [String: EnvironmentVariable] = [:],
launchArguments: [LaunchArgument] = [],
additionalFiles: [FileElement] = [],
buildRules: [BuildRule] = [],
mergedBinaryType: MergedBinaryType = .disabled,
mergeable: Bool = false,
onDemandResourcesTags: OnDemandResourcesTags? = nil,
metadata: TargetMetadata = .default
) -> Self