A reusable set of XcodeGen target templates covering the common concerns of building apps for Apple platforms — macOS, iOS, tvOS, and beyond.
Every Apple target repeats the same boilerplate: platform settings, linting, build-number
stamping, code signing. Instead of copy-pasting that into every project.yml, this repo
captures each concern as a small, composable XcodeGen target template. A consuming target
then assembles itself by listing the features it needs:
targets:
MyApp:
type: application
platform: macOS
templates: [Base, CodeSignAuto, SwiftLint, BuildNumberAutoIncrement]
sources: [src]Each template lives in a *.yml at the repo root, is pulled in with include:, and is
referenced by name in a target's templates: [...].
| Template | File | Concern |
|---|---|---|
Base |
Base.yml |
Common, platform-scoped build settings (previews, dead-code stripping, script sandboxing) via a Common settingGroup with [sdk=…] conditions — works for single- and multi-platform targets. |
CodeSignAuto |
CodeSignAuto.yml |
Automatic (Xcode-managed) signing: CODE_SIGN_STYLE + DEVELOPMENT_TEAM. |
CodeSignDevID |
CodeSignDevID.yml |
Per-config identity: Apple Development (Debug) / Developer ID Application (Release), manual style. |
SwiftLint |
SwiftLint.yml |
Debug-only SwiftLint pre-build phase (via mise). |
BuildNumber |
BuildNumber.yml |
MARKETING_VERSION / CURRENT_PROJECT_VERSION from a committed Version.xcconfig (static — does not modify the file). |
BuildNumberAutoIncrement |
BuildNumber.yml |
Same as BuildNumber, plus a pre-build script that increments BUILD_NUMBER (+1) on each Debug build. Use instead of BuildNumber. |
This repo is consumed as a git submodule of your app / workspace, with mise (toolchain)
and direnv (per-project env) wiring paths via environment variables — no symlinks.
git submodule add git@github.com:BorisVanin/xcodegen-templates.git xcodegen-templatesFull setup (the .envrc, including templates, Version.xcconfig, generating) is in
docs/INSTALLATION.md. Converting an existing project.yml onto
the templates concern-by-concern is covered in CLAUDE.md (also read
automatically by Claude Code when this is a submodule).
Generate and build through the per-project Makefile (make debug / release / open /
clean), including the app+module and installer flows — see
docs/BUILDING.md.
Each example has a .envrc-example — copy it to .envrc, set your Team ID, direnv allow.
examples/app-macos— minimal SwiftUI macOS app using the templates.examples/complex—MyApplinks aMyModuleframework (separate project viaprojectReferences), sharing oneVersion.xcconfig, plus a Developer ID.pkginstaller underexamples/complex/installer/.
.
├── README.md
├── CLAUDE.md # usage + migration guide (for humans and Claude)
├── LICENSE # Apache-2.0
├── Base.yml / CodeSignAuto.yml / CodeSignDevID.yml / SwiftLint.yml / BuildNumber.yml
├── mise.toml # pinned xcodegen + swiftlint
├── docs/
│ ├── INSTALLATION.md # using the templates in your project
│ └── BUILDING.md # building with the Makefiles
└── examples/
├── app-macos/ # single-window SwiftUI macOS app, fully templated
└── complex/ # app + framework module (projectReference) + .pkg installer
macOS with Xcode, plus mise (brew install mise) and
direnv (brew install direnv). Details in
docs/INSTALLATION.md.