As our project got bigger we want to precompile the assets catalog into the Assets.car to improve our compilation time using some kind of a .lock file.
We also need to use a standard UI for asset catalogs inside Xcode to add new assets.
This poses an issue when we have both Assets.car and Assets.xcassets when declaring our target as
Multiple commands produce the same output... since we now have duplicate Assets.car resources
Using ResourceFileElement.glob(pattern: "Resources/**", excluding: ["Resources/Assets.xcasset"]) will fix the compile error but will leave us without the asset catalog UI and it would be too hard to add new assets.
Expectation
A way to override the Copy bundle resources build phase. Basically keep the Assets.xcasset inside a project structure but omit it in the build phase. Then we can copy the Assets.car as a copyAction of the target.
Have you considered adding your Assets.xcassets as additionalFiles? That should keep them in the generated Xcode project without adding them to the Copy Bundle Resources build phase.
I have 3 Localizable files and want to keep SomeLanguage in the project file structure, but it is not yet production ready. So with XcodeGen i used to omit it from the buildPhase, now while migrating to Tuist I am having an issue that when using additionalFiles it is added both to the project but also the buildPhase including it in the final app.
Is there any other way to add files to the project navigator but keep it out of the buildPhase
@alessdiimperio Have you tried removing the resources glob? I wonder if it’s the excluding pattern that’s off. Worth testing out, although I understand you need to retain that glob. But maybe you can figure out what’s going out by shuffling the directories and globs a bit.
additionalFiles is still the only way you can achieve what you want. If you need more help, you’ll need to create a reproducible sample that we could take a look at. I can’t provide more guidance based on the context you provided.
en.lproj, sv.lproj and Base.lproj are all added to the target, however en.lproj should be excluded as it’s only added as an additionalFile and not as resource