taskTree: https://github.com/dorongold/gradle-task-tree
gradle 版本 6.+(不同版本,去github看对应版本)
project/build.gradle
增加
buildscript {
repositories {
...
maven { url "https://plugins.gradle.org/m2" }
...
}
dependencies {
。。。。
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.5"
}
apply plugin: "com.dorongold.task-tree"
执行命令:
./gradlew assembleRelease taskTree --task-depth 4 > taskTree.txt
可查看到task依赖图:
:app:assembleRelease
+--- :app:checkReleaseKoinModules
| \--- :app:testReleaseUnitTest
| +--- :app:compileReleaseJavaWithJavac
| | +--- :app:compileReleaseAidl ..>
| | +--- :app:compileReleaseKotlin ..>
| | +--- :app:compileReleaseRenderscript ..>
| | +--- :app:generateReleaseBuildConfig ..>
| | +--- :app:greendao ..>
| | +--- :app:javaPreCompileRelease ..>
| | +--- :app:kaptReleaseKotlin ..>
| | +--- :app:preReleaseBuild ..>
| | \--- :app:processReleaseResources ..>
| +--- :app:compileReleaseKotlin
| | +--- :app:compileReleaseAidl ..>
| | +--- :app:compileReleaseRenderscript ..>
| | +--- :app:generateReleaseBuildConfig ..>
| | +--- :app:greendao ..>
| | +--- :app:kaptReleaseKotlin ..>
| | \--- :app:processReleaseResources ..>
| +--- :app:compileReleaseUnitTestJavaWithJavac
| | +--- :app:compileReleaseJavaWithJavac ..>
可以减少 --task-depth 对应的值 减少层级深度
网友评论