Mark variables calculated that use project values as @Input values and defer their initialization until the tasks are registered. This is required since the Project can not be accessed directly during configuration.
Defer initialization and usage of the ADB commands until task execution. Previously we would initialize ADB when the tasks were registered and this would cause an execution of adb devices to initialize the target list. This has been deferred until the task is actually executed.
Use --configuration-cache with your gradle command to enable the Configuration Cache. Run the command multiple times to confirm that the cache is correctly used for subsequent calls.
You can run rm -rf .gradle/configuration-cache/ to clear the cache and start fresh.
$> ./gradlew FlixSample:testifyVersion --configuration-cache
Configuration cache is an incubating feature.
Calculating task graph as no configuration cache is available for tasks: FlixSample:testifyVersion
> Task :FlixSample:testifyVersion
------------------------------------------------------------
Displays the Testify plugin version
------------------------------------------------------------
Vendor = ndtp
Title = Testify
Version = local
0 problems were found storing the configuration cache.
BUILD SUCCESSFUL in 915ms
1 actionable task: 1 executed
Configuration cache entry stored.
$> ./gradlew FlixSample:testifyVersion --configuration-cache
Configuration cache is an incubating feature.
Reusing configuration cache.
> Task :FlixSample:testifyVersion
------------------------------------------------------------
Displays the Testify plugin version
------------------------------------------------------------
Vendor = ndtp
Title = Testify
Version = local
BUILD SUCCESSFUL in 424ms
1 actionable task: 1 executed
Configuration cache entry reused.
Notice
[!WARNING]
This change must keep main in a shippable state; it may be shipped without further notice.
What does this change accomplish?
Fixes #79
How have you achieved it?
The Testify Gradle Plugin now supports Gradle Configuration Cache.
This required two main changes:
project
values as@Input
values and defer their initialization until the tasks are registered. This is required since the Project can not be accessed directly during configuration.ADB
commands until task execution. Previously we would initialize ADB when the tasks were registered and this would cause an execution ofadb devices
to initialize the target list. This has been deferred until the task is actually executed.Also, added new tests using the Gradle TestKit
Scope of Impact and Testing instructions
Use
--configuration-cache
with your gradle command to enable the Configuration Cache. Run the command multiple times to confirm that the cache is correctly used for subsequent calls.You can run
rm -rf .gradle/configuration-cache/
to clear the cache and start fresh.Notice