简体   繁体   English

gradle 子项目依赖项作为其他子项目的列表

[英]gradle subproject dependencies as list of other subprojects

How can I get list of a subproject dependecies as list of Project object?如何获取子项目依赖项列表作为Project object 的列表?
subproject.dependencies gives list of DependencyHandler objects. subproject.dependencies给出了DependencyHandler对象的列表。 And I can't find how extract Project from DependencyHandler .而且我找不到如何从DependencyHandler中提取Project

After a short have found solution myself:)经过短暂的自己找到解决方案:)

subprojects {
    configurations.all {
        allDependencies.each {
            if (it instanceof ProjectDependency) {
                println it.dependencyProject
            }
        }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM