-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
script_phase
s don't preserve order after pod install
#7065
Comments
thank you! I am marking this as an "enhancement" since that was as initially planned. We need to basically preserve the offset relative to all other custom user script phases instead of the whole list. This is the part of the code that does this: If interested to improve it and make a PR would be great. Tests should be easy to write too. |
Considering actually removing entirely the reshuffling and re-ordering of script phases... I don't think we can ever get it 100% right for all use cases. |
That would be a workable solution actually, as the |
@djbe I have a bit of an update and bigger aspirations for this. It will fix your case but also provide some additional restrictions. I will close my PR and re-open it when it's complete. |
Sorry, didn't have the time yet to check the new PR. If it understand the code correctly, this would be the originally intended behaviour, right? Maintain the order for old phases, append at the end (using the order from the Podfile) otherwise. |
It will no longer re-adjust script phases based on the order in the Podfile. It will only do it if you specify that you want it |
Oh I didn't notice the related CocoaPods/Core#414 PR. Cool! 👍 |
Refs CocoaPods/Core#389 (comment).
Report
What did you do?
script_phase
s to my Podfilepod install
pod install
againWhat did you expect to happen?
I expected my custom script phases to maintain their order. For example, If I move a script phase to before the "Compile sources" build step, I expect it to stay there on the next
pod install
.What happened instead?
All my custom script phases were moved back to the end again (after all other phases). This makes the
script_phase
DSL only useful for scripts that should run after everything is built.CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
Test.zip
Comment
Not all custom script phases are meant to run after everything is built. If I look at most of my projects, most of them actually run before the "compile sources" build step (for example: SwiftGen, SwiftLint, Mogenerator, etc...)
The text was updated successfully, but these errors were encountered: