This is a hands-on exercise to go along with the Gradle Build Cache Deep Dive training module. In this exercise you will go over the following:
- Practice troubleshooting cache misses due to unstable inputs
- Get familiar with using input normalization
- Finished going through the troubleshooting section in Gradle Build Cache Deep Dive
If you haven't already done so, you can authenticate with the training Develocity service by running:
./gradlew provisionGradleEnterpriseAccessKey
The output of the task will indicate a browser window will come up from which you can complete the authentication:
Once the browser window comes up you can enter a title for the access key that will be created or go with the suggested title:
Once confirmed you will see the following message and you can close the browser window and return to the editor:
- Open the Gradle project in this repository in an editor of your choice
- Run
./gradlew :app:test
twice. You will notice the task is not up-to-date
- Create a couple of build scans to get insights:
./gradlew :app:test --scan
- Perform a build scan comparison if more insights are needed
- Notice the
common-1.0.jar
file input changed for the:app:test
task. This is produced by the:common:jar
task, whoseMANIFEST.MF
file input changed:
- Inspect the file
common/build/tmp/jar/MANIFEST.MF
to figure out what is changing. Notice the timestamp variable:
- Go to the
common/build.gradle.kts
and look at thejar
task configuration:
-
Refer to the input normalization doc and add the appropriate configuration to
app/build.gradle.kts
-
Run the
:app:test
task a couple of times to verify it's nowUP-TO-DATE
If you get stuck you can refer to the solution
branch of this repository.