yonaskolb / yonaskolb/XcodeGen

type:folder resources use bare name instead of relative path when nested

Open
#1,615 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.