020. Generate the Xcode project with XcodeGen
Status
Accepted 2026-09-15
Context
The Apple shell (ADR 010) needs an Xcode project, and a project.pbxproj is a graph of objects addressed by generated UUIDs, rewritten by the IDE on every change. Its diff is unreadable, and a conflict in it is resolved by taking one side and redoing the other by hand.
The shell also carries more configurations than an app its size usually does: the three environments of ADR 012, each crossed with debug and release, differing in the origin the shell loads. Kept in Xcode's settings editor, that is easy to get subtly wrong and impossible to review.
Decision
We describe the Apple project in apps/apple/project.yml and generate Campfire.xcodeproj from it with XcodeGen, through pnpm generate:apple.
- The YAML is the source, and the generated project is committed, so a clone opens and builds in Xcode without XcodeGen.
- Sources are declared as directories, not file lists.
- What varies per environment lives in xcconfig files.
Shared.xcconfigholds what all share – the bundle identifier, the app name, the signing team – andLocal,Dev, andProdeach hold the line that differs. - Info.plists are generated too, from properties beside their target.
- The spec declares a minimum XcodeGen version, so an older tool refuses rather than generating a different project.
Consequences
- XcodeGen is a prerequisite
pnpm installdoes not provide and ADR 005 does not age, needed only by whoever changes the project. - A change made in Xcode's UI is silently lost on the next generate, so the project is edited in
project.yml. - The build is reviewable – every configuration, scheme, and test target on one screen of commented YAML.
Alternatives considered
- A hand-maintained
.xcodeproj– an unreviewable diff and conflicts resolved by guessing. - Tuist – more tool than one app target and its tests need.