Is there a way to list task dependencies in Gradle?

后端 未结 10 974
逝去的感伤
逝去的感伤 2020-12-07 10:33

./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

10条回答
  •  有刺的猬
    2020-12-07 11:25

    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

    1. gradle-visteg plugin: The generated file can be post-processed via Graphviz dot utility.

    2. 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.

提交回复
热议问题