Add flag "weak" for file path #6177
Ernest0-Production
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
Sometimes there are scenarios when you need to add a reference to a file in
.pbxproj
before it appears in the project. For example, when there is aRun Script
in the Build Phase of the target that generates the content of this file. Usually such files are added to.gitignore
A more practical example: SwiftGen, Apollo GraphQL
We do not use the resource generation offered by Tuist, as it is more convenient for us to generate files with each project compilation using SwiftGen directly.
Problem
When cloning the project on CI workspace or the first cloning of the project by a new team member, an error occurs: _SomeStrings+Generated.swift not found._
The current workaround is to write a separate bash script that creates dummy files before
tuist generate
so that Tuist can link them in .pbxproj
.The disadvantage of this solution is that we don't have the ability to get a project graph to automatically find targets with a script in BuildPhase that uses SwiftGen tool – consequently, we have to manually hardcode paths for all such targets.
Proposal
Since
.pbxproj
allows adding references to non-existent file paths, I suggest unlocking the ability to specify such weak paths.But so as not to violate the current logic of Tuist (checking for the presence of files at the specified path), a new parameter
weak
needs to be added:Lint Rules:
Beta Was this translation helpful? Give feedback.
All reactions