Skip to content

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

@Asher-

Description

@Asher-

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions