Created
October 16, 2022 02:14
-
-
Save skhatri/cb27e77a8f7aff66225f535b4da09254 to your computer and use it in GitHub Desktop.
gradle dependency printer
This file contains hidden or 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
gradle.taskGraph.whenReady { tg -> | |
configurations.all { cf -> | |
if (cf.canBeResolved && cf.name == "runtimeClasspath") { | |
cf.incoming.each { p -> | |
println(p.name) | |
//resolved artifact dependency | |
p.artifacts.each { at -> | |
println(at.id.componentIdentifier) | |
} | |
//direct dependency | |
p.dependencies.each {dt -> | |
println(dt) | |
} | |
//dependency graph | |
p.resolutionResult.allDependencies {rr -> | |
println(rr.from) | |
println(rr.requested) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment