Created
May 31, 2016 22:41
-
-
Save jkschneider/abf06df0348f0e8ec58a4a92a0c516f1 to your computer and use it in GitHub Desktop.
Gradle First Level Dependency Subgraph Size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task firstLevelSubgraphSize << { | |
def cardinality = { ResolvedDependency d, Set<ModuleVersionIdentifier> alreadySeen -> | |
alreadySeen.add(d.module.id) ? d.children.sum(0) { owner.call(it, alreadySeen) } + 1 : 0 | |
} | |
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { | |
println it.module.id.toString() + ' -> ' + cardinality(it, [] as Set) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment