Skip to content

Instantly share code, notes, and snippets.

@obatiuk
Forked from abesto/dependency-report.gradle
Created November 22, 2017 19:29
Show Gist options
  • Save obatiuk/28f627df85c98db7e04d5f3eff79631b to your computer and use it in GitHub Desktop.
Save obatiuk/28f627df85c98db7e04d5f3eff79631b 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