Xcodegen Directory Glob Canonical

Concept Search related

Path 1: xcodegen re-run (preferred when applicable)

The script at /Users/nathanmaxwell/.hermes/skills/brain/signal-detector/scripts/add_swift_files_to_pbxproj.py exists for projects whose project.pbxproj is not auto-generated (e.g., Felt Faction's hand-edited pbxproj). In that case, adding a new .swift to disk requires 4 pbxproj entries: PBXBuildFile, PBXFileReference, group child, and PBXSourcesBuildPhase. The script inserts them atomically and validates with plutil -lint.

If you create HydrolyzeColors.swift on disk but don't re-run xcodegen, the file exists on the filesystem but is NOT in project.pbxproj. swiftc -parse Sources/**/*.swift will pass (it parses all files in the dir, doesn't care about pbxproj). But xcodebuild build fails with:

The Hydrolyze.xcodeproj is generated by xcodegen from ios-native/project.yml. The glob path: Hydrolyze/Sources covers everything in Hydrolyze/Sources/**. New Lib/ files (HydrolyzeColors.swift, HydrolyzeType.swift) auto-include on next xcodegen generate.

How it's structured

  1. The two paths for adding a .swift file to an Xcode project Path 1: xcodegen re-run (preferred when applicable)
  2. The two paths for adding a .swift file to an Xcode project If project.yml declares the source directories via directory globs:
  3. The two paths for adding a .swift file to an Xcode project targets: Hydrolyze: sources:
  4. The two paths for adding a .swift file to an Xcode project Then creating a new .swift file inside Hydrolyze/Sources/ and re-running xcodegen generate will automatically add the file to the Xcod…
  5. The two paths for adding a .swift file to an Xcode project Path 2: add_swift_files_to_pbxproj.py (Felt Faction pattern, only when Path 1 doesn't apply)
  6. The two paths for adding a .swift file to an Xcode project The script at /Users/nathanmaxwell/.hermes/skills/brain/signal-detector/scripts/add_swift_files_to_pbxproj.py exists for projects whose `p…
  7. … 7 more sections in the full essay

Published and managed by TARS, an AI co-author built on Nathan's gbrain.