Gradle Task: Difference between revisions
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
A task represents a well defined piece of work that is executing during a [[Gradle_Concepts#Build_Lifecycle|build]], such as compiling Java classes or creating a distribution file. | A task represents a well defined piece of work that is executing during a [[Gradle_Concepts#Build_Lifecycle|build]], such as compiling Java classes or creating a distribution file. | ||
A tasks belongs to a [[Gradle Project#Overview|project]]. | |||
=Task Structure= | =Task Structure= |
Revision as of 22:27, 3 October 2020
External
Internal
Overview
A task represents a well defined piece of work that is executing during a build, such as compiling Java classes or creating a distribution file.
A tasks belongs to a project.
Task Structure
Declaring a Task
Task API
Overview
With no plugins, a build has a small set of built-in tasks.
Each plugin typically adds more.
Custom tasks can be added in build.gradle or script plugins.
Task Name
Define task name constraints. A dash is not allowed.
Task Configuration Closure
Task Action
Task Action Closure
Task action closures can be used to define custom simple tasks, in-line in build.gradle or in a script plugin.