Skip to content

Fix pbxproj output differences (keys not sorted, extra properties)#46

Merged
EvanBacon merged 2 commits intomainfrom
@evanbacon/issue-30
Mar 2, 2026
Merged

Fix pbxproj output differences (keys not sorted, extra properties)#46
EvanBacon merged 2 commits intomainfrom
@evanbacon/issue-30

Conversation

@EvanBacon
Copy link
Owner

Summary

Fixes #30 - Addresses differences in pbxproj output when reading and rewriting project files.

  • Keys now sorted alphabetically: Properties within objects are sorted with isa first, then case-sensitive ASCII alphabetical order (matching Xcode's behavior)
  • Removed automatic fileEncoding and includeInIndex defaults: These properties are no longer added to PBXFileReference objects unless they existed in the original file
  • Removed empty array initialization in shell script phases: inputPaths, outputPaths, inputFileListPaths, outputFileListPaths are no longer initialized to empty arrays (Xcode omits these when empty)

Test plan

  • JSON round-trip tests pass (26/26)
  • Verified key sorting produces correct alphabetical order
  • Verified no extra properties added when loading existing projects
  • Test with RNTester project as described in issue

🤖 Generated with Claude Code

EvanBacon and others added 2 commits March 2, 2026 09:56
Stop auto-populating PBXFileReference defaults (fileEncoding, includeInIndex) and avoid initializing empty input/output path arrays in PBX build phases so the library doesn't add properties Xcode omits when round-tripping projects. Add deterministic JSON writer ordering (case-sensitive ASCII with "isa" first) for stable output. Update tests to reflect the removed defaults and to skip fixtures that rely on original non-sorted key order.
Re-process project.pbxproj and project-with-entitlements.pbxproj
through the parser/writer to normalize key ordering, then restore
them in inOutFixtures array.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@EvanBacon EvanBacon merged commit a2ca454 into main Mar 2, 2026
1 check passed
@EvanBacon EvanBacon deleted the @evanbacon/issue-30 branch March 2, 2026 18:58
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.

[RNTester] Different project.pbproj output for RNTester.

1 participant