Fix synced folder issues: configFiles duplicate, group insertion, and directory-level membershipExceptions#1607
Open
AlexNsbmr wants to merge 4 commits intoyonaskolb:masterfrom
Conversation
f5b01a8 to
7f1fefa
Compare
When configFiles reference paths inside a synced folder source, getContainedFileReference() created a separate PBXGroup hierarchy that duplicated the PBXFileSystemSynchronizedRootGroup already managing those files. Skip group creation in getContainedFileReference when the file path falls inside an existing synced folder root. Fixes the same class of issue as yonaskolb#1602, but for configFiles rather than target sources.
7f1fefa to
391bd18
Compare
…eptions - Prevent rootGroups insertion for paths inside synced folders, avoiding duplicate PBXGroup alongside PBXFileSystemSynchronizedRootGroup - Recurse into non-included directories in findExceptions to list individual file paths instead of directory names, since Xcode does not recursively exclude directory contents from membershipExceptions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…in exceptions Xcode does not recursively exclude directory contents from membershipExceptions, so the correct behavior is to list individual files rather than directory names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three related fixes for
defaultSourceDirectoryType: syncedFoldersupport.1. configFiles creating duplicate groups
When using
configFilesthat reference paths inside a synced folder source, a duplicatePBXGroupis created alongside thePBXFileSystemSynchronizedRootGroup.Root cause:
getContainedFileReference()always creates aPBXGrouphierarchy viagetGroup(), regardless of whether the file lives inside a synced folder. Same class of issue as #1602, but forconfigFiles.Fix: Return a file reference with
sourceTree: .sourceRootwhen the path is inside a synced folder, skipping group creation entirely.2. Root group duplication for paths inside synced folders
When multiple targets reference a synced folder path (e.g., extension targets with
type: syncedFolder),getGroup()inserts the group intorootGroups, causing a duplicate entry in the project navigator.Fix: Skip
rootGroupsinsertion when the path is inside an existing synced folder.3. Directory-level membershipExceptions not working
When using
includeson a synced folder source,findExceptionsadds directory names tomembershipExceptionsinstead of individual file paths. Xcode does not recursively exclude directory contents from membership exceptions, leading to:Supporting Files/directory in exceptions doesn't excludeSupporting Files/Info.plist)Fix: Recurse into non-included directories in
findExceptionsto list individual file paths instead of directory names.Tests
does not create duplicate group for configFiles inside synced folderincludescover the membershipExceptions behaviorEnvironment