Skip to content

Gradle plugin that reads the Gradle dependencies of a given Gradle project, and generates a dependency tree.

License

Notifications You must be signed in to change notification settings

jfrog/gradle-dep-tree

Repository files navigation

Scanned by Frogbot Test

🐘 Gradle Dependency Tree

This Gradle plugin reads the Gradle dependencies of a given Gradle project, and generates a dependency tree. This package was developed by JFrog, and is used by the JFrog IntelliJ IDEA Plugin to generate the dependency tree for projects using Gradle dependencies. You may find this plugin useful for other purposes and applications as well, by applying it in your build.gradle file.

🖥️ Usage

Inject the plugin using the init.gradle initialization script, and run generateDepTrees in a directory containing a build.gradle file. The plugin will generate a dependency tree for each subproject that does not contain a build.gradle file. To generate a dependency tree for each subproject that contains a Gradle build file, set the -Dcom.jfrog.includeAllBuildFiles flag to true.

The command:

gradle clean generateDepTrees -I <path/to/init.gradle> -q -Dcom.jfrog.depsTreeOutputFile=<path/to/output/file>

Output:

"<path/to/dependency/tree1>"
"<path/to/dependency/tree2>"
...

🌲 Output Tree Structure

{
  "root": "org.jfrog.example.gradle:shared:1.0-SNAPSHOT",
  "nodes": {
    "junit:junit:4.7": {
      "unresolved": false,
      "configurations": ["testCompileClasspath", "testImplementation", "testRuntimeClasspath"],
      "children": []
    },
    "org.jfrog.example.gradle:shared:1.0-SNAPSHOT": {
      "unresolved": false,
      "configurations": ["compileClasspath", "runtimeClasspath", "testCompileClasspath", "testRuntimeClasspath"],
      "children": ["junit:junit:4.7"]
    }
  }
}

💻 Contributions

We welcome pull requests from the community. To help us improve this project, please read our contribution guide.