Skip to content

Instantly share code, notes, and snippets.

@hitme
Forked from abesto/dependency-report.gradle
Last active January 25, 2018 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitme/9b8ee964b7f8dc34676a2cbe072ac4ec to your computer and use it in GitHub Desktop.
Save hitme/9b8ee964b7f8dc34676a2cbe072ac4ec to your computer and use it in GitHub Desktop.
Gradle: multi-project dependency graph
task dependencyReport {
doLast {
def file = new File("project-dependencies.dot")
file.delete()
file << "digraph {\n"
file << "splines=ortho\n"
allprojects.each { item ->
def from = item
from.configurations.compile.dependencies
.matching { it in ProjectDependency }
.each { to -> file << ("\"${from.name}\" -> \"${to.name}\"\n")}
}
file << "}\n"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment