美文网首页
查看 gradle task 依赖关系图

查看 gradle task 依赖关系图

作者: couriravant | 来源:发表于2022-08-21 19:30 被阅读0次

    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 对应的值 减少层级深度

    相关文章

      网友评论

          本文标题:查看 gradle task 依赖关系图

          本文链接:https://www.haomeiwen.com/subject/ttaigrtx.html