Synced folders
This adds support for Xcode 16's synchronized folders, which depending where you look have a few different names:
- synchronized root groups
- synchronized folders
- folder references
- buildable folders
For our purposes I've chosen the name syncedFolder, looking for feedback on this.
This initial push supports the following:
- [x] a new
syncedFoldersource type - [x] a new
defaultSourceDirectoryTypeproject spec option of the same type that can be used to override the default directory type ofgroup
At the moment only top level synced folders are supported. Xcode also includes a PBXFileSystemSynchronizedBuildFileExceptionSet which has not been added yet here either.
There is a load of complexity that has been added to XcodeGen over the years to sources around relative paths, custom parent groups, includes and excludes, mixed target phases, and various other options. In this first pass anything beyond the basics is unsupported for these special folders.
Please test this in your own projects and give feedback about what is broken and how this should be expanded
thank you so much! i will give this a try this week, hopefully😅, and come back with feedback :)
for the very basic use case, which is just "make all of my project's groups -> buildable folders" it works as expected, whether by specifying syncedFolder for defaultSourceDirectoryType, or on the source's path type.
i just tried this on a very small project i have and it worked without any issues whatsoever.
i am yet to try to mix and match with other types and see how it goes... but so far, it gets the job done ❤️🚀
This is looking pretty cool! Thank you! 🚀
You said "At the moment only top level synced folders are supported.", that's why I can't (yet) specify a group as a parent of a syncedFolder, right?
Thank you for the PR ❤️ Is the PR scheduled to be merged before the next release? Is there anything I can help with? I tested it, and it seems to be working great! 🚀
Would love an ETA on this merge :D
This makes it convenient because files created via external editors or AI agents can be immediately recognized and read by Xcode.
I've fixed the cache from checking all children within synced folders, which should add one of the big benefits of this feature, which is cache not getting invalidated when files are added or removed within a synced folder.
On a project I tested this with I'm getting a duplicate Info.plist error (surprised no one else has mentioned it), which I've attempted to fix here, but it needs an upstream fix https://github.com/yonaskolb/XcodeGen/pull/1560
Looks like xcassets folders are no longer included in the build targets, thus breaking pretty badly
Edit: And maybe it's less obvious, but when ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS is enabled (or "generate-swift-asset-symbol-extensions" : "enabled" in the xcasset's Contents.json), the asset "folder" needs to be compiled to generate the resources