Repository navigation
Add Xcode 27.0 project format, validate projectFormat and default xcodeVersion to 16.0 - #1658
Merged
Merged
Conversation
…deVersion to 16.0 - Add `xcode27_0` `ProjectFormat` (objectVersion 110, preferredProjectObjectVersion 110, no compatibilityVersion) - Move `ProjectFormat` into ProjectSpec (with a typealias in XcodeGenKit) so spec validation can report unknown `projectFormat` values - Default `xcodeVersion` to 16.0 and regenerate fixtures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three related changes to project format and version handling. Follows on from #1648, which added
xcode26_3.Add
xcode27_0project formatAdds
projectFormat: xcode27_0, which writesobjectVersion = 110andpreferredProjectObjectVersion = 110, with nocompatibilityVersion. This is the same shape asxcode16_0,xcode16_3andxcode26_3.How the values were checked against Xcode 27.0 (27A266a), without the GUI:
PBXProject.configureBuiltInProjectFormats()inDevToolsCore.frameworkregisters each format withinitWithArchiverVersion:identifier:explicitDisplayName:…. Disassembling it gives the archiver versions 42…56, 60, 63, 70–76 (the obsolete intermediate formats), 77, 90, 100 and 110. The last one, 110, is registered with display name"Xcode 27.0"and identifierXcodeProjectFormatIDv27_0, and it is not marked obsolete. A separate internal check (XCSchema.assignLatestFormat) also compares against 110 as the latest format.compatibilityVersion,preferredProjectObjectVersionwritten instead (verified):+[PBXProject archivableKeysToBeSkippedByPListArchiver:]skipscompatibilityVersionfor archive versions >= 72, and skipspreferredProjectObjectVersionbelow that.preferredProjectObjectVersionis the preferred format's archiver version, so a project in the Xcode 27.0 format has 110.xcodebuildaccepts 100 and 110 and rejects 101–109 and 111–200 with "written by a different version of Xcode". A project generated withprojectFormat: xcode27_0by this branch lists and builds with Xcode 27.0'sxcodebuild.tuist/XcodeProj(9.17.5) has no format constants for this, so nothing is needed there.The default
projectFormatstaysxcode16_0. Xcode 27's own+[PBXProject _defaultFormat]still returns the Xcode 16.0 format.Validate
projectFormatBefore this change, an unknown
options.projectFormat(for example a typo, orxcode27) silently fell back to the default format. It is now a spec validation error:To make this possible,
ProjectFormatmoves from XcodeGenKit to ProjectSpec, next toSpecValidation. ProjectSpec can't depend on XcodeGenKit. The enum is nowCaseIterable, so the error can list the valid values. XcodeGenKit keepspublic typealias ProjectFormat = ProjectSpec.ProjectFormat, so existing code that refers toProjectFormatthrough XcodeGenKit still compiles.Project.projectFormatstill falls back to the default for library users who generate without callingvalidate().Default
xcodeVersionto 16.0The default
options.xcodeVersionchanges from14.3to16.0, to match the defaultprojectFormat(xcode16_0). This changesLastUpgradeCheckin generated projects andLastUpgradeVersionin generated schemes from1430to1600. Setoptions.xcodeVersionto keep the old value. The docs now state the default.Fixture impact: the regenerated fixtures (
scripts/gen-fixtures.sh, plus thescheme_testfixture written bySchemeGeneratorTests) differ only on those lines. That's 5LastUpgradeCheck = 1430→1600and 18LastUpgradeVersion = "1430"→"1600".Tests
testXcode27_0ProjectFormatinPBXProjGeneratorTests, in the same style astestXcode26_3ProjectFormattestDefaultLastUpgradeCheckWhenUserDidNotSpecifyValuenow asserts1600explicitlyprojectFormat(including the message) and for every valid value🤖 Generated with Claude Code