Skip to content

Remove the top-level Sources and Resources groups from Xcode projects

This patch removes the top-level "Sources" and "Resources" groups from the generated Xcode project and places the target groups that were previously under "Sources" under the main group. This serves as a straightforward fix for #15272 (closed), but also has some other benefits:

  • Public headers, private headers, and resources now appear under their target's group in the Xcode project navigator rather than only in a flat list for all targets under the Resources group (another symptom of the same bug).
  • A level of nesting in the Xcode project navigator is removed.
  • The overall Xcode group structure is made closer to that of a project created from Xcode's current project templates.

I initially looked at adding an additional file reference as the xcodebuild warning in #15272 (closed) suggests, but then questioned what purpose a top-level Resources group across all targets is really serving. Resources are typically interacted with in the context of their associated target just like source files, and a flat list of resources is available per target by examining the target's Copy Bundle Resources build phase. Rather than adding new code to maintain the Resources group I opted to remove it, which also results in a simpler project group structure that is more consistent with an Xcode project template.

Merge request reports