Order Embed Pods Frameworks build phase to avoid cycles #5989
Unanswered
VorkhlikArtem
asked this question in
Troubleshooting & how to
Replies: 1 comment
-
Thanks a lot @VorkhlikArtem for sharing your workaround for this. I'll give it some thought to see if we can come up with a solution provided by Tuist. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Developers using Cocoapods and tuist together can encounter some inconsistencies and errors in their mutual dependencies management. They both add a build phase embedding frameworks in bundles of apps and xctests of unit-tests in DerivedData.
Embed Frameworks
[CP] Embed Pods Frameworks
to the bottomAnd Pods script is below the tuist's one in unit-tests build phases after
pod install
command. This can lead to an error inside the test target because tuist's embedding phase depends on the Pods one but Pods script goes after.There is already a troubleshooting around this error like #2817
And This is my concise and elegant solution over it.
Solution
Just add this empty pre-script in unit-test Target's scripts in your manifest Project.swift:
.pre(script: " ", name: "[CP] Embed Pods Frameworks")
After
tuist generate
this script will be above the tuist's phase. And afterpod install
this script will be filled with a script itself and input/output file lists. Moreover afterpod install
this script won't change its position and cocoapods won't create an duplicate script below.It's because cocoapods instead of just adding its script to the bottom that leads to duplication, traverses the array of phases names until it meets the name "[CP] Embed Pods Frameworks". And it fills this script with appropriate content.
The space in the script is just so tuist doesn't complain about the empty script content.
Example:
Result
After
tuist generate -n && pod install
you will get the order of build phases that does not cause any cycle errors:Beta Was this translation helpful? Give feedback.
All reactions