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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mapping hash as input for generate uuid task #662

Merged
merged 8 commits into from Feb 27, 2024

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Feb 26, 2024

馃摐 Description

  • When isIncludeAndroidResources is enabled, it also runs android resources/assets generation tasks so they are available in robolectric tests. Since our generateUuid task was depending on the mapping file (use source files as input for generating uuids and source bundle聽#634), minifyReleaseWithR8 task was also triggered when running robolectric tests.
  • Instead we now set file hash as task property:
    • This still ensures the task is only running when the mapping file contents changed
    • But this does not trigger the minify task for robolectric tests (which is what we want!)
    • Additional optimization is that we also read the top lines of the mapping file, which usually contains a SHA-256 hash generated by r8 itself, and use it. This helps us with big files especially, because we don't need to generate hash of their contents (which can take multiple seconds)

馃挕 Motivation and Context

Internal report from a customer

馃挌 How did you test it?

manually + automated

馃摑 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

馃敭 Next steps

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

LGTM

@romtsn romtsn merged commit e1867d2 into main Feb 27, 2024
18 checks passed
@romtsn romtsn deleted the rz/fix/minify-task-runs-with-tests branch February 27, 2024 14:24
@romtsn romtsn self-assigned this Feb 27, 2024
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.

None yet

2 participants