Русский (Russian)
Appearance
ENUM
Entitlements
Contents
file(path:)
dictionary(_:)
variable(_:)
path
public enum Entitlements: Codable, Equatable, Sendable
file(path:)
case file(path: Path)
The path to an existing .entitlements file.
dictionary(_:)
case dictionary([String: Plist.Value])
A dictionary with the entitlements content. Tuist generates the .entitlements file at the generation time.
variable(_:)
case variable(String)
A build setting variable that points to an .entitlements file.
This should be used when you have an xcconfig file or build setting that defines a variable pointing to the entitlements file path. This is particularly useful when the project has different entitlements files per configuration (e.g., debug, release, staging).
Example:
.target(
...
entitlements: .variable("$(ENTITLEMENT_FILE_VARIABLE)")
)
Or, as literal string:
.target(
...
entitlements: "$(ENTITLEMENT_FILE_VARIABLE)"
)
Note: For per-configuration entitlements, you can also:
- Keep
Target.entitlements
asnil
- 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" ] )
path
public var path: Path?