Support for buildable folders in Tuist 4.62.0

Hello :wave:,

You might know that Xcode 16 introduced a new concept in Xcode projects aimed at mitigating frequent merge conflicts: buildable folders. Although merge conflicts don’t happen that regularly in Tuist, thanks to wildcard references between your target definitions and the file system, there are a couple of scenarios where they play a key role:

  • Preventing inconsistencies between your manifest definition and the generated Xcode project. For example, if a developer adds a file to the project that’s not captured by the wildcard, the error will likely surface the next time they generate the project or push their changes upstream.
  • Preventing agents from having to regenerate the Xcode project on every file operation, which adds time to the feedback loop of agents.

To address this, we’ve added support for buildable folders in generated projects:

let target = Target(
  // sources: ["Sources/**/*.swift"],
  // resources: ["Resources/**"],
  buildableFolders: [
    "Sources/",
    "Resources/"
  ]
)

Buildable folders (internally referred to in Xcode as syncable groups) support additional features that we don’t yet support. In XcodeProj’s terminology, you can add “exceptions” to syncable groups—for example, to exclude a particular file or to add compiler flags to a specific file.

If you haven’t tried them yet, we recommend giving them a shot. We’ve started using them ourselves.

2 Likes

So excited for this!

I just tried it, but I found that when I use buildableFolders for my module, instead of sources and resources, I don’t get a Bundle.module generated for the module.

1 Like

Interesting. How does it behave if you do the e same thing with a vanilla Xcode project? I’d try to find the delta and I can then apply the fix to Tuist.

Thanks a lot for the work on this :pray: I noticed that after applying the buildable folder change, the option to disable automatic workspace scheme generation seems to be ignored. This doesn’t look like the expected behavior — could you confirm if this might be a bug?

1 Like

No, this is not expected. Would you mind raising an issue with reproducible steps? :pray:

I created a bug to track this: Bundle.module not generated when using buildableFolders with a resource · Issue #8126 · tuist/tuist · GitHub . A vanilla Xcode project wouldn’t generate a Bundle.module, that’s only provided by SPM. For a vanilla Xcode project you’d use Bundle.main or Bundle(for: SomeClass.self).