Description
When a source entry uses type: folder with a nested path (containing a /), the generated PBXFileReference uses only the last path component as both name and path, instead of using the full relative path.
Reproduction
project.yml:
targets:
MyApp:
sources:
- path: Resources/Packs
type: folder
buildPhase: resources
Expected
The generated PBXFileReference should have the full relative path:
name = Packs; path = Resources/Packs; sourceTree = SOURCE_ROOT;
Actual
The generated PBXFileReference has only the bare name:
name = Packs; path = Packs; sourceTree = SOURCE_ROOT;
This causes Xcode to fail to locate the folder at build time because Packs doesn't exist at the project root — it's at Resources/Packs.
Workaround
Post-generate sed patch to fix the path:
sed -i '' 's|path = Packs; sourceTree = SOURCE_ROOT|path = Resources/Packs; sourceTree = SOURCE_ROOT|g' MyApp.xcodeproj/project.pbxproj
Environment
- XcodeGen version: latest (installed via Homebrew)
- Xcode 16.3
- macOS 26.0
Description
When a source entry uses
type: folderwith a nested path (containing a/), the generatedPBXFileReferenceuses only the last path component as bothnameandpath, instead of using the full relative path.Reproduction
project.yml:Expected
The generated
PBXFileReferenceshould have the full relative path:Actual
The generated
PBXFileReferencehas only the bare name:This causes Xcode to fail to locate the folder at build time because
Packsdoesn't exist at the project root — it's atResources/Packs.Workaround
Post-generate sed patch to fix the path:
Environment