STRUCT
Project
Contents
- Properties
nameorganizationNameoptionstargetsschemessettingsfileHeaderTemplateadditionalFilespathsourceRootPathxcodeProjPathpodspecPathfilesGrouplastUpgradeCheckisExternalprojectType
- Methods
init(name:organizationName:options:settings:targets:schemes:fileHeaderTemplate:additionalFiles:)hash(into:)
public struct Project: Codable, HashableA project representation.
A project manifest needs to be defined in a Project.swift manifest file. Manifests need to import the framework ProjectDescription which contains all the classes and enums that are available for you to describe your projects.
The snippet below shows an example project manifest:
import ProjectDescription
let project = Project(
name: "MyProject",
organizationName: "MyOrg",
targets: [
Target(
name: "App",
platform: .iOS,
product: .app,
bundleId: "io.geko.App",
infoPlist: "Config/App-Info.plist",
sources: ["Sources/**"],
resources: [
"Resources/**",
.folderReference(path: "Stubs"),
.folderReference(path: "ODR", tags: ["odr_tag"])
],
headers: .headers(
public: ["Sources/public/A/**", "Sources/public/B/**"],
private: "Sources/private/**",
project: ["Sources/project/A/**", "Sources/project/B/**"]
),
dependencies: [
.project(target: "Framework1", path: "../Framework1"),
.project(target: "Framework2", path: "../Framework2")
]
)
],
schemes: [
Scheme(
name: "App-Debug",
shared: true,
buildAction: .buildAction(targets: ["App"]),
testAction: .targets(["AppTests"]),
runAction: .runAction(executable: "App")
),
Scheme(
name: "App-Release",
shared: true,
buildAction: .buildAction(targets: ["App"]),
runAction: .runAction(executable: "App")
)
],
additionalFiles: [
"Dangerfile.swift",
"Documentation/**",
.folderReference(path: "Website")
]
)Properties
name
public var name: StringThe name of the project. Also, the file name of the generated Xcode project.
organizationName
public var organizationName: String?The name of the organization used by Xcode as copyright.
options
public var options: OptionsThe project options.
targets
public var targets: [Target]The targets of the project.
schemes
public var schemes: [Scheme]The custom schemes for the project. Default schemes for each target are generated by default.
settings
public var settings: SettingsThe build settings and configuration for the project.
fileHeaderTemplate
public var fileHeaderTemplate: FileHeaderTemplate?The custom file header template for Xcode built-in file templates.
additionalFiles
public var additionalFiles: [FileElement]The additional files for the project. For target's additional files, see Target/additionalFiles.
path
public var path: AbsolutePathPath to the folder that contains the project manifest.
sourceRootPath
public var sourceRootPath: AbsolutePathPath to the root of the project sources.
xcodeProjPath
public var xcodeProjPath: AbsolutePathPath to the Xcode project that will be generated.
podspecPath
public var podspecPath: AbsolutePath?Path to podspec. Not nil if the project was generated from podspec.
filesGroup
public var filesGroup: ProjectGroupThe group to place project files within
lastUpgradeCheck
public var lastUpgradeCheck: Version?The version in which a check happened related to recommended settings after updating Xcode.
isExternal
public var isExternal: BoolIndicates whether the project is imported through Dependencies.swift.
projectType
public var projectType: ProjectTypeIndicates the initialization type of this project
Methods
init(name:organizationName:options:settings:targets:schemes:fileHeaderTemplate:additionalFiles:)
public init(
name: String,
organizationName: String? = nil,
options: Options = .options(),
settings: Settings = .default,
targets: [Target] = [],
schemes: [Scheme] = [],
fileHeaderTemplate: FileHeaderTemplate? = nil,
additionalFiles: [FileElement] = []
)hash(into:)
public func hash(into hasher: inout Hasher)Parameters
| Name | Description |
|---|---|
| hasher | The hasher to use when combining the components of this instance. |
