• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dorongold/gradle-task-tree: Gradle plugin that adds a 'taskTree' task th ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

dorongold/gradle-task-tree

开源软件地址(OpenSource Url):

https://github.com/dorongold/gradle-task-tree

开源编程语言(OpenSource Language):

Groovy 83.6%

开源软件介绍(OpenSource Introduction):

Gradle Task Tree

version

Gradle plugin that adds a taskTree task that prints task dependency tree report to the console.

The task dependency tree is printed with a similar format to that of the built-in dependencies task.

Installation

The plugin can be configured in the build script or in an init script.

The plugin is published on Gradle Plugin Portal.

Build Script Snippet

plugins {
    id "com.dorongold.task-tree" version "2.1.0"
}

Init Script Snippet

To use this plugin in all your projects, put the following in a file named init.gradle in the $USER_HOME/.gradle/ directory, or any file ending in .gradle in the $USER_HOME/.gradle/init.d/ directory. See here for more information on initialization scripts.

initscript {
    repositories {
        maven { url "https://plugins.gradle.org/m2" }
    }
    dependencies {
	    classpath "com.dorongold.plugins:task-tree:2.1.0"
    }
}
rootProject {
    apply plugin: com.dorongold.gradle.tasktree.TaskTreePlugin
}

Usage

gradle <task 1>...<task N> taskTree

When one of the tasks given to the gradle command is taskTree, executions of all the other tasks given on that command are skipped. Instead, their task dependency tree is printed.

Examples

gradle build taskTree

:build
+--- :assemble
|    \--- :jar
|         \--- :classes
|              +--- :compileJava
|              \--- :processResources
\--- :check
     \--- :test
          +--- :classes
          |    +--- :compileJava
          |    \--- :processResources
          \--- :testClasses
               +--- :compileTestJava
               |    \--- :classes
               |         +--- :compileJava
               |         \--- :processResources
               \--- :processTestResources

gradle compileJava taskTree

:compileJava
No task dependencies

gradle taskTree javadoc test check

:javadoc
\--- :classes
     +--- :compileJava
     \--- :processResources

:test
+--- :classes
|    +--- :compileJava
|    \--- :processResources
\--- :testClasses
     +--- :compileTestJava
     |    \--- :classes
     |         +--- :compileJava
     |         \--- :processResources
     \--- :processTestResources

:check
\--- :test
     +--- :classes
     |    +--- :compileJava
     |    \--- :processResources
     \--- :testClasses
          +--- :compileTestJava
          |    \--- :classes
          |         +--- :compileJava
          |         \--- :processResources
          \--- :processTestResources

Configuration

To limit the depth of the printed tree, add the command-line option: --depth <number>
To print task inputs for each task in the tree, add the command-line option: --with-inputs
To print task outputs for each task in the tree, add the command-line option: --with-outputs
To allow a sub-tree of the same task to be repeated more than once, add the command-line option: --repeat

For a more static custom configuration, you can put the following in build.gradle (or, in case you take the init script approach, in init.gradle).

//optional configuration (per project)
tasks.named('taskTree').configure {
    depth = 3 // limit tree depth to 3. Equivalent to the --depth CLI task option.
    withInputs = true // prints task inputs in red just below the task in the tree. Equivalent to the --with-inputs CLI task option.
    withOutputs = true // prints task inputs in red just below the task in the tree. Equivalent to the --with-outputs CLI task option.
    repeat = true  // allows printing a sub-tree in the task-tree more than once. Equivalent to the --repeat CLI task option
    impliesSubProjects = true  // disables printing task-tree for child projects in a multi-project
}

Note:

In a multi-project, it is recommended to apply the plugin on the root project only. The taskTree task will automatically be added to child projects.
I.e. it is unnecessary to apply this plugin under allprojects or subprojects.

Version Compatibility

Gradle 6.8+
Java 1.8+

Older Version Compatibility

Version 1.5 of this plugin is compatible with Gradle 2.3+

IntelliJ Plugin

reveal-dependency-plugin can print the task dependency tree inside IntelliJ.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
gdubw/gdub: A gradlew / gradle wrapper.发布时间:2022-06-18
下一篇:
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap