Using gradle to find dependency tree

后端 未结 14 1661
-上瘾入骨i
-上瘾入骨i 2020-11-22 03:20

Is it possible to use gradle to produce a tree of what depends on what?

I have a project and would like to find out all the dependencies so I may be able to prune it

相关标签:
14条回答
  • 2020-11-22 03:44

    Often the complete testImplementation, implementation, and androidTestImplementation dependency graph is too much to examine together. If you merely want the implementation dependency graph you can use:

    ./gradlew app:dependencies --configuration implementation
    

    Source: Gradle docs section 4.7.6

    Note: compile has been deprecated in more recent versions of Gradle and in more recent versions you are advised to shift all of your compile dependencies to implementation. Please see this answer here

    0 讨论(0)
  • 2020-11-22 03:45

    For me, it was simply one command

    in build.gradle add plugin

    apply plugin: 'project-report'
    

    and then go to cmd and run following command

    ./gradlew htmlDependencyReport
    

    This gives me an HTML report WOW Html report

    0 讨论(0)
提交回复
热议问题