Is there a way to list task dependencies in Gradle?

./gradle tasks lists "some" of the tasks. Looking at http://gradle.org/docs/current/userguide/java_plugin.html there are hidden ones not listed. Also, other plugins will not have such a nice pretty graph of the dependencies between tasks.

Is there a way to

  1. list all the tasks in all plugins with gradle
  2. list the tasks and what tasks they depend on (sort of like maven's dependency:tree but for tasks)

Solution 1:

list the tasks and what tasks they depend on (sort of like maven's depenceny:tree but for tasks)

for this you can use --dry-run (or -m) option which lists tasks which are executed in order for particular command, but does not execute the command, e.g.

gradle assemble --dry-run

you can find more here

Solution 2:

Prior to Gradle 3.3, you could use the --all flag to get a more detailed listing of the available tasks and the task dependencies:

gradle tasks --all

The dependency reporting was removed from this task as of Gradle 3.3 for performance reasons. This change and its rationale was documented in the Gradle 3.3 release notes.