Gradle Task Dependencies and Ordering: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#N18D13 =Overview= May times, a task requires another task to run first, especially if the task depe...")
 
Line 1: Line 1:
=External=
=External=
* https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#N18D13
* https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#N18D13
=Internal=
* [[Gradle_Task#Dependencies_and_Ordering|Gradle Task]]


=Overview=
=Overview=

Revision as of 21:44, 8 October 2020

External

Internal

Overview

May times, a task requires another task to run first, especially if the task depends on the produced output of its dependency task. A task may declared its dependencies explicitly. A task may depend on other tasks implicitly, as described in the Implicit Dependencies section.

Explicit Dependencies

The Task API used to declare explicit task dependencies is Task.dependsOn(Object... paths), which surfaces in the DSL as:

task red {
  dependsOn 'blue'
}

Note that a task dependency may be another task name, the task instance itself or another objects. TODO: https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html#dependencies

Implicit Dependencies