Skip to content

Match Xcode's comments for groups and the project configuration list - #3379

Open
erneestoc wants to merge 1 commit into
MobileNativeFoundation:mainfrom
erneestoc:ec/xcode-object-comments
Open

erneestoc wants to merge 1 commit into
MobileNativeFoundation:mainfrom
erneestoc:ec/xcode-object-comments

Conversation

@erneestoc

Copy link
Copy Markdown
Contributor

Split out of #3374, per review.

Xcode rewrites project.pbxproj when its serialization differs from ours, and that includes object comments:

  • A group's comment uses its name, falling back to its path.
  • The project's configuration list comment includes the project name (Build configuration list for PBXProject "Foo"). The name is passed to pbxproj_prefix with a new --project-name flag, derived from the .xcodeproj basename.

The project name only reaches the pbxproj_prefix action, whose inputs already include the absolute workspace directory, so this doesn't affect caching.

Xcode rewrites `project.pbxproj` when it saves a project whose file
differs from how it would serialize it, and that includes object
comments. Match it in two places:

- A group's comment uses its `name`, falling back to its `path`.
- The project's configuration list comment includes the project name
  (`Build configuration list for PBXProject "Foo"`).

Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
@erneestoc
erneestoc requested a review from a team as a code owner October 9, 2026 21:23
brentleyjones pushed a commit that referenced this pull request Oct 13, 2026
For files with extensions Xcode doesn't know (e.g. `.graphql`,
`LICENSE`), Xcode sniffs the contents and writes `lastKnownFileType =
text` for text files. We wrote `file`, so Xcode rewrote
`project.pbxproj` the next time it saved the project. Unknown files in
source trees are overwhelmingly text, so we now write `text`.

The group comment, project name and `TargetAttributes` ordering changes
that were here are now in #3379 and #3380.

Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant