Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added
- Added `buildArchitectures` to scheme build options and target schemes, to control Xcode's "Override Architectures" scheme setting #1642 @arhxam
- Added FAQ documentation on how to add an Xcode capability, such as In-App Purchase #1644 @Hokila
- Added `xcode26_3` `projectFormat` option for the Xcode 26.3 project format (`objectVersion = 100`) #1648 @Raymondriter

### Changed
- 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
Expand Down
1 change: 1 addition & 0 deletions Docs/ProjectSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Note that target names can also be changed by adding a `name` property to a targ
- [ ] **tabWidth**: **Int** - If this is specified, the Xcode project will override the user's setting for indent width in number of spaces.
- [ ] **xcodeVersion**: **String** - The version of Xcode. This defaults to the latest version periodically. You can specify it in the format `0910` or `9.1`
- [ ] **projectFormat**: **String** - The version of Xcode project. By default this is set to `xcode16_0`
- `xcode26_3`: Xcode 26.3
- `xcode16_3`: Xcode 16.3
- `xcode16_0`: Xcode 16.0
- `xcode15_3`: Xcode 15.3
Expand Down
6 changes: 4 additions & 2 deletions Sources/XcodeGenKit/ProjectFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ public extension ProjectFormat {
}

public enum ProjectFormat: String {
case xcode26_3
case xcode16_3
case xcode16_0
case xcode15_3
Expand All @@ -11,6 +12,7 @@ public enum ProjectFormat: String {

public var objectVersion: UInt {
switch self {
case .xcode26_3: 100
case .xcode16_3: 90
case .xcode16_0: 77
case .xcode15_3: 63
Expand All @@ -21,14 +23,14 @@ public enum ProjectFormat: String {

public var preferredProjectObjectVersion: UInt? {
switch self {
case .xcode16_3, .xcode16_0: objectVersion
case .xcode26_3, .xcode16_3, .xcode16_0: objectVersion
case .xcode15_3, .xcode15_0, .xcode14_0: nil
}
}

public var compatibilityVersion: String? {
switch self {
case .xcode16_3, .xcode16_0: nil
case .xcode26_3, .xcode16_3, .xcode16_0: nil
case .xcode15_3: "Xcode 15.3"
case .xcode15_0: "Xcode 15.0"
case .xcode14_0: "Xcode 14.0"
Expand Down
24 changes: 24 additions & 0 deletions Tests/XcodeGenKitTests/PBXProjGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,30 @@ class PBXProjGeneratorTests: XCTestCase {
}
}

func testDefaultProjectFormat() throws {
let project = Project(name: "Test")

let pbxProj = try PBXProjGenerator(project: project).generate()
let pbxProject = try XCTUnwrap(pbxProj.rootObject)

XCTAssertEqual(project.projectFormat, .xcode16_0)
XCTAssertEqual(pbxProj.objectVersion, 77)
XCTAssertEqual(pbxProject.preferredProjectObjectVersion, 77)
XCTAssertNil(pbxProject.compatibilityVersion)
}

func testXcode26_3ProjectFormat() throws {
let project = Project(name: "Test", options: SpecOptions(projectFormat: "xcode26_3"))

let pbxProj = try PBXProjGenerator(project: project).generate()
let pbxProject = try XCTUnwrap(pbxProj.rootObject)

XCTAssertEqual(project.projectFormat, .xcode26_3)
XCTAssertEqual(pbxProj.objectVersion, 100)
XCTAssertEqual(pbxProject.preferredProjectObjectVersion, 100)
XCTAssertNil(pbxProject.compatibilityVersion)
}

func testProductsGroupIsSet() throws {
let target = Target(name: "TestApp", type: .application, platform: .iOS)
let project = Project(name: "Test", targets: [target])
Expand Down
Loading