Unofficial JSON Schema for Xcode 27.2 .xcproj JSON project format

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Xcode project (.xcproj)",
"description": "Unofficial, reverse-engineered schema for the Xcode 27.2 JSON project format (project.xcproj). Files are JSONC: comments and trailing commas are allowed. Xcode silently ignores unknown keys; this schema rejects them.",
"type": "object",
"additionalProperties": false,
"required": ["default-configuration", "configurations", "localizations"],
"properties": {
"organization": { "type": "string" },
"class-prefix": { "type": "string" },
"build-independent-targets-in-parallel": { "type": "boolean", "default": true },
"default-configuration": { "type": "string" },
"configurations": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/configuration" } },
"localizations": {
"type": "object",
"additionalProperties": false,
"required": ["development"],
"properties": {
"development": { "type": "string" },
"supported": { "$ref": "#/$defs/stringSet" }
}
},
"packages": { "type": "array", "items": { "$ref": "#/$defs/package" } },
"imported-products": { "type": "array", "items": { "$ref": "#/$defs/importedProduct" } },
"files": { "type": "array", "items": { "$ref": "#/$defs/reference" } },
"targets": { "type": "array", "items": { "$ref": "#/$defs/target" } },
"build-settings": { "$ref": "#/$defs/buildSettings" },
"products-group": { "$ref": "#/$defs/namePath", "description": "Group containing products. Omitted when it is \"Products\"." },
"required-capabilities": { "$ref": "#/$defs/stringSet" },
"last-upgrade": { "$ref": "#/$defs/marketingVersion" },
"last-swift-update": { "$ref": "#/$defs/marketingVersion" },
"last-swift-migration": { "$ref": "#/$defs/marketingVersion" },
"root-group-debug-id": { "$ref": "#/$defs/objectID" },
"configuration-list-debug-id": { "$ref": "#/$defs/objectID" }
},
"$defs": {
"objectID": { "type": "string", "pattern": "^[0-9A-Fa-f]{24}$" },
"marketingVersion": { "type": "string", "pattern": "^\\d+\\.\\d+(\\.\\d+)?$", "examples": ["27.0"] },
"stringSet": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
"stringList": { "type": "array", "items": { "type": "string" } },
"namePath": { "type": "string", "description": "Slash-separated path of names in the group tree, e.g. \"Products/App.app\"." },
"targetName": { "type": "string", "minLength": 1 },
"platforms": { "$ref": "#/$defs/stringSet", "description": "Platform filters, e.g. ios, macos, maccatalyst, tvos, watchos, xros, driverkit." },
"filePath": {
"type": "string",
"description": "Group-relative path, absolute path (\"/…\"), or path with a base: , , , .",
"pattern": "^(<(PRODUCTS|SDK|DEVELOPER|PROJECT)>(/.*)?|[^<].*)$"
},
"buildSettings": {
"type": "object",
"description": "Build settings. Conditions via suffix, e.g. \"SWIFT_OPTIMIZATION_LEVEL[config=Debug]\" or \"OTHER_LDFLAGS[sdk=iphoneos*]\".",
"propertyNames": { "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\[[A-Za-z_]+=[^\\]]*\\])*$" },
"additionalProperties": {
"oneOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
}
},
"configuration": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": { "type": "string" },
"file": { "type": "string", "description": "xcconfig reference in the group tree." },
"id": { "$ref": "#/$defs/objectID" }
}
}
]
},
"package": {
"type": "object",
"required": ["kind"],
"properties": { "kind": { "enum": ["local", "remote"] } },
"if": { "properties": { "kind": { "const": "local" } } },
"then": {
"additionalProperties": false,
"required": ["path"],
"properties": {
"kind": true,
"path": { "type": "string" },
"traits": { "$ref": "#/$defs/stringList" }
}
},
"else": {
"additionalProperties": false,
"required": ["repository"],
"properties": {
"kind": true,
"repository": { "type": "string", "format": "uri" },
"version": { "$ref": "#/$defs/versionConstraint" },
"traits": { "$ref": "#/$defs/stringList" }
}
}
},
"versionConstraint": {
"type": "object",
"oneOf": [
{ "additionalProperties": false, "required": ["version"], "properties": { "version": { "type": "string" } } },
{ "additionalProperties": false, "required": ["branch"], "properties": { "branch": { "type": "string" } } },
{ "additionalProperties": false, "required": ["revision"], "properties": { "revision": { "type": "string" } } },
{ "additionalProperties": false, "required": ["up-to-next-minor-version"], "properties": { "up-to-next-minor-version": { "type": "string" } } },
{ "additionalProperties": false, "required": ["up-to-next-major-version"], "properties": { "up-to-next-major-version": { "type": "string" } } },
{ "additionalProperties": false, "required": ["version-range"], "properties": { "version-range": { "type": "string", "pattern": "^\\S+\\.\\.<\\S+$" } } },
{
"additionalProperties": false,
"required": ["version-range-min", "version-range-max"],
"properties": { "version-range-min": { "type": "string" }, "version-range-max": { "type": "string" } }
}
]
},
"importedProduct": {
"type": "object",
"additionalProperties": false,
"required": ["project", "target", "product-id"],
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"project": { "type": "string" },
"target": { "type": "string" },
"product-id": { "$ref": "#/$defs/objectID" },
"type": { "type": "string" },
"target-membership": { "$ref": "#/$defs/buildFileMembership" }
}
},
"buildFileAttributes": {
"is-weak": { "type": "boolean" },
"code-sign-on-copy": { "type": "boolean" },
"decompress": { "type": "boolean" },
"header-preservation": { "enum": ["keep", "remove-on-copy"] },
"header-role": { "enum": ["public", "private"] },
"code-generation": { "enum": ["default", "skip"] },
"code-generation-visibility": { "enum": ["public", "private", "project"] },
"mach-interface-generation": { "enum": ["client", "server", "both"] }
},
"buildFileAttributesObject": {
"type": "object",
"additionalProperties": false,
"properties": {
"is-weak": { "$ref": "#/$defs/buildFileAttributes/is-weak" },
"code-sign-on-copy": { "$ref": "#/$defs/buildFileAttributes/code-sign-on-copy" },
"decompress": { "$ref": "#/$defs/buildFileAttributes/decompress" },
"header-preservation": { "$ref": "#/$defs/buildFileAttributes/header-preservation" },
"header-role": { "$ref": "#/$defs/buildFileAttributes/header-role" },
"code-generation": { "$ref": "#/$defs/buildFileAttributes/code-generation" },
"code-generation-visibility": { "$ref": "#/$defs/buildFileAttributes/code-generation-visibility" },
"mach-interface-generation": { "$ref": "#/$defs/buildFileAttributes/mach-interface-generation" }
}
},
"buildFile": {
"oneOf": [
{
"type": "string",
"description": "\"Target/phase\", \"Target/copy/\" or \"Target/script/\".",
"pattern": "^[^/]+/.+$"
},
{
"type": "object",
"additionalProperties": false,
"required": ["build-phase"],
"properties": {
"build-phase": { "type": "string", "pattern": "^[^/]+/.+$" },
"id": { "$ref": "#/$defs/objectID" },
"arguments": { "type": "string", "description": "Additional compiler flags." },
"platforms": { "$ref": "#/$defs/platforms" },
"asset-tags": { "$ref": "#/$defs/stringSet" },
"is-weak": { "$ref": "#/$defs/buildFileAttributes/is-weak" },
"code-sign-on-copy": { "$ref": "#/$defs/buildFileAttributes/code-sign-on-copy" },
"decompress": { "$ref": "#/$defs/buildFileAttributes/decompress" },
"header-preservation": { "$ref": "#/$defs/buildFileAttributes/header-preservation" },
"header-role": { "$ref": "#/$defs/buildFileAttributes/header-role" },
"code-generation": { "$ref": "#/$defs/buildFileAttributes/code-generation" },
"code-generation-visibility": { "$ref": "#/$defs/buildFileAttributes/code-generation-visibility" },
"mach-interface-generation": { "$ref": "#/$defs/buildFileAttributes/mach-interface-generation" }
}
}
]
},
"buildFileMembership": { "type": "array", "items": { "$ref": "#/$defs/buildFile" } },
"commonReference": {
"kind": { "enum": ["file-reference", "group", "folder", "variant-group", "version-group"] },
"id": { "$ref": "#/$defs/objectID" },
"index": { "type": "boolean", "description": "includeInIndex" },
"name": { "type": "string", "description": "Only when it differs from the last path component." }
},
"reference": {
"type": "object",
"if": { "required": ["kind"], "properties": { "kind": { "const": "group" } } },
"then": { "$ref": "#/$defs/group" },
"else": {
"if": { "required": ["kind"], "properties": { "kind": { "const": "folder" } } },
"then": { "$ref": "#/$defs/folder" },
"else": {
"if": { "required": ["kind"], "properties": { "kind": { "const": "variant-group" } } },
"then": { "$ref": "#/$defs/variantGroup" },
"else": {
"if": { "required": ["kind"], "properties": { "kind": { "const": "version-group" } } },
"then": { "$ref": "#/$defs/versionGroup" },
"else": { "$ref": "#/$defs/fileReference" }
}
}
}
},
"fileReference": {
"type": "object",
"additionalProperties": false,
"required": ["path"],
"properties": {
"kind": { "const": "file-reference" },
"id": { "$ref": "#/$defs/commonReference/id" },
"index": { "$ref": "#/$defs/commonReference/index" },
"name": { "$ref": "#/$defs/commonReference/name" },
"path": { "$ref": "#/$defs/filePath" },
"type": { "type": "string", "description": "Explicit file type, e.g. wrapper.application." },
"expected-signature": { "type": "string" },
"encoding": {
"enum": [
"ascii", "nextstep", "japanese-euc", "utf8", "iso-latin-1", "symbol", "non-lossy-ascii", "shift-jis",
"iso-latin-2", "unicode", "windows-code-page-1250", "windows-code-page-1251", "windows-code-page-1252",
"windows-code-page-1253", "windows-code-page-1254", "iso-2022-jp", "macos-roman", "utf16",
"utf16-big-endian", "utf16-little-endian", "utf32", "utf32-big-endian", "utf32-little-endian"
]
},
"line-ending": { "enum": ["line-feed", "carriage-return", "carriage-return-line-feed", "preserve"] },
"target-membership": { "$ref": "#/$defs/buildFileMembership" }
}
},
"group": {
"type": "object",
"additionalProperties": false,
"required": ["kind"],
"anyOf": [{ "required": ["path"] }, { "required": ["name"] }],
"properties": {
"kind": { "const": "group" },
"id": { "$ref": "#/$defs/commonReference/id" },
"index": { "$ref": "#/$defs/commonReference/index" },
"name": { "type": "string" },
"path": { "$ref": "#/$defs/filePath" },
"children": { "type": "array", "items": { "$ref": "#/$defs/reference" } }
}
},
"variantGroup": {
"type": "object",
"additionalProperties": false,
"required": ["kind"],
"properties": {
"kind": { "const": "variant-group" },
"id": { "$ref": "#/$defs/commonReference/id" },
"index": { "$ref": "#/$defs/commonReference/index" },
"name": { "type": "string" },
"path": { "$ref": "#/$defs/filePath" },
"target-membership": { "$ref": "#/$defs/buildFileMembership" },
"children": { "type": "array", "items": { "$ref": "#/$defs/fileReference" } }
}
},
"versionGroup": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "path"],
"properties": {
"kind": { "const": "version-group" },
"id": { "$ref": "#/$defs/commonReference/id" },
"index": { "$ref": "#/$defs/commonReference/index" },
"name": { "type": "string" },
"path": { "$ref": "#/$defs/filePath" },
"current-version": { "type": "string" },
"type": { "type": "string", "description": "Versioned file type, e.g. wrapper.xcdatamodel." },
"target-membership": { "$ref": "#/$defs/buildFileMembership" },
"children": { "type": "array", "items": { "$ref": "#/$defs/fileReference" } }
}
},
"folder": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "path"],
"properties": {
"kind": { "const": "folder" },
"id": { "$ref": "#/$defs/commonReference/id" },
"index": { "$ref": "#/$defs/commonReference/index" },
"name": { "type": "string" },
"path": { "$ref": "#/$defs/filePath" },
"target-membership": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/targetName" } },
"file-types": { "type": "object", "additionalProperties": { "type": "string" } },
"opaque-folders": { "$ref": "#/$defs/stringSet" },
"membership-exceptions": { "type": "array", "items": { "$ref": "#/$defs/folderExceptionSet" } }
}
},
"folderExceptionSet": {
"type": "object",
"additionalProperties": false,
"oneOf": [{ "required": ["target"] }, { "required": ["build-phase"] }],
"not": { "required": ["exclusions", "inclusions"] },
"dependentSchemas": {
"build-phase": { "properties": { "public-headers": false, "private-headers": false, "compiler-flags": false } }
},
"properties": {
"target": { "$ref": "#/$defs/targetName" },
"build-phase": { "type": "string", "pattern": "^[^/]+/.+$" },
"exclusions": { "$ref": "#/$defs/stringSet" },
"inclusions": { "$ref": "#/$defs/stringSet" },
"public-headers": { "$ref": "#/$defs/stringSet" },
"private-headers": { "$ref": "#/$defs/stringSet" },
"compiler-flags": { "type": "object", "additionalProperties": { "type": "string" } },
"platforms": { "type": "object", "additionalProperties": { "$ref": "#/$defs/platforms" } },
"attributes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/buildFileAttributesObject" } },
"asset-tags": { "type": "object", "additionalProperties": { "$ref": "#/$defs/stringSet" } }
}
},
"target": {
"type": "object",
"additionalProperties": false,
"required": ["name", "id"],
"not": { "required": ["product-type", "full-product-type"] },
"if": { "required": ["kind"], "properties": { "kind": { "const": "external-build-system" } } },
"then": { "required": ["build-tool-path"] },
"else": {
"properties": {
"build-tool-path": false,
"build-tool-arguments": false,
"build-tool-working-directory": false,
"pass-build-settings-in-environment": false
}
},
"properties": {
"name": { "$ref": "#/$defs/targetName" },
"id": { "$ref": "#/$defs/objectID" },
"kind": { "enum": ["native", "aggregate", "external-build-system"], "default": "native" },
"product": { "$ref": "#/$defs/namePath" },
"product-type": {
"type": "string",
"description": "Product type without the com.apple.product-type. prefix.",
"examples": [
"application", "tool", "framework", "library.static", "library.dynamic", "bundle",
"bundle.unit-test", "bundle.ui-testing", "app-extension", "extensionkit-extension",
"application.watchapp2", "application.on-demand-install-capable", "xcframework"
]
},
"full-product-type": { "type": "string", "description": "Product type identifier outside com.apple.product-type.*" },
"test-host-target": { "$ref": "#/$defs/targetName" },
"legacy-provisioning-style": { "enum": ["automatic", "manual"] },
"legacy-team-id": { "type": "string" },
"last-swift-update": { "$ref": "#/$defs/marketingVersion" },
"last-swift-migration": { "$ref": "#/$defs/marketingVersion" },
"configuration-list-debug-id": { "$ref": "#/$defs/objectID" },
"dependencies": { "type": "array", "items": { "$ref": "#/$defs/dependency" } },
"build-phases": { "type": "array", "items": { "$ref": "#/$defs/buildPhase" } },
"build-rules": { "type": "array", "items": { "$ref": "#/$defs/buildRule" } },
"specialized-configurations": { "type": "array", "items": { "$ref": "#/$defs/configuration" } },
"package-product-members": { "type": "array", "items": { "$ref": "#/$defs/packageProductMember" } },
"build-settings": { "$ref": "#/$defs/buildSettings" },
"build-tool-path": { "type": "string" },
"build-tool-arguments": { "type": "string" },
"build-tool-working-directory": { "type": "string" },
"pass-build-settings-in-environment": { "type": "boolean", "default": true }
}
},
"dependency": {
"oneOf": [
{ "$ref": "#/$defs/targetName", "description": "Local target by name." },
{
"type": "object",
"additionalProperties": false,
"required": ["target"],
"properties": {
"kind": { "const": "localTarget" },
"target": { "$ref": "#/$defs/targetName" },
"platforms": { "$ref": "#/$defs/platforms" }
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["kind", "project", "target", "target-id"],
"properties": {
"kind": { "const": "remoteTarget" },
"project": { "type": "string" },
"target": { "type": "string" },
"target-id": { "$ref": "#/$defs/objectID" },
"platforms": { "$ref": "#/$defs/platforms" }
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["kind", "product-name"],
"properties": {
"kind": { "const": "package" },
"package": { "type": "string" },
"product-name": { "type": "string" },
"product-type": { "$ref": "#/$defs/packageProductType" },
"id": { "$ref": "#/$defs/objectID" },
"platforms": { "$ref": "#/$defs/platforms" }
}
}
]
},
"packageProductType": { "enum": ["other", "build-tool-plugin"], "default": "other" },
"packageProductMember": {
"type": "object",
"additionalProperties": false,
"required": ["product-name", "build-phase"],
"properties": {
"package": { "type": "string", "description": "Package name; omitted for local packages." },
"product-name": { "type": "string" },
"product-type": { "$ref": "#/$defs/packageProductType" },
"id": { "$ref": "#/$defs/objectID" },
"build-phase": {
"type": "object",
"additionalProperties": false,
"required": ["build-phase"],
"properties": {
"build-phase": { "type": "string" },
"id": { "$ref": "#/$defs/objectID" },
"arguments": { "type": "string" },
"platforms": { "$ref": "#/$defs/platforms" },
"asset-tags": { "$ref": "#/$defs/stringSet" },
"is-weak": { "$ref": "#/$defs/buildFileAttributes/is-weak" },
"code-sign-on-copy": { "$ref": "#/$defs/buildFileAttributes/code-sign-on-copy" },
"decompress": { "$ref": "#/$defs/buildFileAttributes/decompress" },
"header-preservation": { "$ref": "#/$defs/buildFileAttributes/header-preservation" },
"header-role": { "$ref": "#/$defs/buildFileAttributes/header-role" },
"code-generation": { "$ref": "#/$defs/buildFileAttributes/code-generation" },
"code-generation-visibility": { "$ref": "#/$defs/buildFileAttributes/code-generation-visibility" },
"mach-interface-generation": { "$ref": "#/$defs/buildFileAttributes/mach-interface-generation" }
}
}
}
},
"simplePhaseKind": { "enum": ["compile-sources", "frameworks", "resources", "headers", "rez", "java-archive"] },
"buildPhase": {
"oneOf": [
{ "$ref": "#/$defs/simplePhaseKind" },
{
"type": "object",
"additionalProperties": false,
"required": ["kind"],
"properties": {
"kind": { "$ref": "#/$defs/simplePhaseKind" },
"name": { "type": "string" },
"id": { "$ref": "#/$defs/objectID" }
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["kind", "name"],
"properties": {
"kind": { "const": "copy" },
"name": { "type": "string" },
"id": { "$ref": "#/$defs/objectID" },
"bundle-base-path": {
"enum": [
"root", "build-products-directory", "contents-directory", "executables-directory",
"resources-directory", "frameworks-directory", "shared-frameworks-directory",
"shared-support-directory", "plugins-directory", "headers-directory",
"private-headers-directory", "java-directory", "apple-scripts-directory",
"info-plist-file", "package-info-file", "main-executable-file", "shallow-main-executable-file"
],
"description": "Omitted = absolute path in relative-path."
},
"relative-path": { "type": "string" },
"scope": { "$ref": "#/$defs/phaseScope" }
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["kind", "name"],
"properties": {
"kind": { "const": "script" },
"name": { "type": "string" },
"id": { "$ref": "#/$defs/objectID" },
"shell": { "type": "string" },
"script": { "type": "string" },
"input-paths": { "$ref": "#/$defs/stringList" },
"input-file-list-paths": { "$ref": "#/$defs/stringList" },
"output-paths": { "$ref": "#/$defs/stringList" },
"output-file-list-paths": { "$ref": "#/$defs/stringList" },
"dependency-file": { "type": "string" },
"run-on-every-build": { "type": "boolean" },
"log-environment-variables": { "type": "boolean" },
"scope": { "$ref": "#/$defs/phaseScope" }
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["kind", "name"],
"properties": {
"kind": { "const": "apple-script" },
"name": { "type": "string" },
"id": { "$ref": "#/$defs/objectID" },
"context-name": { "type": "string" },
"is-shared-context": { "type": "boolean" }
}
}
]
},
"phaseScope": { "enum": ["always", "install"], "default": "always", "description": "install = run only when installing." },
"buildRule": {
"type": "object",
"additionalProperties": false,
"required": ["processor"],
"properties": {
"name": { "type": "string" },
"id": { "$ref": "#/$defs/objectID" },
"processor": { "type": "string", "examples": ["com.apple.compilers.proxy.script"] },
"file-type": { "type": "string" },
"file-patterns": { "type": "string" },
"script": { "type": "string" },
"input-files": { "$ref": "#/$defs/stringList" },
"input-file-lists": { "$ref": "#/$defs/stringList" },
"output-files": { "$ref": "#/$defs/stringList" },
"output-file-lists": { "$ref": "#/$defs/stringList" },
"output-files-compiler-flags": { "$ref": "#/$defs/stringList" },
"dependency-file": { "type": "string" },
"run-once-per-architecture": { "type": "boolean", "default": true }
}
}
}
}
添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论