As you might know, we added support for buildable folders not too long ago, but some of you couldn’t migrate because it lacked certain features or had bugs in other areas like the resource interfaces we generate based on target sources and resources.
I’m happy to share that we’ve tackled a couple of key needs:
Hello, was reading through the docs related to “excluded” an it’s an absolute path excluded: An array of absolute paths to files that should be excluded from the buildable folder.
Why not ignore like extension “*.json" or “*.plist” or “*.xcassets”
The excluded items are relative paths to the buildable folder’s directory, and it’s not a glob because we mimicked Xcode projects’ API which doesn’t support globs. We could add support for it such that we resolve the glob at generation time, but I’d rather stay close to Xcode and avoid globing, which translates to an increased generation time. Do you have a lot of files to exclude?
I have lot of .json files in the Test target and .xcassets folders in normal target. The way i was expecting was similar to Xcode, when you have buildable folder in xcode and if you add any file in the folder (from finder) and Xcode works fine. I was expecting the same for tuist as well. Not matter the files present it in folder it should have added it. But I understand that it might not be possible that’s why i was thinking if I could ignore these files in buildable folder then I can add them in resources using glob
The implementation maps 1-to-1 Xcode’s behavior. A buildable folder is:
A path to a directory in your system
A set of exceptions for excluding files or overriding attributes (e.g. a header access level)
Xcode’s UI might make it convenient to define exceptions for a group of files (e.g. an entire folder), and we could bring that convenience to the generation process, but this makes buildable folders dependent on re-generation, defeating the value of buildable folders in the first place because this is something that’s already solved by Target.sources, & Target.resources. So my advise is:
If you want to use globs, use Target.sources and Target.resources
Otherwise, use Target.buildableFolders and list the exclusions. If your list is long, you can move your files around in the file-system to group them in folders and exclude the whole folder.