Improve Gradle agent docs for configuration cache#3823
Conversation
Fixes mockito#3822 Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
|
Makes sense to make this the default recommendation to copy-paste. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3823 +/- ##
=========================================
Coverage 86.84% 86.84%
Complexity 3039 3039
=========================================
Files 343 343
Lines 9167 9167
Branches 1135 1135
=========================================
Hits 7961 7961
Misses 917 917
Partials 289 289 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the PR + adding the example to the docs! 🌻 |
|
Thanks for checking this! I kept both examples because the existing documentation already included Kotlin DSL and Groovy DSL sections, and this PR only updates the Groovy example to use the configuration-cache-friendly That said, I’m happy to adjust the structure if maintainers prefer a simpler docs section — for example, keeping only one example, or updating both Kotlin and Groovy examples to use the same provider-based approach. |
Summary
This updates the Groovy Gradle example for explicitly attaching Mockito as a Java agent to use
CommandLineArgumentProvider.The previous example accessed
configurations.mockitoAgentdirectly from the test task configuration, which can fail when Gradle configuration cache is enabled. The revised example follows the provider-based pattern suggested in #3822 and keeps the documented setup compatible with configuration-cache usage.The surrounding wording is also adjusted so it no longer says that
CommandLineArgumentProvideris omitted from the examples.Fixes #3822
Checklist
including project members to get a better picture of the change
commit is meaningful and help the people that will explore a change in 2 years
./gradlew spotlessApplyfor auto-formatting)Fixes #<issue number>in the description if relevantFixes #<issue number>if relevant