使用gradle来查找依赖关系树 [英] Using gradle to find dependency tree
本文介绍了使用gradle来查找依赖关系树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个项目,并希望找出所有依赖关系,所以我可能会使用gradle生成一个依赖于什么的树。能够使用前向声明来修剪它。
解决方案
对于Android,使用此行
gradle app:dependencies
或者如果你有一个gradle包装器:
./ gradlew app:依赖关系
其中 app
是您的项目模块。
另外,如果你想检查是否有一些是 compile
与 testCompile code> vs
androidTestCompile
依赖关系以及它是什么拉动它:
./ gradlew:app:dependencyInsight --configuration compile --dependency< name>
./gradlew:app:dependencyInsight --configuration testCompile --dependency< name>
./gradlew:app:dependencyInsight --configuration androidTestCompile --dependency< name>
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 a little with forward declarations etc.
解决方案
For Android, use this line
gradle app:dependencies
or if you have a gradle wrapper:
./gradlew app:dependencies
where app
is your project module.
Additionally, if you want to check if something is compile
vs. testCompile
vs androidTestCompile
dependency as well as what is pulling it in:
./gradlew :app:dependencyInsight --configuration compile --dependency <name>
./gradlew :app:dependencyInsight --configuration testCompile --dependency <name>
./gradlew :app:dependencyInsight --configuration androidTestCompile --dependency <name>
这篇关于使用gradle来查找依赖关系树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文