Skip to content

gradle/dpeuni-gradle-build-cache-deep-dive-unstable-inputs

Repository files navigation

DPE University Training

Gradle Build Cache Deep Dive - Unstable Inputs Exercise

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

Prerequisites

Develocity Authentication

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:

Steps

  1. Open the Gradle project in this repository in an editor of your choice
  2. Run ./gradlew :app:test twice. You will notice the task is not up-to-date

  1. Create a couple of build scans to get insights: ./gradlew :app:test --scan
  2. Perform a build scan comparison if more insights are needed

  1. Notice the common-1.0.jar file input changed for the :app:test task. This is produced by the :common:jar task, whose MANIFEST.MF file input changed:

  1. Inspect the file common/build/tmp/jar/MANIFEST.MF to figure out what is changing. Notice the timestamp variable:

  1. Go to the common/build.gradle.kts and look at the jar task configuration:

  1. Refer to the input normalization doc and add the appropriate configuration to app/build.gradle.kts

  2. Run the :app:test task a couple of times to verify it's now UP-TO-DATE

Solution Reference

If you get stuck you can refer to the solution branch of this repository.

About

Hands-on exercise for DPE University

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages