yonaskolb / yonaskolb/XcodeGen

Cannot use optional: true with missing file wrapper resources

Open
#893 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

For resources that either need to get placed in PBXVariantGroups, or are otherwise represented as a directory, explicitly listing all the files in the directory and specifying optional: true does not give the resources proper handling.

For example, for a target with the following in its sources

{ "path": "../Frameworks/ST/Resources/Base.lproj/MQPSView.xib", "group": "Frameworks/ST/Resources/Base.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/PS.xcdatamodeld/PS.xcdatamodel", "group": "Frameworks/ST/Resources/PS.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/PS.xcdatamodeld/PS.xcdatamodel/contents", "group": "Frameworks/ST/Resources/PS.xcdatamodeld/PS.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/PY.xcdatamodeld/.xccurrentversion", "group": "Frameworks/ST/Resources/PY.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/PY.xcdatamodeld/PY.xcdatamodel", "group": "Frameworks/ST/Resources/PY.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/PY.xcdatamodeld/PY.xcdatamodel/contents", "group": "Frameworks/ST/Resources/PY.xcdatamodeld/PY.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/.xccurrentversion", "group": "Frameworks/ST/Resources/SP.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/SP 2.xcdatamodel", "group": "Frameworks/ST/Resources/SP.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/SP 2.xcdatamodel/contents", "group": "Frameworks/ST/Resources/SP.xcdatamodeld/SP 2.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/SP 3.xcdatamodel", "group": "Frameworks/ST/Resources/SP.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/SP 3.xcdatamodel/contents", "group": "Frameworks/ST/Resources/SP.xcdatamodeld/SP 3.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/SP.xcdatamodel", "group": "Frameworks/ST/Resources/SP.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/SP.xcdatamodeld/SP.xcdatamodel/contents", "group": "Frameworks/ST/Resources/SP.xcdatamodeld/SP.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/TL.xcdatamodeld/TL.xcdatamodel", "group": "Frameworks/ST/Resources/TL.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/TL.xcdatamodeld/TL.xcdatamodel/contents", "group": "Frameworks/ST/Resources/TL.xcdatamodeld/TL.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/T.xcdatamodeld/.xccurrentversion", "group": "Frameworks/ST/Resources/T.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/T.xcdatamodeld/T.xcdatamodel", "group": "Frameworks/ST/Resources/T.xcdatamodeld", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/T.xcdatamodeld/T.xcdatamodel/contents", "group": "Frameworks/ST/Resources/T.xcdatamodeld/T.xcdatamodel", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-AU.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/en-AU.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-AU.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/en-AU.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-CA.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/en-CA.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-CA.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/en-CA.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-GB.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/en-GB.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-GB.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/en-GB.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-IN.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/en-IN.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en-IN.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/en-IN.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/en.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/en.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/en.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/es-MX.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/es-MX.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/es-MX.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/es-MX.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/es.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/es.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/es.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/es.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/fr-CA.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/fr-CA.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/fr-CA.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/fr-CA.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/fr.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/fr.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/fr.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/fr.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/ja.lproj/Localizable.strings", "group": "Frameworks/ST/Resources/ja.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/ja.lproj/MQPSView.strings", "group": "Frameworks/ST/Resources/ja.lproj", "buildPhase": "none", "optional": true },
{ "path": "../Frameworks/ST/Resources/local.cert", "group": "Frameworks/ST/Resources", "buildPhase": "none", "optional": true },

the lprojs do not lead to a variant group, the datamodeld directories do not yield a XCVersionGroup, and (if there were any), asset catalogs would not be a bare file reference, but instead the contents.json would be added as a file reference.

This makes generating the project without access to the source files impossible

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

No source file or test entry point is named; begin by tracing XcodeGen's resource handling for the listed optional entries during project generation. Done means generation without source files still produces variant groups, XCVersionGroup entries, and correct asset-catalog references for directory-like resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.