Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thought-police-000/f72039c3a44405885687cfde335edbd1 to your computer and use it in GitHub Desktop.
Save thought-police-000/f72039c3a44405885687cfde335edbd1 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"
rootProject.childProjects.each { item ->
def from = item.value
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