Skip to content

STRUCT

Workspace

Contents

  • Properties
    • name
    • projects
    • schemes
    • fileHeaderTemplate
    • additionalFiles
    • generationOptions
    • workspaceMappers
    • path
    • xcWorkspacePath
  • Methods
    • init(name:projects:schemes:fileHeaderTemplate:additionalFiles:generationOptions:workspaceMappers:)
swift
public struct Workspace: Codable, Equatable

A workspace representation.

By default, geko generate generates an Xcode workspace that has the same name as the current project. It includes the project and all its dependencies.

Geko allows customizing this behaviour by defining a workspace manifest within a Workspace.swift file.

Workspace manifests allow specifying a list of projects to generate and include in an Xcode workspace. Those projects don’t necessarily have to depend on one another. Additionally, files and folder references (such as documentation files) can be included in a workspace manifest.

The snippet below shows an example workspace manifest:

swift
import ProjectDescription

let workspace = Workspace(
    name: "Workspace",
    projects: ["Projects/**"]
)

Properties

name

swift
public var name: String

The name of the workspace. Also, the file name of the generated Xcode workspace.

projects

swift
public var projects: [FilePath]

The paths (or glob patterns) to manifest projects.

schemes

swift
public var schemes: [Scheme]

The custom schemes for the workspace. Default schemes for each target are generated by default.

fileHeaderTemplate

swift
public var fileHeaderTemplate: FileHeaderTemplate?

The custom file header template for Xcode built-in file templates.

additionalFiles

swift
public var additionalFiles: [FileElement]

The additional files for the workspace. For project's additional files, see Project/additionalFiles.

generationOptions

swift
public var generationOptions: GenerationOptions

The generation configuration of the workspace.

workspaceMappers

swift
public var workspaceMappers: [WorkspaceMapper]

The workspace mappers from plugins.

path

swift
public var path: AbsolutePath

Path to where the manifest / root directory of this workspace is located

xcWorkspacePath

swift
public var xcWorkspacePath: AbsolutePath

Path to where the .xcworkspace will be generated

Methods

init(name:projects:schemes:fileHeaderTemplate:additionalFiles:generationOptions:workspaceMappers:)

swift
public init(
    name: String,
    projects: [FilePath],
    schemes: [Scheme] = [],
    fileHeaderTemplate: FileHeaderTemplate? = nil,
    additionalFiles: [FileElement] = [],
    generationOptions: GenerationOptions = .options(),
    workspaceMappers: [WorkspaceMapper] = []
)