Skip to main content

Overview

Workspace.swift is an optional manifest file that defines an Xcode workspace containing multiple projects. By default, tuist generate creates a workspace automatically, but you can use Workspace.swift to customize which projects are included and how they’re organized.

Location

Place Workspace.swift at the root of your repository or in the directory where you want to generate the workspace:

When to use Workspace.swift

Use Workspace.swift when you need to:
  • Include multiple independent projects in a single workspace
  • Add documentation files to the workspace
  • Define custom workspace-level schemes
  • Organize projects that don’t have dependencies between them
  • Control the exact structure of the generated workspace

Basic structure

Properties

name

String
required
The name of the workspace. Also used as the file name of the generated Xcode workspace (e.g., MyWorkspace.xcworkspace).

projects

[Path]
required
The paths (or glob patterns) to project manifest directories. Tuist will look for Project.swift files in these locations.

schemes

[Scheme]
default:"[]"
Custom workspace-level schemes. Default schemes for each target are generated automatically by default.

fileHeaderTemplate

FileHeaderTemplate?
default:"nil"
The custom file header template for Xcode built-in file templates, applied to all projects in the workspace.

additionalFiles

[FileElement]
default:"[]"
Additional files to include in the workspace (e.g., documentation, README files) that aren’t part of any specific project.

generationOptions

GenerationOptions
default:".options()"
Options that control workspace generation behavior.

Examples

Simple workspace

With glob patterns

This includes all Project.swift files found in the Projects, Features, and Frameworks directories and their subdirectories.

With additional files

With custom schemes

With file header template

With generation options

Project organization patterns

Feature-based organization

Layer-based organization

Workspace schemes

Workspace schemes allow you to define build and test actions that span multiple projects:

Best practices

Glob patterns

Use glob patterns to automatically include new projects without updating the workspace manifest.

Documentation

Include documentation files in additionalFiles to make them easily accessible in Xcode.

Shared schemes

Create workspace-level schemes for common operations like running all tests or building multiple apps.

Consistent structure

Organize projects in a clear directory structure that matches your team’s mental model.

Default behavior without Workspace.swift

If you don’t create a Workspace.swift file, Tuist automatically:
  1. Finds all Project.swift files in the current directory and subdirectories
  2. Generates a workspace with the name of the current directory
  3. Includes all discovered projects in the workspace
For simple projects or monorepos with a flat structure, this default behavior may be sufficient.