Table of Contents

Gradle - Build

About

A build is a lifecyle task that executes a graph of task

Execution

Gradle executes build scripts in three fixed phases:

These phases form Gradle’s Build Lifecycle.

Management

Execute

gradle build

Incremental

Tasks should define inputs and outputs to get the performance benefits of an incremental build.

https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks

Gradle comes with a sophisticated incremental Java compiler that is active by default (ie cache is on) doc

Set Build File

Specify the build file.

gradle [-b|--build-file]

Set Property

Set project property for the build script (e.g. -Pmyprop=myvalue).

gradle -P, --project-prop       

Disable Cache

gradle --no-build-cache          
gradlew build --rerun-tasks         

Include

see Gradle - Build composite

Dry run

Run the builds with all task actions disabled.

gradle [-m|--dry-run]

Output