Gradle task
A unit of work in a Gradle build, such as compileJava or test, which declares its inputs and outputs and its dependencies on other tasks.
In more detail
Running a task runs the tasks it depends on first, following the graph. Because each task declares what it reads and writes, Gradle can skip it when nothing changed or reuse its output from a cache. Build scripts configure existing tasks, such as telling the test task to use the JUnit Platform.
Example
tasks.test { useJUnitPlatform() }Related terms
- Gradle — A build tool whose build is a script in a programming language and a graph of tasks that are skipped when their inputs have not changed.
- up-to-date check — Gradle's check that a task's inputs and outputs are unchanged since its last run, in which case it skips the task.
- Gradle build cache — A store of task outputs, keyed by their inputs, that lets Gradle reuse results from an earlier build or from a colleague's build.
Taught in
- The Toolchain: Gradle — Modern Java: Virtual Threads & High-Throughput Services