Extending Gradle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
=Overview=
=Overview=


The simplest way of extending Gradle is write a [[#Custom_Task|custom task]]. The custom task can be declared in-line in the default build script [[build.gradle]] or in a separate build script that is included from the default build script. The custom task can also be define as an independent class exposed in a separate library that is then imported in [[build.gradle]].
The simplest way of extending Gradle is write a [[#Custom_Task|custom task]], which can be declared in-line in [[build.gradle]] or can be part of a different artifact.


=Custom Task=
=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 that is included from the default build script. The code of the custom task can live in a separate source file, which in turn can be declare in a special area of the Gradle project, or can be share with other projects as part of a library.
[[Gradle Task|Task]].
[[Gradle Task|Task]].
<font color=orange>DEPLETE [[Gradle_Task_TODEPLETE#Explicit_Task_Declaration_.28Custom_Tasks.29]]</font>
<font color=orange>DEPLETE [[Gradle_Task_TODEPLETE#Explicit_Task_Declaration_.28Custom_Tasks.29]]</font>

Revision as of 20:54, 23 September 2020

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 that is included from the default build script. The code of the custom task can live in a separate source file, which in turn can be declare 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

Writing a Script Plugin

Writing an Object Plugin