Skip to content

Instantly share code, notes, and snippets.

@abesto
Created July 24, 2015 14:06
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save abesto/cdcdd38263eacf1cbb51 to your computer and use it in GitHub Desktop.
Save abesto/cdcdd38263eacf1cbb51 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"
}
}
@tzachz
Copy link

tzachz commented Nov 17, 2016

👍 thanks, that was helpful!

@tzachz
Copy link

tzachz commented Nov 17, 2016

FWIW - a modified version that supports deeply-nested projects: https://gist.github.com/tzachz/419478fc8b009e953f5e5dc39f3f3a2a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment