Extending Gradle

From NovaOrdis Knowledge Base
Revision as of 20:57, 23 September 2020 by Ovidiu (talk | contribs) (→‎Custom Task)
Jump to navigation Jump to search

Internal

Overview

The simplest way of extending Gradle is write a custom task, which can be declared in-line in build.gradle or can be part of a different artifact.

Custom Task

The simplest way of extending Gradle is write a custom task. The custom task can be declared in-line in the default build script build.gradle. The custom class can also be declared in-line in a separate build script, which is then included from the default build script. The code of the custom task can live in a separate source file, which in turn can be declared in a special area of the Gradle project, or can be share with other projects as part of a library.

Task. DEPLETE Gradle_Task_TODEPLETE#Explicit_Task_Declaration_.28Custom_Tasks.29

In-Line Custom Task

Standalone Custom Task

Custom Script Plugin

Custom Object Plugin