Gradle Build Cache Deep Dive


Get hands-on training on using Gradle’s Build Cache for improving performance.

Description

The Gradle build cache significantly reduces build time by reusing outputs produced by other builds in your organization. In this training you will learn the basics and best practices to improve the performance of your builds by using the build cache. We’ll go over the recommended architecture for setting up a cache as well as how to author tasks to correctly utilize caching. We will also use Develocity to learn how to analyze and troubleshoot issues.

Duration

2.5 hours training session followed by 30-minutes Q&A.

Audience

Gradle build tool users as well as Develocity users interested in speeding up builds are encouraged to attend the training.

Prerequisites

  • Gradle Build Tool experience
    • Knowledge of core concepts
    • Authoring build files
  • Kotlin experience a plus but not required
  • Experience with Java software development

Objectives

After this training the participants will be able to:

  • Understand the benefits of using the Gradle build cache
  • Use and configure the build cache
  • Optimize build logic for maximum cacheability

Course Outline

  • Historical Background
    • Context of problem we’re trying to solve
    • Life of a build
    • Performance Ideas: Re-use
  • Build Cache in Gradle
    • Incremental Builds
      • Visible through task outcomes
      • How it works
      • Build-in tasks that support
      • Limitations
    • Local Cache
      • How it works and benefits
      • How to enable and use
      • Limitations
      • Hands-on exercise 1
    • Remote Cache
      • How it works and benefits
      • How to enable and use
      • Hands-on exercise 2
  • Enabling with Custom Tasks
    • Wiring inputs and outputs using annotations for caching
    • Normalizing inputs
    • Using runtime API to enable caching
    • Hands-on exercise 3
  • Troubleshooting Tasks
    • Possible problems
    • Approaches to debugging
    • Using build scans
    • Hands-on exercise 4
  • Next Steps
    • Getting started with local cache
    • Develocity for remote cache