How to apply (Each) Build rule to FolderRef?

How can I specify Build Rule apply policy on FolderReference using Tuist?

Xcode has two option for Folder Reference on How to apply Build Rule

  • (Apply to Each)

    • Apply Build Rule to each children
  • (Apply Once)

    • treat Folder as Single File and Apply Build Rule

I want to apply Each Rule to Folder Reference so that I can feed generated assets without regenerating or modifying project.

Help!

For more detail

This “New Folder” has Apply Once Build Rule (default)

This “Each” Folder has Apply Each Build Rule

Hi @pbk20191

Tuist doesn’t provide an API for configuring build rules. Could you share more about what your use case is and how you use build rules?

Apply Each Rule automatically reflect the file changes to the inputList for BuildRule.

In my case, our project has custom buildScript which checks remote server and download assets ( xcstrings, assets ).

Folder Reference with Each BuildRule automatically reflect this file changes to Copy Bundle Resources Phase.
while Once BuildRule treat Folder as Single File so that xcode Build Rule won’t applied to the children.

I’m not entirely familiar with Xcode’s capability, but we’d be up for supporting it. I’d recommend starting with a proposal in RFCs for how you expect the API to be, and we can take it from there.

Note that we don’t have the resources to invest in doing that development at the moment, so you or any other project contributor would need to take on the development. We can support with feedback and reviews, though.

1 Like