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

Filter out empty auxiliary groups #6142

Merged
merged 1 commit into from Apr 2, 2024
Merged

Filter out empty auxiliary groups #6142

merged 1 commit into from Apr 2, 2024

Conversation

kwridan
Copy link
Collaborator

@kwridan kwridan commented Apr 1, 2024

Resolves: #6141

Short description πŸ“

  • Add cached artifacts into a new group called /CacheΒ #6057 introduced a Cache group to help distinguish cached artifacts from system libraries
  • This didn't account for cases where the cache or cloud features aren't in use thus causing an additional Cache group to appear in all generated projects
  • As a short term mitation we can filter out empty "auxiliary" groups at the end of the project generation steps
  • This includes groups Xcode doesn't have by default including the Frameworks group which it only adds if a system library dependency is added

Notes πŸ“

  • The Product group isn't treated as an auxiliary group as Xcode always has this group in the generated pbxproj, the UI however hides it when empty
  • A longer term solution would be extend the project/target API to allow the cache mapper to add groups instead of TuistGenerator having awareness about the cache feature

How to test the changes locally 🧐

  • Generate the fixture ios_app_with_tests
  • Verify the Frameworks and Cache groups are no longer present
  • Generate the fixture ios_app_with_sdk
  • Verify the Frameworks group is still present (as there are system library dependencies)
  • Verify the Cache group is no longer present

Contributor checklist βœ…

  • The code has been linted using run mise run lint:fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

@kwridan kwridan changed the title Filter out empty auxilary groups Filter out empty auxiliary groups Apr 1, 2024
Partially resolves: #6141

- #6057 introduced a `Cache` group to help distinguish cached artifacts from system libraries
- This didn't account for cases where the cache or cloud features aren't in use thus causing an additional `Cache` group to appear in all generated projects
- As a short term mitation we can filter out empty "auxiliary" groups at the end of the project generation steps
- This includes groups Xcode doesn't have by default including the `Frameworks` group which it only adds if a system library dependency is added

Notes:

- The `Product` group isn't treated as an auxiliary group as Xcode always has this group in the generated `pbxproj`, the UI however hides it when empty
- A longer term solution would be extend the project/target API to allow the cache mapper to add groups instead of `TuistGenerator` having awareness about the cache feature

Test Plan:

- Generate the fixture `ios_app_with_tests`
- Verify the `Frameworks` and `Cache` groups are no longer present
- Generate the fixture `ios_app_with_sdk`
- Verify the `Frameworks` group is still present (as there are system library dependencies)
- Verify the `Cache` group is no longer present
@kwridan kwridan marked this pull request as ready for review April 2, 2024 08:19
@pepicrft pepicrft assigned pepicrft and unassigned pepicrft Apr 2, 2024
@pepicrft pepicrft added the changelog:changed PR will be listed in the Changed section of CHANGELOG label Apr 2, 2024
@pepicrft pepicrft merged commit b54a1cf into main Apr 2, 2024
8 checks passed
@pepicrft pepicrft deleted the fix/remove-empty-groups branch April 2, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:changed PR will be listed in the Changed section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty Cache group in generated projects
2 participants