我正在尝试做一些我觉得应该相对简单的事情,但互联网上似乎没有什么能给我我想要的东西。
基本上,我想从我的 compile/testCompile 依赖项中获取build.gradle
(我不想要任何子依赖项 - 就像它们在文件中一样),并且对于每个我想用组名做某事的人,名称和版本。假设我想打印它们。
所以这是我的build.gradle
:
dependencies {
compile 'org.spring.framework.cloud:spring-cloud-example:1.0.6'
compile 'org.spring.framework.cloud:spring-cloud-other-example:1.1.6'
testCompile 'org.spring.framework.cloud:spring-cloud-example-test:3.1.2'
}
task printDependencies {
//some code in here to get results such as...
// org.spring.framework.cloud spring-cloud-other-example 1.1.6
}
谢谢大家。