yonaskolb / yonaskolb/XcodeGen
type:folder resources use bare name instead of relative path when nested
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the project.yml reproduction and trace how a nested type: folder source becomes a PBXFileReference in the generated MyApp.xcodeproj/project.pbxproj. Compare the generated name and path with the expected Resources/Packs values, then verify that nested folders use the full relative path without requiring the sed workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100