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

Support configuration cache (second attempt) #307

Merged
merged 1 commit into from
May 15, 2022

Conversation

MyDogTom
Copy link
Contributor

@MyDogTom MyDogTom commented May 8, 2022

📌 References

🎩 What is the goal?

Ensure that configuration cache works after Gradle daemon is recreated.

How is it being implemented?

  • Avoid using global variable because Gradle has no idea about it and cannot recreate when configuration cache is reused. Use explicit task input instead.
  • Annotate other task inputs.
  • Convert internal "shot" property to function. It's used only once by each task anyway.

How can it be tested?

  • ./gradlew debugExecuteScreenshotTests --configuration-cache
  • ./gradlew --stop
  • ./gradlew debugExecuteScreenshotTests --configuration-cache - should display "Reusing configuration cache."

* Avoid using global variable because Gradle has no idea about it and cannot recreate when configuration cache is reused. Use explicit task input instead.
* Annotate other task inputs.
* Convert internal "shot" property to function. It's used only once by each task anyway.
Copy link
Owner

@pedrovgs pedrovgs left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @MyDogTom I'm wondering if we could automate the checks you mentioned in the PR description to ensure any future change in this plugin will not break this feature.

@MyDogTom
Copy link
Contributor Author

@pedrovgs I was thinking about enabling configuration cache in the sample project, but this depends on AGP update and can be done only after #292 is merged.
Once sample app has configuration cache enabled, it should be possible to automate the same scenario.

Copy link
Owner

@pedrovgs pedrovgs left a comment

Choose a reason for hiding this comment

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

Thanks for the info and your contribution @MyDogTom! I'm merging this PR right now and releasing a new version ASAP 😃

@pedrovgs pedrovgs merged commit 656f6a0 into pedrovgs:master May 15, 2022
@MyDogTom MyDogTom deleted the mydogtom/declare-task-inputs branch May 16, 2022 12:14
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.

2 participants