Skip to content

Commit 2b10be3

Browse files
Raymondriterclaude
andauthored
Add xcode26_3 project format (objectVersion 100) (#1648)
* Add xcode26_3 project format (objectVersion 100) Adds a `xcode26_3` case to `ProjectFormat`, selectable via the `projectFormat` spec option, which generates projects in the Xcode 26.3 format: `objectVersion = 100` and `preferredProjectObjectVersion = 100`, with no `compatibilityVersion` (matching the existing Xcode 16.x formats). The default format is unchanged. Resolves #1620 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Add PR number to CHANGELOG entry Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent ebbe9ab commit 2b10be3

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66
- Added `buildArchitectures` to scheme build options and target schemes, to control Xcode's "Override Architectures" scheme setting #1642 @arhxam
77
- Added FAQ documentation on how to add an Xcode capability, such as In-App Purchase #1644 @Hokila
8+
- Added `xcode26_3` `projectFormat` option for the Xcode 26.3 project format (`objectVersion = 100`) #1648 @Raymondriter
89

910
### Changed
1011
- Generated schemes now default to `buildArchitectures: matchRunDestination` ("Match Run Destination"), matching Xcode's default for new schemes. Previously schemes used each target's architecture settings. Set `buildArchitectures: useTargetSettings` to keep the previous behaviour #1642 @yonaskolb

‎Docs/ProjectSpec.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Note that target names can also be changed by adding a `name` property to a targ
134134
- [ ] **tabWidth**: **Int** - If this is specified, the Xcode project will override the user's setting for indent width in number of spaces.
135135
- [ ] **xcodeVersion**: **String** - The version of Xcode. This defaults to the latest version periodically. You can specify it in the format `0910` or `9.1`
136136
- [ ] **projectFormat**: **String** - The version of Xcode project. By default this is set to `xcode16_0`
137+
- `xcode26_3`: Xcode 26.3
137138
- `xcode16_3`: Xcode 16.3
138139
- `xcode16_0`: Xcode 16.0
139140
- `xcode15_3`: Xcode 15.3

‎Sources/XcodeGenKit/ProjectFormat.swift‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ public extension ProjectFormat {
33
}
44

55
public enum ProjectFormat: String {
6+
case xcode26_3
67
case xcode16_3
78
case xcode16_0
89
case xcode15_3
@@ -11,6 +12,7 @@ public enum ProjectFormat: String {
1112

1213
public var objectVersion: UInt {
1314
switch self {
15+
case .xcode26_3: 100
1416
case .xcode16_3: 90
1517
case .xcode16_0: 77
1618
case .xcode15_3: 63
@@ -21,14 +23,14 @@ public enum ProjectFormat: String {
2123

2224
public var preferredProjectObjectVersion: UInt? {
2325
switch self {
24-
case .xcode16_3, .xcode16_0: objectVersion
26+
case .xcode26_3, .xcode16_3, .xcode16_0: objectVersion
2527
case .xcode15_3, .xcode15_0, .xcode14_0: nil
2628
}
2729
}
2830

2931
public var compatibilityVersion: String? {
3032
switch self {
31-
case .xcode16_3, .xcode16_0: nil
33+
case .xcode26_3, .xcode16_3, .xcode16_0: nil
3234
case .xcode15_3: "Xcode 15.3"
3335
case .xcode15_0: "Xcode 15.0"
3436
case .xcode14_0: "Xcode 14.0"

‎Tests/XcodeGenKitTests/PBXProjGeneratorTests.swift‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,30 @@ class PBXProjGeneratorTests: XCTestCase {
507507
}
508508
}
509509

510+
func testDefaultProjectFormat() throws {
511+
let project = Project(name: "Test")
512+
513+
let pbxProj = try PBXProjGenerator(project: project).generate()
514+
let pbxProject = try XCTUnwrap(pbxProj.rootObject)
515+
516+
XCTAssertEqual(project.projectFormat, .xcode16_0)
517+
XCTAssertEqual(pbxProj.objectVersion, 77)
518+
XCTAssertEqual(pbxProject.preferredProjectObjectVersion, 77)
519+
XCTAssertNil(pbxProject.compatibilityVersion)
520+
}
521+
522+
func testXcode26_3ProjectFormat() throws {
523+
let project = Project(name: "Test", options: SpecOptions(projectFormat: "xcode26_3"))
524+
525+
let pbxProj = try PBXProjGenerator(project: project).generate()
526+
let pbxProject = try XCTUnwrap(pbxProj.rootObject)
527+
528+
XCTAssertEqual(project.projectFormat, .xcode26_3)
529+
XCTAssertEqual(pbxProj.objectVersion, 100)
530+
XCTAssertEqual(pbxProject.preferredProjectObjectVersion, 100)
531+
XCTAssertNil(pbxProject.compatibilityVersion)
532+
}
533+
510534
func testProductsGroupIsSet() throws {
511535
let target = Target(name: "TestApp", type: .application, platform: .iOS)
512536
let project = Project(name: "Test", targets: [target])

0 commit comments

Comments
 (0)