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

Adding ability to re-generate individual projects #457

Merged
merged 4 commits into from Jul 24, 2019

Conversation

kwridan
Copy link
Collaborator

@kwridan kwridan commented Jul 23, 2019

Resolves #452

Short description πŸ“

To support workflows where only the local project needs to be re-generated without re-generating all its dependencies a new generation option is needed (see #452 for full rationale)

Solution πŸ“¦

Add a new option to generate the local project only.

usage:

tuist generate --project-only

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

  • Expose new generator method that generates a single project
  • Expose new option via command line argument --project-only
  • Update documentation
  • Update changelog

Test Plan πŸ› 

  • Run tuist generate within fixtures/ios_app_with_custom_workspace
  • Verify the workspace is still generated with all the dependencies as before
  • Run tuist generate within fixtures/ios_app_with_custom_workspace/App
  • Verify the project workspace is still generated with all the dependencies as before
  • Run tuist generate --project-only within fixtures/ios_app_with_custom_workspace/App
  • Verify only the App's project re-generated (this can be done by either doing a git clean before running the command and then verifying that the only Xcode project is for App or by manually modifying any of the projects and verifying they don't update)

…tor`

- This is useful when iterating on a single project that is part of an existing workspace
- It prevents accidentally re-generating dependencies that may have been modified (either manually or via Xcode's automated re-formats e.g. tuist#425)
@kwridan
Copy link
Collaborator Author

kwridan commented Jul 23, 2019

Happy to change to --only-project as suggested in the issue discussions, wanted to throw one more out there: --project-only let me know your thoughts

@tuistbot
Copy link
Contributor

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.

Generated by 🚫 Danger

@codecov
Copy link

codecov bot commented Jul 23, 2019

Codecov Report

Merging #457 into master will increase coverage by 0.03%.
The diff coverage is 98.82%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #457      +/-   ##
=========================================
+ Coverage   92.07%   92.1%   +0.03%     
=========================================
  Files         319     319              
  Lines       16487   16552      +65     
=========================================
+ Hits        15180   15246      +66     
+ Misses       1307    1306       -1
Impacted Files Coverage Ξ”
.../TuistKitTests/Generator/Mocks/MockGenerator.swift 100% <100%> (ΓΈ) ⬆️
...sts/TuistKitTests/Commands/FocusCommandTests.swift 100% <100%> (ΓΈ) ⬆️
Sources/TuistKit/Commands/GenerateCommand.swift 58.62% <100%> (+5.67%) ⬆️
Sources/TuistGenerator/Generator/Generator.swift 100% <100%> (ΓΈ) ⬆️
Sources/TuistKit/Commands/FocusCommand.swift 37.83% <100%> (+3.55%) ⬆️
...orTests/Generator/Mocks/MockProjectGenerator.swift 100% <100%> (+100%) ⬆️
Sources/TuistKit/Generator/Generator.swift 100% <100%> (ΓΈ) ⬆️
Tests/TuistGeneratorTests/GeneratorTests.swift 100% <100%> (ΓΈ) ⬆️
.../TuistKitTests/Commands/GenerateCommandTests.swift 98.59% <94.73%> (-0.63%) ⬇️

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 5879482...db531fe. Read the comment docs.

@pepicrft
Copy link
Contributor

Happy to change to --only-project as suggested in the issue discussions, wanted to throw one more out there: --project-only let me know your thoughts

I'm more inclined towards --project-only. Maybe @ollieatkinson can tell us which one sounds more semantically correct?

@ollieatkinson
Copy link
Collaborator

--only-project is more semantically correct, but both are technically correct. English is a strange language.

This stackexchange answer goes into some detail about the issue: https://english.stackexchange.com/questions/173239/only-requires-or-requires-only

Copy link
Collaborator

@ollieatkinson ollieatkinson left a comment

Choose a reason for hiding this comment

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

Really nice work πŸ‘ This is a great feature.

@kwridan
Copy link
Collaborator Author

kwridan commented Jul 24, 2019

Thanks for the feedback @pepibumur & @ollieatkinson

Having looked at some other command line examples such as clang --cuda-device-only and curl --list-only we can stick with --project-only

@kwridan kwridan merged commit c148243 into tuist:master Jul 24, 2019
@kwridan kwridan deleted the features/local-projects-only branch July 24, 2019 10:39
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.

Add ability to re-generate individual projects
4 participants