yonaskolb / yonaskolb/XcodeGen

`INFOPLIST_FILE` will set to wrong file if no Info.plist exist in `SRCROOT`

Open
#1,098 0 comments 2 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

According to the project spec, INFOPLIST_FILE will set to the first one found in the SRCROOT if the file does not exist:

INFOPLIST_FILE: If it doesn't exist your sources will be searched for Info.plist files and the first one found will be used for this setting

However, if I generate a Info.plist file in script and set INFOPLIST_FILE in a xcconfig file, this behavior will overwrite my setting and set this value to another file in the folder. Like:

// Debug.xcconfig content
INFOPLIST_FILE = Configurations/ExportSettings/Info.plist

# project.yml content
app:
  platform: iOS
  type: application
  configFiles:
    Debug: Configurations/Debug.xcconfig

// there is another plist file in `SRCROOT/resource.bundle`
// then the project will set `INFOPLIST_FILE` to `SRCROOT/resource.bundle/Info.plist`

I suggest this setting should comply to xcconfig first if it is not set. The searching behavior is weird.

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

Reproduce the case using project.yml with Configurations/Debug.xcconfig, an explicitly set INFOPLIST_FILE, and another Info.plist under resource.bundle. Trace how the generated project resolves this setting; done means the xcconfig value remains effective when present, while fallback searching is used only when it is unset.

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
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.