Tasks

Six lessons on the unit of work of every build: list the tasks, register one, give it actions that run first and last, wire it to the tasks it needs, read the graph Gradle plans, and see why a second build says UP-TO-DATE or takes the result from the cache.

3.1 List the tasks of a build gradle tasks, gradle tasks --all and gradle help --task Open 3.2 Write a task tasks.register, a task with a type and an action Open 3.3 doFirst and doLast the actions of a task and the order they run in Open 3.4 Task dependencies dependsOn, mustRunAfter and finalizedBy Open 3.5 The task graph what Gradle plans before it runs, with --dry-run and --info Open 3.6 Inputs, outputs and UP-TO-DATE why a task runs again or does not, and the build cache line that says FROM-CACHE Open

Lessons