Copy folder to target bundle with buildable folders

I have a following target file tree:

  • Sources
    • Resources
      • A
        • image.png
      • B
        • image.png
    • some swift files

Sources is buildable folder, Resources is a folder that I want to be copied entirely to target bundle. I can achieve this by manually selecting Build Rules = Apply Once to Folder in File Inspector and dragging Resources to Copy Bundle Resources phase.

I could not find the way to make this work with tuist. Can you support this?

Hey @maveric94!

We can look into supporting this use-case. Would you mind attaching a sample with the following:

  • The generated project that doesn’t quite get you there
  • The Xcode project with your tweaks

Then we can make sure we support this properly :folded_hands:

I believe this is more or less the same request I was making in Support treating arbitrary directories as files in Buildable Folder resolution. Based on Pedro’s response there, it sounds like the expected current way to achieve this is to pass the folder as FileElement.folderReference(path: "Resources”) to the resources: parameter of your target instead of the buildableFolders: parameter. I believe this requires moving the Resources directory so it’s a sibling of your buildable folder root rather than a child, but my memory isn’t 100% on that.

Thanks for reply! Here is generated project and here is generated project with tweaks

Yeah, I guess that’s valid workaround. Thanks! Its just having to move folders is not ideal