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

Add cached artifacts into a new group called /Cache #6057

Merged
merged 1 commit into from Mar 12, 2024

Conversation

mustiikhalil
Copy link
Collaborator

Short description πŸ“

The following PR addresses #5899 where we add the precompiled cached artifacts into a new group called /Cache since this adheres to Xcode's convention.

Resolves #5899

How to test the changes locally 🧐

I faced issues testing this locally since the command cached isn't within the project anymore, however I have verified that the tests work and a new group is generated called /Cache

  • Go into app_with_spm_dependencies
  • Run tuist install
  • Run tuist cache --external-only or tuist cache
  • Run tuist generate
  • Verify that the project App has a group called /Cache which should contain all the precompiled cached artifacts

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

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

@mustiikhalil
Copy link
Collaborator Author

mustiikhalil commented Mar 8, 2024

Working on this made me think,

  • Is there a way to test tuist cache on local devices with the currently built binary?
  • Is there a way to see if there are cached frameworks before adding the cached framework group?

Adding a new group called Cache that contains the cached artifacts instead of adding them into the Framework group
@mustiikhalil
Copy link
Collaborator Author

mustiikhalil commented Mar 12, 2024

@fortmarek Sorry for the ping, but is this good to go? or am I missing something?

@pepicrft
Copy link
Contributor

@fortmarek is this good to go? or am I missing something?

Let me test it integrated into the Tuist Cloud code and if it works, we can merge it.

@pepicrft pepicrft added the changelog:added PR will be listed in the Added section of CHANGELOG label Mar 12, 2024
@pepicrft
Copy link
Contributor

Worked as expected:
image

@pepicrft pepicrft merged commit e3d2456 into tuist:main Mar 12, 2024
7 of 8 checks passed
@pepicrft
Copy link
Contributor

@all-contributors add @mustiikhalil for code

Copy link
Contributor

@pepicrft

@mustiikhalil already contributed before to code

@mustiikhalil mustiikhalil deleted the issue-5899 branch March 12, 2024 16:55
@pepicrft
Copy link
Contributor

@mustiikhalil I made you collaborator of the repo so that you no longer need to work from forks, which is annoying for everyone.

@mustiikhalil
Copy link
Collaborator Author

@pepicrft thanks! that would be helpful in the future

kwridan added a commit that referenced this pull request 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 "auxilary" 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 `auxilary` 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 mentioned this pull request Apr 1, 2024
6 tasks
kwridan added a commit that referenced this pull request 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
pepicrft pushed a commit that referenced this pull request Apr 2, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:added PR will be listed in the Added section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cache artifacts to a /Cache group
2 participants