XcodeProj icon indicating copy to clipboard operation
XcodeProj copied to clipboard

Handle references for exception sets in Synchronized Groups

Open mirkokg opened this issue 5 months ago • 0 comments

Generate permanent references for PBXFileSystemSynchronizedExceptionSet objects, including build file and build phase exception sets. Updates tests to verify that references for exception sets are correctly converted to permanent values.

Resolves https://github.com/tuist/XcodeProj/issues/934

Short description 📝

When creating projects with PBXFileSystemSynchronizedRootGroup objects that contain exception sets (PBXFileSystemSynchronizedBuildFileExceptionSet or PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet), the exception set IDs were being written with TEMP_ prefixes instead of proper deterministic IDs.

Solution 📦

Extended the ReferenceGenerator to process exception sets when generating references for synchronized root groups. Added a new generateExceptionSetReferences method that:

  1. Iterates through all exceptions in a PBXFileSystemSynchronizedRootGroup
  2. Generates deterministic IDs based on the exception type:
  • For PBXFileSystemSynchronizedBuildFileExceptionSet: uses the target reference as part of the identifier
  • For PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: uses the build phase reference as part of the identifier

This follows the same pattern used for other object types in the reference generator.

Implementation 👩‍💻👨‍💻

  • [x] Identified that PBXFileSystemSynchronizedRootGroup.exceptions were not being processed in ReferenceGenerator
  • [x] Modified generateSynchronizedRootGroupReferences() to iterate through exception sets after fixing the root group reference
  • [x] Added generateExceptionSetReferences() method to handle reference generation for exception set objects
  • [x] Added unit tests to verify the functionality
  • [x] Verified all tests pass with the changes
  • [x] Confirmed no TEMP_ prefixes appear in generated project files

mirkokg avatar Nov 21 '25 00:11 mirkokg