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
PlaceWorkspace.swift at the root of your repository or in the directory where you want to generate the workspace:
When to use Workspace.swift
UseWorkspace.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
The name of the workspace. Also used as the file name of the generated Xcode workspace (e.g.,
MyWorkspace.xcworkspace).projects
The paths (or glob patterns) to project manifest directories. Tuist will look for
Project.swift files in these locations.schemes
Custom workspace-level schemes. Default schemes for each target are generated automatically by default.
fileHeaderTemplate
The custom file header template for Xcode built-in file templates, applied to all projects in the workspace.
additionalFiles
Additional files to include in the workspace (e.g., documentation, README files) that aren’t part of any specific project.
generationOptions
Options that control workspace generation behavior.
Examples
Simple workspace
With glob patterns
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 aWorkspace.swift file, Tuist automatically:
- Finds all
Project.swiftfiles in the current directory and subdirectories - Generates a workspace with the name of the current directory
- Includes all discovered projects in the workspace