Skip to content

Commit 22af58d

Browse files
committed
Align Tuist setup with remote branch best practices
- Use Tuist 4.x API (Tuist struct) instead of deprecated Config() - Add defaultSettings: .none to let xcconfigs drive all build settings - Add Tuist/Package.swift for Tuist 4.x external dependency support - Add explicit headers configuration for project headers - Use .pre(path:) script API with explicit input/output paths - Rename .mise.toml to mise.toml, update to tuist 4.156.0 - Add Tuist/.build/ and *.xcframework to .gitignore - Add "Xcode (via Tuist)" section to README.md - Update Example/Tuist.swift to Tuist 4.x API
1 parent e244b76 commit 22af58d

8 files changed

Lines changed: 88 additions & 55 deletions

File tree

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ Checkouts/*
1414
build/
1515
.ag_repo/
1616
.oag_repo/
17-
## Tuist generated files
17+
.claude
18+
19+
# Tuist
20+
Derived/
21+
Tuist/.build/
1822
*.xcodeproj
1923
*.xcworkspace
20-
Derived/
21-
.claude
24+
*.xcframework

.mise.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

Example/Tuist.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import ProjectDescription
22

3-
let config = Config()
3+
let tuist = Tuist(
4+
project: .tuist()
5+
)

Project.swift

Lines changed: 37 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,67 @@
11
import ProjectDescription
22

3-
// MARK: - Process Headers Script
3+
// MARK: - Constants
44

5-
let processHeadersScript: TargetScript = .pre(
6-
script: """
7-
Scripts/Xcode/process_headers.sh
8-
""",
9-
name: "Process Headers",
10-
inputFileListPaths: [
11-
"Scripts/Xcode/process_headers_inputs.xcfilelist",
12-
],
13-
outputFileListPaths: [
14-
"Scripts/Xcode/process_headers_outputs.xcfilelist",
15-
]
16-
)
5+
let destinations: Destinations = [.iPhone, .iPad, .mac, .appleVision]
176

187
// MARK: - Project
198

209
let project = Project(
2110
name: "OpenAttributeGraph",
2211
settings: .settings(
23-
base: [
24-
"GCC_TREAT_WARNINGS_AS_ERRORS": "NO",
25-
],
2612
configurations: [
27-
.debug(name: .debug, xcconfig: "Configs/Common.xcconfig"),
28-
.release(name: .release, xcconfig: "Configs/Common.xcconfig"),
29-
]
13+
.debug(name: "Debug", xcconfig: "Configs/Common.xcconfig"),
14+
.release(name: "Release", xcconfig: "Configs/Common.xcconfig"),
15+
],
16+
defaultSettings: .none
3017
),
3118
targets: [
3219
.target(
3320
name: "OpenAttributeGraph",
34-
destinations: [.iPhone, .iPad, .mac, .appleVision],
21+
destinations: destinations,
3522
product: .framework,
3623
bundleId: "org.OpenSwiftUIProject.OpenAttributeGraph",
37-
deploymentTargets: .multiplatform(
38-
iOS: "18.0",
39-
macOS: "15.0",
40-
visionOS: "2.0"
24+
sources: [
25+
"Sources/Platform/**",
26+
"Sources/Utilities/**",
27+
"Sources/OpenAttributeGraphCxx/**",
28+
"Sources/OpenAttributeGraph/**",
29+
],
30+
headers: .headers(
31+
project: [
32+
"Sources/OpenAttributeGraphCxx/include/**",
33+
"Sources/Platform/include/**",
34+
"Sources/Utilities/include/**",
35+
]
4136
),
42-
sources: .sourceFilesList(globs: [
43-
.glob(
44-
"Sources/Platform/**",
45-
excluding: ["Sources/Platform/README.md"]
46-
),
47-
.glob(
48-
"Sources/Utilities/**",
49-
excluding: [
50-
"Sources/Utilities/README.md",
51-
"Sources/Utilities/include/SwiftBridging/README.md",
52-
]
53-
),
54-
.glob(
55-
"Sources/OpenAttributeGraphCxx/**",
56-
excluding: [
57-
"Sources/OpenAttributeGraphCxx/include/OpenAttributeGraphCxx/Vector/vector.tpp",
58-
"Sources/OpenAttributeGraphCxx/include/SwiftBridging/README.md",
37+
scripts: [
38+
.pre(
39+
path: "Scripts/Xcode/process_headers.sh",
40+
name: "Process Headers",
41+
inputPaths: [
42+
"$(SRCROOT)/Scripts/Xcode/process_headers.sh",
43+
],
44+
inputFileListPaths: [
45+
"Scripts/Xcode/process_headers_inputs.xcfilelist",
46+
],
47+
outputPaths: [],
48+
outputFileListPaths: [
49+
"Scripts/Xcode/process_headers_outputs.xcfilelist",
5950
]
6051
),
61-
"Sources/OpenAttributeGraph/**",
62-
]),
63-
scripts: [processHeadersScript],
52+
],
6453
dependencies: [
6554
.sdk(name: "z", type: .library),
6655
],
6756
settings: .settings(
6857
base: [
69-
"GCC_TREAT_WARNINGS_AS_ERRORS": "NO",
7058
"DEFINES_MODULE": "NO",
7159
],
7260
configurations: [
73-
.debug(name: .debug, xcconfig: "Configs/OpenAttributeGraph.xcconfig"),
74-
.release(name: .release, xcconfig: "Configs/OpenAttributeGraph.xcconfig"),
75-
]
61+
.debug(name: "Debug", xcconfig: "Configs/OpenAttributeGraph.xcconfig"),
62+
.release(name: "Release", xcconfig: "Configs/OpenAttributeGraph.xcconfig"),
63+
],
64+
defaultSettings: .none
7665
)
7766
),
7867
]

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,28 @@ The project requires Swift toolchain headers for compilation. They are included
7070
git submodule update --init
7171
```
7272

73+
### Xcode (via Tuist)
74+
75+
This project uses [Tuist](https://tuist.dev) to generate the Xcode project for framework builds.
76+
77+
1. Install Tuist (if not already installed):
78+
```shell
79+
# via mise
80+
mise install tuist
81+
# or via Homebrew
82+
brew install tuist
83+
```
84+
85+
2. Generate the Xcode project:
86+
```shell
87+
tuist generate
88+
```
89+
90+
3. Build using the generated workspace:
91+
```shell
92+
xcodebuild build -workspace OpenAttributeGraph.xcworkspace -scheme OpenAttributeGraph -destination 'generic/platform=iOS Simulator'
93+
```
94+
7395
## License
7496

7597
See LICENSE file - MIT

Tuist.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import ProjectDescription
22

3-
let config = Config()
3+
let tuist = Tuist(
4+
project: .tuist()
5+
)

Tuist/Package.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// swift-tools-version: 6.1
2+
import PackageDescription
3+
4+
#if TUIST
5+
import ProjectDescription
6+
7+
let packageSettings = PackageSettings(
8+
productTypes: [:]
9+
)
10+
#endif
11+
12+
let package = Package(
13+
name: "OpenAttributeGraphDeps",
14+
dependencies: []
15+
)

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
tuist = "4.156.0"

0 commit comments

Comments
 (0)