Skip to content
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

Fix build phases not being generated in the right positions #506

Merged
merged 8 commits into from Sep 20, 2019

Conversation

pepicrft
Copy link
Contributor

Fixes #505

Short description πŸ“

As @parse reported, the target actions were not generated in the right position. That happens because after calling the build phases generator, we call the link phases generator which might insert phases after the post actions.

Solution πŸ“¦

Move the calls to generate the target actions to the TargetGenerator.

Implementation πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

  • Fix the issue.
  • Add a unit tests.
  • Add an acceptance test.

@pepicrft pepicrft requested a review from a team September 19, 2019 13:20
@pepicrft pepicrft self-assigned this Sep 19, 2019
And I have a working directory
Then I copy the fixture ios_app_with_actions into the working directory
Then tuist generates the project
Then the target App should have the build phase Tuist in the first position
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parse am I right defining in this test what you expect in the generated project?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! With this test in place we'll make sure we don't introduce regressions in the future.

@tuistbot
Copy link
Contributor

tuistbot commented Sep 19, 2019

1 Warning
⚠️ Have you introduced any user-facing changes? If so, please take some time to update the documentation. Keeping the documentation up to date makes it easier for users to learn how to use Tuist.

SwiftLint found issues

Warnings

File Line Reason
TargetGenerator.swift 45 Function body should span 40 lines or less excluding comments and whitespace: currently spans 44 lines (function_body_length)

Generated by 🚫 Danger

@codecov
Copy link

codecov bot commented Sep 19, 2019

Codecov Report

Merging #506 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
+ Coverage   92.17%   92.18%   +0.01%     
==========================================
  Files         352      352              
  Lines       18450    18461      +11     
==========================================
+ Hits        17006    17018      +12     
+ Misses       1444     1443       -1
Impacted Files Coverage Ξ”
...atorTests/Generator/BuildPhaseGeneratorTests.swift 100% <ΓΈ> (ΓΈ) ⬆️
...TuistGenerator/Generator/BuildPhaseGenerator.swift 97.38% <100%> (-0.17%) ⬇️
...eneratorTests/Generator/TargetGeneratorTests.swift 98.78% <100%> (+0.38%) ⬆️
...ces/TuistGenerator/Generator/TargetGenerator.swift 100% <100%> (ΓΈ) ⬆️
Sources/TuistGenerator/Graph/Graph.swift 97.67% <0%> (+0.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update ebd8c9b...1bcd501. Read the comment docs.

Copy link
Collaborator

@marciniwanicki marciniwanicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

@pepicrft pepicrft merged commit 7246d71 into master Sep 20, 2019
@pepicrft pepicrft deleted the post-action-last branch September 20, 2019 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Making sure a .post action is executed last as BuildPhase
4 participants