Alexey
Alexey

Reputation: 3192

gradle subproject dependencies as list of other subprojects

How can I get list of a subproject dependecies as list of Project object?
subproject.dependencies gives list of DependencyHandler objects. And I can't find how extract Project from DependencyHandler.

Upvotes: 0

Views: 78

Answers (1)

Alexey
Alexey

Reputation: 3192

After a short have found solution myself :)

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

Upvotes: 0

Related Questions