Skip to main content

Project

A project representation used to define Xcode projects in Project.swift manifest files.

Overview

The Project struct is the root element of a Tuist manifest that describes an Xcode project. It contains all the information needed to generate an Xcode project including targets, schemes, settings, and dependencies.

Usage

import ProjectDescription

let project = Project(
    name: "MyProject",
    organizationName: "MyOrg",
    targets: [
        .target(
            name: "App",
            destinations: .iOS,
            product: .app,
            bundleId: "dev.tuist.App",
            infoPlist: "Config/App-Info.plist",
            sources: ["Sources/**"],
            resources: [
                "Resources/**",
                .folderReference(path: "Stubs")
            ],
            dependencies: [
                .project(target: "Framework1", path: "../Framework1")
            ]
        )
    ],
    schemes: [
        Scheme(
            name: "App-Debug",
            shared: true,
            buildAction: .buildAction(targets: ["App"]),
            testAction: .targets(["AppTests"]),
            runAction: .runAction(executable: "App")
        )
    ]
)

Initializer

name
String
required
The name of the project. Also used as the file name of the generated Xcode project.
organizationName
String?
default:"nil"
The name of the organization used by Xcode as copyright information.
classPrefix
String?
default:"nil"
The prefix for class files Xcode generates when you create a project or class file.
options
Options
default:".options()"
The project options for configuring Xcode project generation behavior.
packages
[Package]
default:"[]"
The Swift Packages used by the project.
settings
Settings?
default:"nil"
The build settings and configuration for the project.
targets
[Target]
default:"[]"
required
The targets of the project. See Target API for details.
schemes
[Scheme]
default:"[]"
The custom schemes for the project. Default schemes for each target are generated automatically if not specified. See Scheme API for details.
fileHeaderTemplate
FileHeaderTemplate?
default:"nil"
The custom file header template for Xcode built-in file templates.
additionalFiles
[FileElement]
default:"[]"
The additional files for the project. For target-specific additional files, see Target.additionalFiles.
resourceSynthesizers
[ResourceSynthesizer]
default:".default"
The resource synthesizers for the project to generate accessors for resources.

Properties

containsExternalDependencies
Bool
A computed property that returns true if the project contains targets that depend on external dependencies.
  • Target - Defines individual build targets
  • Scheme - Defines build, run, and test schemes
  • Settings - Defines build settings and configurations
  • Dependencies - Defines target dependencies