./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, othe
gradle task tree can be visualized by gradle tasks --all
or try the following plugins:
Graphs Gradle and Talaiot: Look into this: https://proandroiddev.com/graphs-gradle-and-talaiot-b0c02c50d2b1 blog as it lists graphically viewing tasks and dependencies. This uses free open Graphviz tool Gephi (https://gephi.org/features/)
gradle-task-tree: https://github.com/dorongold/gradle-task-tree and
gradle-visteg: https://github.com/mmalohlava/gradle-visteg
gradle-visteg plugin: The generated file can be post-processed via Graphviz dot
utility.
For example, png image is produced as follows:
cd build/reports/; dot -Tpng ./visteg.dot -o ./visteg.dot.png
For more information, please visit Graphviz home page.
Whatever tasks are actually used to run a task (for ex: build
) can be viewed in nice HTML page using --profile
option
gradle --profile clean build
Once this is complete, go to build/reports/profile folder and browse the .html file. You'll see dependencies resolution and other info with time it took in a nice html page.
There's a new plugin for this:
plugins {
id 'org.barfuin.gradle.taskinfo' version '1.0.1'
}
Then you can type:
./gradlew tiTree assemble
and get something like this:
:assemble (org.gradle.api.DefaultTask)
+--- :jar (org.gradle.api.tasks.bundling.Jar)
| `--- :classes (org.gradle.api.DefaultTask)
| +--- :compileJava (org.gradle.api.tasks.compile.JavaCompile)
| `--- :processResources (org.gradle.language.jvm.tasks.ProcessResources)
+--- :javadocJar (org.gradle.api.tasks.bundling.Jar)
| `--- :javadoc (org.gradle.api.tasks.javadoc.Javadoc)
| `--- :classes (org.gradle.api.DefaultTask)
| +--- :compileJava (org.gradle.api.tasks.compile.JavaCompile)
| `--- :processResources (org.gradle.language.jvm.tasks.ProcessResources)
`--- :sourcesJar (org.gradle.api.tasks.bundling.Jar)
The plugin can also show the order in which tasks will be executed:
In order to execute task ':assemble', the following tasks would be executed in this order:
1. :compileJava (org.gradle.api.tasks.compile.JavaCompile)
2. :processResources (org.gradle.language.jvm.tasks.ProcessResources)
3. :classes (org.gradle.api.DefaultTask)
4. :jar (org.gradle.api.tasks.bundling.Jar)
5. :javadoc (org.gradle.api.tasks.javadoc.Javadoc)
6. :javadocJar (org.gradle.api.tasks.bundling.Jar)
7. :sourcesJar (org.gradle.api.tasks.bundling.Jar)
8. :assemble (org.gradle.api.DefaultTask)
More info in the plugin's docs.
Full disclosure: I am the author of gradle-taskinfo.
You can try com.dorongold.task-tree plugin with simple usage:
gradle <task 1>...<task N> taskTree
Example result from the readme:
gradle build taskTree
:build
+--- :assemble
| \--- :jar
| \--- :classes
| +--- :compileJava
| \--- :processResources
\--- :check
\--- :test
+--- :classes
| +--- :compileJava
| \--- :processResources
\--- :testClasses
+--- :compileTestJava
| \--- :classes
| +--- :compileJava
| \--- :processResources
\--- :processTestResources
You can programmatically access the task graph to inspect it within the build script using Gradle.getTaskGraph()