diff --git a/README.md b/README.md index 859907e7..44a1d6c3 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,24 @@ targets: ``` A project would be created with 2 connected targets, with all the required configurations and build settings. See the [Project Spec](Docs/ProjectSpec.md) documentation for all the options you can specify, and [Usage](Docs/Usage.md) for more general documentation. +## Schema validation + +XcodeGen provides a JSON Schema for validating project specs and enabling editor features such as code completion. Reference the latest schema in a YAML project spec with: + +```yaml +# yaml-language-server: $schema=https://raw.githubusercontent.com/yonaskolb/XcodeGen/master/schema/xcodegen.schema.json +name: MyProject +``` + +For a JSON project spec, use the `$schema` property: + +```json +{ + "$schema": "https://raw.githubusercontent.com/yonaskolb/XcodeGen/master/schema/xcodegen.schema.json", + "name": "MyProject" +} +``` + ## Installing Make sure the latest stable (non-beta) version of Xcode is installed first. diff --git a/schema/xcodegen.schema.json b/schema/xcodegen.schema.json new file mode 100644 index 00000000..02a99dd6 --- /dev/null +++ b/schema/xcodegen.schema.json @@ -0,0 +1,2188 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/yonaskolb/XcodeGen/master/schema/xcodegen.schema.json", + "title": "XcodeGen Project Spec", + "description": "Schema for XcodeGen project specification files", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the generated project" + }, + "include": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "The path to the included file" + }, + "relativePaths": { + "type": "boolean", + "description": "Whether the included spec specifies paths relative to itself (default) or the root spec file" + }, + "enable": { + "type": "boolean", + "description": "Whether the specified spec should be included. Can be specified by environment variable" + } + }, + "required": [ + "path" + ] + } + ] + } + } + ], + "description": "One or more paths to other specs. Used to split project spec into multiple files for easier structuring or sharing" + }, + "createIntermediateGroups": { + "type": "boolean", + "description": "If true, intermediate groups will be created for every path component" + }, + "generateEmptyDirectories": { + "type": "boolean", + "description": "Generate empty directories in the project" + }, + "options": { + "type": "object", + "description": "Various options to override default behaviour", + "properties": { + "minimumXcodeGenVersion": { + "type": "string", + "description": "The minimum version of XcodeGen required" + }, + "carthageBuildPath": { + "type": "string", + "description": "Path to the Carthage build directory. Defaults to Carthage/Build" + }, + "carthageExecutablePath": { + "type": "string", + "description": "Path to the carthage executable. Defaults to carthage" + }, + "createIntermediateGroups": { + "type": "boolean", + "description": "If true, intermediate groups will be created for every path component between the folder containing the source and next existing group" + }, + "bundleIdPrefix": { + "type": "string", + "description": "Targets without PRODUCT_BUNDLE_IDENTIFIER get autogenerated one: bundleIdPrefix.targetName" + }, + "settingPresets": { + "type": "string", + "enum": [ + "all", + "none", + "project", + "targets" + ], + "description": "Controls settings automatically applied. all: project and target; project: only project; targets: only targets; none: no settings" + }, + "developmentLanguage": { + "type": "string", + "description": "Sets the development language of the project. Defaults to en" + }, + "xcodeVersion": { + "type": "string", + "description": "The version of Xcode. Format: 0910 or 9.1" + }, + "deploymentTarget": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Project-wide deployment target per platform (e.g. iOS: 9.0)" + }, + "transitivelyLinkDependencies": { + "type": "boolean", + "description": "If true, targets link to dependencies of their target dependencies. Defaults to false" + }, + "groupSortPosition": { + "type": "string", + "enum": [ + "top", + "bottom", + "none" + ], + "description": "Where groups are sorted: none=alphabetically; top=before files; bottom=after files (default)" + }, + "generateEmptyDirectories": { + "type": "boolean", + "description": "If true, empty directories will be added to project. Defaults to false" + }, + "schemePathPrefix": { + "type": "string", + "description": "Path prefix for relative paths in schemes (e.g. StoreKitConfiguration). Default ../../ for non-workspace; use ../ for workspaces" + }, + "usesTabs": { + "type": "boolean", + "description": "Override user's setting for tabs vs spaces in the project" + }, + "indentWidth": { + "type": "integer", + "description": "Override user's setting for indent width in number of spaces" + }, + "tabWidth": { + "type": "integer", + "description": "Override user's setting for tab width in number of spaces" + }, + "disabledValidations": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Validations to disable: missingConfigs, missingConfigFiles, missingTestPlans" + }, + "defaultConfig": { + "type": "string", + "description": "Default configuration for command line builds. If not set, first config alphabetically is chosen" + }, + "groupOrdering": { + "type": "array", + "items": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "Group name pattern (regex). Omit for main group" + }, + "order": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Order of groups" + } + } + }, + "description": "Order of groups in the project" + }, + "findCarthageFrameworks": { + "type": "boolean", + "description": "When true, all individual frameworks for Carthage dependencies are automatically found. Defaults to false" + }, + "localPackagesGroup": { + "type": "string", + "description": "Group name for local packages. Defaults to Packages. Use empty string for project root" + }, + "fileTypes": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "file": { + "type": "boolean", + "description": "Whether this extension should be treated like a file. Defaults to true" + }, + "buildPhase": { + "type": "string", + "description": "The default build phase" + }, + "attributes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Additional settings attributes for build files" + }, + "resourceTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "On Demand Resource Tags for resources" + }, + "compilerFlags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Compiler flags to add" + } + } + }, + "description": "Default file options for specific extensions across the project" + }, + "preGenCommand": { + "type": "string", + "description": "Bash command to run before project generation. Won't run if project unchanged due to cache" + }, + "postGenCommand": { + "type": "string", + "description": "Bash command to run after project generation (e.g. pod install). Won't run if project unchanged due to cache" + }, + "useBaseInternationalization": { + "type": "boolean", + "description": "If false and no Base.lproj resources, Base won't be in known regions. Defaults to true" + }, + "defaultSourceDirectoryType": { + "type": "string", + "enum": [ + "group", + "folder", + "syncedFolder" + ], + "description": "Type for directory sources when not specified: group (default), folder, or syncedFolder (Xcode 16)" + } + } + }, + "attributes": { + "type": "object", + "additionalProperties": true, + "description": "PBXProject attributes. Advanced use. LastUpgradeCheck defaults to xcodeVersion if not set" + }, + "breakpoints": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Breakpoint type: File, Exception, SwiftError, OpenGLError, Symbolic, IDEConstraintError, IDETestFailure, RuntimeIssue" + }, + "enabled": { + "type": "boolean", + "description": "Whether breakpoint is active. Default true" + }, + "ignoreCount": { + "type": "integer", + "description": "Times to ignore before stopping. Default 0" + }, + "continueAfterRunningActions": { + "type": "boolean", + "description": "Continue after evaluating actions. Default false" + }, + "path": { + "type": "string", + "description": "File path (required for file breakpoints)" + }, + "line": { + "type": "integer", + "description": "Line number (required for file breakpoints)" + }, + "symbol": { + "type": "string", + "description": "Symbol (for symbolic breakpoints)" + }, + "module": { + "type": "string", + "description": "Module (for symbolic breakpoints)" + }, + "scope": { + "type": "string", + "enum": [ + "All", + "Objective-C", + "C++" + ], + "description": "Exception breakpoint scope. Default Objective-C" + }, + "stopOnStyle": { + "type": "string", + "enum": [ + "throw", + "catch" + ], + "description": "Stop on throw or catch. Default throw" + }, + "condition": { + "type": "string", + "description": "Breakpoint condition" + }, + "actions": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Breakpoint actions: DebuggerCommand, Log, ShellCommand, GraphicsTrace, AppleScript, Sound" + } + }, + "required": [ + "type" + ] + }, + "description": "Add shared breakpoints to the generated project" + }, + "configs": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Project build configurations. Values 'debug' and 'release' apply default build settings; other values (e.g. 'none') apply no defaults." + }, + "configFiles": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": ".xcconfig files per config" + }, + "settings": { + "$ref": "#/definitions/Settings", + "description": "Project specific settings" + }, + "settingGroups": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": true + }, + "description": "Named groups of Build Settings that can be reused elsewhere via settings.groups" + }, + "targets": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Target" + }, + "description": "The list of targets in the project mapped by name" + }, + "fileGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Paths to add to project root. Not included in targets (e.g. xcconfig folder, README)" + }, + "schemes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Scheme" + }, + "description": "Schemes by name. Allows more control than target scheme" + }, + "schemeTemplates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Scheme" + }, + "description": "Scheme templates referenced via scheme templates property. Use to extract common scheme settings" + }, + "targetTemplates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Target" + }, + "description": "Target templates referenced via target templates property. Use to extract common target settings" + }, + "packages": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/RemotePackage" + }, + { + "$ref": "#/definitions/LocalPackage" + } + ] + }, + "description": "Map of Swift packages by name. Linked to targets via dependency package:" + }, + "projectReferences": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProjectReference" + }, + "description": "Map of project references by name. Reference targets via ProjectName/TargetName" + } + }, + "definitions": { + "Target": { + "type": "object", + "description": "Target configuration. Product type and platform are required", + "properties": { + "name": { + "type": "string", + "description": "Override target name when using include/templates" + }, + "type": { + "type": "string", + "description": "Product type providing default build settings", + "enum": [ + "application", + "application.on-demand-install-capable", + "application.messages", + "application.watchapp", + "application.watchapp2", + "application.watchapp2-container", + "app-extension", + "app-extension.intents-service", + "app-extension.messages", + "app-extension.messages-sticker-pack", + "bundle", + "bundle.ocunit-test", + "bundle.ui-testing", + "bundle.unit-test", + "extensionkit-extension", + "framework", + "framework.static", + "instruments-package", + "library.dynamic", + "library.static", + "tool", + "tv-app-extension", + "watchkit-extension", + "watchkit2-extension", + "xcode-extension", + "driver-extension", + "system-extension", + "xpc-service", + "" + ] + }, + "platform": { + "description": "Platform providing default build settings. Use auto with supportedDestinations. Array for multi-platform targets", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "iOS", + "macOS", + "tvOS", + "watchOS", + "visionOS" + ] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "iOS", + "macOS", + "tvOS", + "watchOS", + "visionOS" + ] + } + } + ] + }, + "supportedDestinations": { + "description": "Supported platform destinations: iOS, tvOS, macOS, macCatalyst, visionOS, watchOS", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deploymentTarget": { + "description": "Deployment target (e.g. 9.2). Object for per-platform values in multi-platform targets", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + ] + }, + "sources": { + "description": "Source directories. String or list of paths/TargetSource objects", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TargetSource" + } + ] + } + } + ] + }, + "dependencies": { + "type": "array", + "items": { + "$ref": "#/definitions/Dependency" + }, + "description": "Dependencies: target, framework, carthage, sdk, package, or bundle" + }, + "configFiles": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": ".xcconfig files per config" + }, + "plist": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": true + } + }, + "required": [ + "path" + ] + } + ] + }, + "info": { + "description": "Generates Info.plist at path. Auto-generates CFBundleIdentifier, CFBundleName, etc.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": true + } + }, + "required": [ + "path" + ] + } + ] + }, + "entitlements": { + "description": "Generates .entitlements file. Sets CODE_SIGN_ENTITLEMENTS. All properties must be provided", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "properties": { + "type": "object", + "additionalProperties": true + } + }, + "required": [ + "path" + ] + } + ] + }, + "buildToolPlugins": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plugin": { + "type": "string", + "description": "Plugin name" + }, + "package": { + "type": "string", + "description": "Package containing the plugin" + } + }, + "required": [ + "plugin" + ] + }, + "description": "Build tool plugins that run automatically during the build" + }, + "preBuildScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/BuildScript" + }, + "description": "Scripts that run before any other build phases" + }, + "postBuildScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/BuildScript" + }, + "description": "Scripts that run after any other build phases" + }, + "preCompileScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/BuildScript" + }, + "description": "Scripts that run before Compile Sources phase" + }, + "postCompileScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/BuildScript" + }, + "description": "Scripts that run after Compile Sources phase" + }, + "buildRules": { + "type": "array", + "items": { + "$ref": "#/definitions/BuildRule" + }, + "description": "Custom build rules" + }, + "scheme": { + "$ref": "#/definitions/TargetScheme", + "description": "Generated scheme with tests or config variants" + }, + "legacy": { + "$ref": "#/definitions/LegacyTarget", + "description": "Opt-in to Xcode External Build System legacy target" + }, + "template": { + "type": "string" + }, + "templates": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Target template names to merge with. ${target_name} replaced in templates" + }, + "templateAttributes": { + "type": "object", + "additionalProperties": true, + "description": "Attributes for ${attributeName} replacement in templates" + }, + "transitivelyLinkDependencies": { + "type": "boolean", + "description": "Override project option. If true, link to dependencies of target dependencies" + }, + "directlyEmbedCarthageDependencies": { + "type": "boolean", + "description": "If true, embed Carthage frameworks via Embed Frameworks phase instead of copy-frameworks script. Default true except iOS/tvOS/watchOS apps" + }, + "requiresObjCLinking": { + "type": "boolean", + "description": "If true, targets linking to this get -ObjC in OTHER_LDFLAGS. Required for static libs with ObjC categories. Default true for library.static" + }, + "onlyCopyFilesOnInstall": { + "type": "boolean", + "description": "If true, Embed Frameworks/Extensions phases have Copy only when installing checked. Default false" + }, + "putResourcesBeforeSourcesBuildPhase": { + "type": "boolean", + "description": "If true, Copy Resources runs before Compile Sources" + }, + "attributes": { + "type": "object", + "additionalProperties": true + }, + "settings": { + "$ref": "#/definitions/Settings" + } + }, + "additionalProperties": false + }, + "TargetSource": { + "type": "object", + "description": "Source file or directory with optional filters and build phase overrides", + "properties": { + "path": { + "type": "string", + "description": "Path to the source file or directory" + }, + "name": { + "type": "string", + "description": "Override name. Default: last path component" + }, + "group": { + "type": "string", + "description": "Override parent group. Use / for multiple groups" + }, + "createIntermediateGroups": { + "type": "boolean", + "description": "Override options.createIntermediateGroups" + }, + "excludes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Glob patterns to exclude. Relative to path. Supports **" + }, + "includes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Glob patterns to include. Excludes override if both match" + }, + "compilerFlags": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "Compiler flags for files under this path" + }, + "headerVisibility": { + "type": "string", + "enum": [ + "public", + "private", + "project" + ], + "description": "Header visibility. Defaults to public" + }, + "type": { + "type": "string", + "enum": [ + "file", + "folder", + "group", + "syncedFolder" + ], + "description": "file=file ref; group=group with files (default); folder=folder ref; syncedFolder=Xcode 16 buildable folder" + }, + "destinationFilters": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "Platform destinations for these files. Default: all" + }, + "inferDestinationFiltersByPath": { + "type": "boolean", + "description": "Filter by path patterns like **/iOS/* or *_iOS.swift. Ignored if destinationFilters set" + }, + "optional": { + "type": "boolean", + "description": "Disable missing path check. Default false" + }, + "buildPhase": { + "description": "Build phase: sources, resources, headers, none, or copyFiles with destination", + "oneOf": [ + { + "type": "string", + "enum": [ + "sources", + "resources", + "headers", + "none" + ] + }, + { + "type": "object", + "properties": { + "copyFiles": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "enum": [ + "absolutePath", + "productsDirectory", + "wrapper", + "executables", + "resources", + "javaResources", + "frameworks", + "sharedFrameworks", + "sharedSupport", + "plugins" + ] + }, + "subpath": { + "type": "string" + } + }, + "required": [ + "destination" + ] + } + }, + "required": [ + "copyFiles" + ] + } + ] + }, + "attributes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Additional settings attributes for build files" + }, + "resourceTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "On Demand Resource Tags for resources" + } + }, + "required": [ + "path" + ] + }, + "Dependency": { + "oneOf": [ + { + "type": "object", + "properties": { + "target": { + "type": "string" + }, + "embed": { + "type": "boolean" + }, + "codeSign": { + "type": "boolean" + }, + "removeHeaders": { + "type": "boolean" + }, + "link": { + "type": "boolean" + }, + "weak": { + "type": "boolean" + }, + "platformFilter": { + "type": "string", + "enum": [ + "iOS", + "macOS", + "all" + ] + }, + "destinationFilters": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "platforms": { + "type": "array", + "items": { + "type": "string" + } + }, + "copy": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "enum": [ + "absolutePath", + "productsDirectory", + "wrapper", + "executables", + "resources", + "javaResources", + "frameworks", + "sharedFrameworks", + "sharedSupport", + "plugins" + ] + }, + "subpath": { + "type": "string" + } + }, + "required": [ + "destination" + ] + } + }, + "required": [ + "target" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "package": { + "type": "string" + }, + "product": { + "type": "string" + }, + "products": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "type": "string" + } + }, + "required": [ + "package" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "sdk": { + "type": "string" + }, + "root": { + "type": "string" + } + }, + "required": [ + "sdk" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "carthage": { + "type": "string" + }, + "findFrameworks": { + "type": "boolean" + }, + "linkType": { + "type": "string", + "enum": [ + "dynamic", + "static" + ] + }, + "platformFilter": { + "type": "string", + "enum": [ + "iOS", + "macOS", + "all" + ] + }, + "destinationFilters": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "carthage" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "framework": { + "type": "string" + }, + "embed": { + "type": "boolean" + }, + "codeSign": { + "type": "boolean" + }, + "weak": { + "type": "boolean" + }, + "implicit": { + "type": "boolean" + }, + "platformFilter": { + "type": "string", + "enum": [ + "iOS", + "macOS", + "all" + ] + }, + "destinationFilters": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "copy": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "enum": [ + "absolutePath", + "productsDirectory", + "wrapper", + "executables", + "resources", + "javaResources", + "frameworks", + "sharedFrameworks", + "sharedSupport", + "plugins" + ] + }, + "subpath": { + "type": "string" + } + }, + "required": [ + "destination" + ] + } + }, + "required": [ + "framework" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "git": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "commit": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "submodules": { + "type": "boolean" + } + }, + "required": [ + "git" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "xctest": { + "type": "boolean" + } + }, + "required": [ + "xctest" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "bundle": { + "type": "string" + } + }, + "required": [ + "bundle" + ], + "additionalProperties": false + } + ] + }, + "BuildScript": { + "type": "object", + "description": "Run script build phase. Either path or script required", + "properties": { + "script": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "path": { + "type": "string", + "description": "Relative or absolute path to shell script" + }, + "name": { + "type": "string", + "description": "Script name. Defaults to Run Script" + }, + "shell": { + "type": "string", + "description": "Shell for script. Defaults to /bin/sh" + }, + "inputFiles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Input files for dependency analysis" + }, + "outputFiles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Output files for dependency analysis" + }, + "inputFileLists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Input .xcfilelist files" + }, + "outputFileLists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Output .xcfilelist files" + }, + "showEnvVars": { + "type": "boolean", + "description": "Print env vars to build log. Defaults to true" + }, + "basedOnDependencyAnalysis": { + "type": "boolean", + "description": "Skip script if inputs/outputs unchanged. Defaults to true" + }, + "runOnlyWhenInstalling": { + "type": "boolean", + "description": "Only run when installing (runOnlyForDeploymentPostprocessing). Default false" + }, + "discoveredDependencyFile": { + "type": "string", + "description": "Discovered dependency .d file path" + } + } + }, + "BuildRule": { + "type": "object", + "description": "Custom build rule. filePattern or fileType required; script or compilerSpec required", + "properties": { + "name": { + "type": "string", + "description": "Build rule name. Defaults to Build Rule" + }, + "filePattern": { + "type": "string", + "description": "Glob pattern for files (e.g. *.xcassets)" + }, + "fileType": { + "type": "string", + "description": "Xcode file type (e.g. sourcecode.swift, file.xib)" + }, + "script": { + "type": "string", + "description": "Script to run on each file" + }, + "outputFiles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Output files" + }, + "outputFilesCompilerFlags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Compiler flags for output files" + }, + "compilerSpec": { + "type": "string", + "description": "Built-in Apple tool reference (advanced)" + }, + "runOncePerArchitecture": { + "type": "boolean", + "description": "Run once per architecture. Defaults to true" + } + } + }, + "TargetScheme": { + "type": "object", + "description": "Convenience for auto-generating schemes from config variants or tests", + "properties": { + "configVariants": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Generates a scheme per entry using configs with name + debug/release variants" + }, + "testTargets": { + "description": "Test targets to include in scheme (build + test entries)", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TestableTargetReference" + } + ] + } + }, + "gatherCoverageData": { + "type": "boolean", + "description": "Gather code coverage. Default false" + }, + "coverageTargets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Targets to gather coverage for" + }, + "disableMainThreadChecker": { + "type": "boolean", + "description": "Disable Main Thread Checker. Default false" + }, + "stopOnEveryMainThreadCheckerIssue": { + "type": "boolean", + "description": "Stop at every Main Thread Checker issue. Default false" + }, + "disableThreadPerformanceChecker": { + "type": "boolean", + "description": "Disable Thread Performance Checker. Default false" + }, + "buildImplicitDependencies": { + "type": "boolean", + "description": "Build implicit dependencies. Default true" + }, + "language": { + "type": "string", + "description": "Application language for run/test" + }, + "region": { + "type": "string", + "description": "Application region for run/test" + }, + "commandLineArguments": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "environmentVariables": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentVariable" + } + } + ] + }, + "testPlans": { + "type": "array", + "items": { + "$ref": "#/definitions/TestPlan" + }, + "description": "Test plan paths (xctestplan)" + }, + "preActions": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecutionAction" + } + }, + "postActions": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecutionAction" + } + }, + "management": { + "type": "object", + "properties": { + "shared": { + "type": "boolean", + "description": "Whether scheme is shared" + }, + "orderHint": { + "type": "integer", + "description": "Used by Xcode to sort schemes" + }, + "isShown": { + "type": "boolean", + "description": "Whether scheme is shown in scheme list" + } + }, + "description": "Scheme management options" + }, + "storeKitConfiguration": { + "type": "string", + "description": "StoreKit configuration for run" + } + } + }, + "LegacyTarget": { + "type": "object", + "properties": { + "toolPath": { + "type": "string", + "description": "Path to the build tool used in the legacy target" + }, + "arguments": { + "type": "string", + "description": "Build arguments used for the build tool" + }, + "passSettings": { + "type": "boolean", + "description": "Whether to pass build settings down to the build tool" + }, + "workingDirectory": { + "type": "string", + "description": "Working directory under which the build tool will be invoked" + } + }, + "required": [ + "toolPath" + ] + }, + "Scheme": { + "type": "object", + "description": "Scheme with build, run, test, profile, analyze, archive actions", + "properties": { + "templates": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Scheme template names. ${scheme_name} replaced in templates" + }, + "templateAttributes": { + "type": "object", + "additionalProperties": true, + "description": "Attributes for ${attributeName} in templates" + }, + "build": { + "$ref": "#/definitions/Build" + }, + "run": { + "$ref": "#/definitions/RunAction" + }, + "test": { + "$ref": "#/definitions/TestAction" + }, + "profile": { + "$ref": "#/definitions/ProfileAction" + }, + "analyze": { + "$ref": "#/definitions/AnalyzeAction" + }, + "archive": { + "$ref": "#/definitions/ArchiveAction" + }, + "shared": { + "type": "boolean", + "description": "Whether scheme is shared" + }, + "orderHint": { + "type": "integer", + "description": "Used by Xcode to sort schemes" + }, + "isShown": { + "type": "boolean", + "description": "Whether scheme is shown in scheme list" + } + } + }, + "Build": { + "type": "object", + "description": "Build action: targets to build and which build types (run, test, profile, analyze, archive)", + "properties": { + "targets": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string", + "enum": [ + "all", + "none", + "test", + "testing", + "run", + "running", + "profile", + "profiling", + "analyze", + "analyzing", + "archive", + "archiving" + ] + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "all", + "none", + "test", + "testing", + "run", + "running", + "profile", + "profiling", + "analyze", + "analyzing", + "archive", + "archiving" + ] + } + } + ] + } + }, + "parallelizeBuild": { + "type": "boolean", + "description": "Build targets in parallel. Default true" + }, + "buildImplicitDependencies": { + "type": "boolean", + "description": "Build implicit dependencies. Default true" + }, + "runPostActionsOnFailure": { + "type": "boolean", + "description": "Whether to run post scripts even if build fails" + }, + "preActions": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecutionAction" + } + }, + "postActions": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecutionAction" + } + } + } + }, + "ExecutionAction": { + "type": "object", + "description": "Script run before/after build action via preActions/postActions", + "properties": { + "script": { + "type": "string", + "description": "Inline shell script" + }, + "name": { + "type": "string", + "description": "Script name. Defaults to Run Script" + }, + "actionType": { + "type": "string", + "enum": [ + "shellScriptAction" + ] + }, + "shell": { + "type": "string" + }, + "target": { + "type": "string", + "description": "Build/test target whose settings become env vars (settingsTarget)" + } + }, + "required": [ + "script" + ] + }, + "RunAction": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonBuildAction" + }, + { + "type": "object", + "properties": { + "executable": { + "type": "string", + "description": "Target to launch. Default: first runnable build target" + }, + "askForAppToLaunch": { + "type": "boolean" + }, + "launchAutomaticallySubstyle": { + "type": "integer" + }, + "debugEnabled": { + "type": "boolean" + }, + "storeKitConfigurationFileReference": { + "type": "string" + }, + "locationScenarioReference": { + "type": "string" + }, + "enableGPUFrameCaptureMode": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ] + }, + "enableAddressSanitizer": { + "type": "boolean" + }, + "enableThreadSanitizer": { + "type": "boolean" + }, + "enableUBSanitizer": { + "type": "boolean" + }, + "stopOnEveryMainThreadCheckerIssue": { + "type": "boolean" + }, + "stopOnEveryUBSanitizerIssue": { + "type": "boolean" + }, + "disableMainThreadChecker": { + "type": "boolean" + }, + "commandLineArguments": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "environmentVariables": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentVariable" + } + } + ] + } + } + } + ] + }, + "TestAction": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonBuildAction" + }, + { + "type": "object", + "properties": { + "targets": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TestableTargetReference" + } + ] + } + }, + "gatherCoverageData": { + "type": "boolean" + }, + "coverageTargets": { + "type": "array", + "items": { + "type": "string" + } + }, + "parallelizable": { + "type": "boolean" + }, + "randomExecutionOrder": { + "type": "boolean" + }, + "location": { + "type": "string" + }, + "skipped": { + "type": "boolean" + }, + "skippedTests": { + "type": "array", + "items": { + "type": "string" + } + }, + "selectedTests": { + "type": "array", + "items": { + "type": "string" + } + }, + "testPlans": { + "type": "array", + "items": { + "$ref": "#/definitions/TestPlan" + } + }, + "commandLineArguments": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "environmentVariables": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentVariable" + } + } + ] + } + } + } + ] + }, + "TestableTargetReference": { + "oneOf": [ + { + "type": "object", + "properties": { + "target": { + "type": "string" + }, + "parallelizable": { + "type": "boolean" + }, + "randomExecutionOrder": { + "type": "boolean" + }, + "skipped": { + "type": "boolean" + }, + "skippedTests": { + "type": "array", + "items": { + "type": "string" + } + }, + "selectedTests": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "target" + ] + }, + { + "type": "object", + "properties": { + "package": { + "type": "string" + }, + "parallelizable": { + "type": "boolean" + }, + "randomExecutionOrder": { + "type": "boolean" + }, + "skipped": { + "type": "boolean" + }, + "skippedTests": { + "type": "array", + "items": { + "type": "string" + } + }, + "selectedTests": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "package" + ] + }, + { + "type": "object", + "properties": { + "local": { + "type": "string" + }, + "parallelizable": { + "type": "boolean" + }, + "randomExecutionOrder": { + "type": "boolean" + }, + "skipped": { + "type": "boolean" + }, + "skippedTests": { + "type": "array", + "items": { + "type": "string" + } + }, + "selectedTests": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "local" + ] + }, + { + "type": "object", + "properties": { + "project": { + "type": "string" + }, + "parallelizable": { + "type": "boolean" + }, + "randomExecutionOrder": { + "type": "boolean" + }, + "skipped": { + "type": "boolean" + }, + "skippedTests": { + "type": "array", + "items": { + "type": "string" + } + }, + "selectedTests": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "project" + ] + } + ] + }, + "TestPlan": { + "type": "object", + "description": "Reference to xctestplan. Must be created in Xcode and checked in", + "properties": { + "path": { + "type": "string", + "description": "Path to xctestplan file" + }, + "defaultPlan": { + "type": "boolean", + "description": "Whether this is the default plan. Default false" + } + }, + "required": [ + "path" + ] + }, + "ProfileAction": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonBuildAction" + }, + { + "type": "object", + "properties": { + "executable": { + "type": "string", + "description": "Target to profile" + }, + "askForAppToLaunch": { + "type": "boolean" + }, + "commandLineArguments": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "environmentVariables": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentVariable" + } + } + ] + } + } + } + ] + }, + "AnalyzeAction": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonBuildAction" + } + ] + }, + "ArchiveAction": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonBuildAction" + }, + { + "type": "object", + "properties": { + "customArchiveName": { + "type": "string", + "description": "Custom name for the archive" + }, + "revealArchiveInOrganizer": { + "type": "boolean", + "description": "Reveal archive in Xcode Organizer after build" + } + } + } + ] + }, + "CommonBuildAction": { + "type": "object", + "description": "Options shared by run, test, profile, analyze, archive actions", + "properties": { + "config": { + "type": "string", + "description": "Build config to use. debug for run/test/analyze; release for profile/archive" + }, + "preActions": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecutionAction" + } + }, + "postActions": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecutionAction" + } + } + } + }, + "EnvironmentVariable": { + "type": "object", + "properties": { + "variable": { + "type": "string", + "description": "Variable name" + }, + "value": { + "type": "string", + "description": "Variable value" + }, + "isEnabled": { + "type": "boolean", + "description": "Whether variable is enabled. Default true" + } + }, + "required": [ + "variable", + "value" + ] + }, + "RemotePackage": { + "type": "object", + "description": "Swift package from URL. Version: from, exactVersion, branch, revision, etc.", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Package URL" + }, + "version": { + "type": "string", + "description": "Version constraint" + }, + "majorVersion": { + "type": "string", + "description": "Major version (e.g. 2.0.0)" + }, + "minorVersion": { + "type": "string", + "description": "Minor version (e.g. 1.2.1)" + }, + "exactVersion": { + "type": "string", + "description": "Exact version (e.g. 1.2.1)" + }, + "from": { + "type": "string", + "description": "Minimum version (e.g. 1.2.0)" + }, + "minVersion": { + "type": "string", + "description": "Minimum version for range" + }, + "maxVersion": { + "type": "string", + "description": "Maximum version for range" + }, + "branch": { + "type": "string", + "description": "Git branch (e.g. master)" + }, + "revision": { + "type": "string", + "description": "Git revision hash" + }, + "github": { + "type": "string", + "description": "Shortcut: org/repo instead of full URL" + }, + "traits": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Package traits to enable (enabledTraits). Requires XcodeGen 2.46.0+" + } + }, + "required": [ + "url" + ] + }, + "LocalPackage": { + "type": "object", + "description": "Swift package from local path. Directory must contain Package.swift", + "properties": { + "path": { + "type": "string", + "description": "Path to package directory" + }, + "group": { + "type": "string", + "description": "Group location in Xcode project. Empty string for project root" + }, + "excludeFromProject": { + "type": "boolean", + "description": "Exclude from generated project (e.g. when added via xcworkspace). Default false" + }, + "traits": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "NoUIFramework", + "V10", + "KSCrash" + ] + }, + "description": "Sentry SDK package traits to enable (enabledTraits). Requires XcodeGen 2.46.0+. NoUIFramework: build without UIKit/AppKit/SwiftUI linkage. V10: enable SDK V10 API changes. KSCrash: enable upstream KSCrash integration." + } + }, + "required": [ + "path" + ] + }, + "ProjectReference": { + "type": "object", + "description": "Reference to another xcodeproj. Reference targets via ProjectName/TargetName", + "properties": { + "path": { + "type": "string", + "description": "Path to the xcodeproj file" + } + }, + "required": [ + "path" + ] + }, + "Settings": { + "type": "object", + "properties": { + "configs": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "boolean" + }, + { + "type": "number" + } + ] + } + }, + "description": "Per-configuration build settings" + }, + "base": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "boolean" + }, + { + "type": "number" + } + ] + }, + "description": "Base build settings applied to all configurations" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "boolean" + }, + { + "type": "number" + } + ] + }, + "description": "Build settings that can include base settings and per-configuration settings" + } + } +}