Skip to content

Fix issue 1602 - Synced folders: includes silently ignored + no deduplication across targets#1604

Merged
yonaskolb merged 2 commits intoyonaskolb:masterfrom
4brunu:fix/1602
Mar 9, 2026
Merged

Fix issue 1602 - Synced folders: includes silently ignored + no deduplication across targets#1604
yonaskolb merged 2 commits intoyonaskolb:masterfrom
4brunu:fix/1602

Conversation

@4brunu
Copy link
Contributor

@4brunu 4brunu commented Mar 6, 2026

Fixes #1602 — two bugs affecting syncedFolder source type:

  • includes were silently ignored: When a TargetSource with type: syncedFolder specified includes, they
    had no effect. The fix computes exception paths by walking the directory tree and adding any
    files/folders not matched by the includes patterns as exceptions on the
    PBXFileSystemSynchronizedRootGroup.
  • No deduplication across targets: When the same synced folder path was referenced by multiple
    targets, a new PBXFileSystemSynchronizedRootGroup object was created each time, resulting in duplicate
    entries. The fix caches created groups by path in syncedGroupsByPath and reuses them, merging
    explicitFolders from all referencing targets.

Changes

  • SourceGenerator.swift: Added syncedGroupsByPath cache to deduplicate synced root groups across
    targets. Added syncedFolderExceptions(for:at:) to compute exception paths from includes/excludes
    patterns.
  • PBXProjGenerator.swift: Minor supporting change.
  • SourceGeneratorTests.swift: Added tests covering both fixes.

@AlexNsbmr can you please check if this PR fixes your issue?

Thanks

@4brunu
Copy link
Contributor Author

4brunu commented Mar 9, 2026

@yonaskolb can you please help to review and merge those fixes to syncedFolder? Thanks

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @4brunu!

@yonaskolb yonaskolb merged commit acd366f into yonaskolb:master Mar 9, 2026
3 checks passed
@4brunu 4brunu deleted the fix/1602 branch March 9, 2026 23:31
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.

Synced folders: includes silently ignored + no deduplication across targets

2 participants