yonaskolb / yonaskolb/XcodeGen

[BUG] Optional source path doesn't work if executing xcodegen from outer directory

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

Nobody has claimed this yet.

bug help wanted
Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

Given a project config:

name: OptionalSourcePath

targets:
  OptionalSourcePath:
    type: application
    platform: iOS
    deploymentTarget: "16.0"
    sources:
      - path: "First"
      - path: "Second"
        optional: true

and a directory structure of:

❯ tree dir
dir
├── First
├── Second
└── project.yml

3 directories, 1 file

calling xcodegen from within dir:

cd dir
xcodegen -s project.yml

generates a correct Xcode project.

However, calling xcodegen from outside of dir:

❯ basename $PWD
Downloads
❯ ls dir
First  project.yml  Second
❯ xcodegen -s dir/project.yml

Generates an Xcode project where the "Second" dir is missing from file tree:
missing

❯ xcodegen --version
Version: 2.39.1

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 by reproducing the behavior with xcodegen -s dir/project.yml, then compare it with running xcodegen from inside dir using the provided project.yml. Trace how the optional Second source path is resolved relative to the specification and working directory. Done means both invocations include Second in the generated Xcode project.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.