
Visualize Gradle dependency reports as interactive graphs and trees, uploading JSON or text reports; interactive graph/tree viewers, search and filters, stateless server, CLI and Docker deployment.
Visualize Gradle dependency reports as interactive graphs and trees. Upload a JSON graph exported by the Gradle plugin or a text report from the Gradle dependencies task.
The backend uses Kotlin and Ktor. The parser, filters, graph conversion, summaries and dependency export live in the core Kotlin Multiplatform module, using the Kotlin standard library and kotlinx.serialization. The frontend uses static JavaScript, CSS and D3 7.9.0.
To start the server from source:
./gradlew :server:runAccess the UI at http://127.0.0.1:8000.
Add Maven Central to the plugin repositories in your project's settings.gradle.kts:
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}Apply the plugin in the module you want to inspect:
plugins {
id("com.fajarnuha.gradle-graph") version "0.1.11"
}When upgrading from 0.1.10, replace the plugin ID com.fajarnuha.dependency-graph with com.fajarnuha.gradle-graph.
To use a local checkout, add includeBuild("../gradle-graph") to
pluginManagement and omit the version from the plugin declaration.
The plugin is built against the Gradle 9.6.0 API and requires JDK 17 or later.
./gradlew :app:exportDependencyGraph -PdependencyGraphConfiguration=debugRuntimeClasspathUpload app/build/reports/dependency-graph/debugRuntimeClasspath.json. The task defaults to
runtimeClasspath when you omit the property. It resolves one configuration without compiling
the app. If a dependency fails to resolve, the task fails and leaves any previous export intact.
The version 1 JSON includes the project path, configuration, root ID, selected variant nodes, and dependency edges with their requested selectors and constraint flags. The node IDs are opaque and local to the report.
To try the included Android sample, install Android SDK Platform 36, then run this command from the viewer repository root:
./gradlew -p samples/android :app:exportDependencyGraph -PdependencyGraphConfiguration=debugRuntimeClasspathUpload samples/android/app/build/reports/dependency-graph/debugRuntimeClasspath.json.
The graph shows that :app depends on :shared directly and through :feature.
You can also build the demo APK with ./gradlew -p samples/android :app:assembleDebug.
Run the following command in your Gradle project root to generate a text file of your dependencies.
Note: The configuration name (e.g., debugRuntimeClasspath) varies depending on your project's build variants and flavors. Check your available configurations by running ./gradlew app:dependencies without arguments first to decide which one you want to visualize.
./gradlew app:dependencies --configuration debugRuntimeClasspath > my_app.txt.json or .txt file.app/static/sample/.sessionStorage.androidx or :module-name, and highlight their connections.core/: Kotlin Multiplatform logic and shared tests, targeting JVM and JavaScript.gradle-plugin/: Gradle task for exporting resolved dependency graphs.samples/android/: Independent Android build that exercises the exporter.server/: Ktor server, JVM file and charset handling, CLI and server tests.app/: Static frontend, HTML templates and bundled JSON samples, packaged as server resources.tests/: Python tests for Chromium browser flows, accessibility, screenshots, Jenkins automation and the release script. These run against the Kotlin distribution in CI.jenkins/ and scripts/: Python standard-library automation for sample generation and releases. Dependency parsing uses the Kotlin CLI../gradlew :core:allTests :server:test :server:installDist :gradle-plugin:testTo run the browser and automation tests after building the distribution:
uv sync --frozen --dev
uv run playwright install chromium
uv run pytestThe shared core logic and tests live in commonMain and commonTest. JavaScript is a core test target; the frontend is maintained separately in app/. pyproject.toml and uv.lock manage test dependencies only.
The installed distribution can run the server or the CLI, without Gradle:
server/build/install/gradle-graph/bin/gradle-graph
server/build/install/gradle-graph/bin/gradle-graph parse my_app.txt --output my_app.json
server/build/install/gradle-graph/bin/gradle-graph tree my_app.json --filter androidx --output filtered.json
server/build/install/gradle-graph/bin/gradle-graph tree my_app.json --project-only
server/build/install/gradle-graph/bin/gradle-graph graph my_app.json --distance 2 --exclude kotlin --output graph.json
server/build/install/gradle-graph/bin/gradle-graph enlist my_app.json --output dependencies.yamlCLI commands print to stdout unless --output is supplied. summary FILE prints entry counts and validated sample metadata as JSON.
docker build -t gradle-graph .
docker run --rm -p 8000:8000 gradle-graphDocker builds and tests the JVM code, then copies the installed distribution into a Temurin 21 JRE image. It runs as UID 10001 and checks /healthz. Static assets and samples are packaged in the application resources. The server remains stateless and needs no data volume.
The server accepts these environment variables:
| Variable | Default | Purpose |
|---|---|---|
PORT |
8000 |
HTTP port |
HOST |
0.0.0.0 |
Listen address |
JAVA_OPTS |
-XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError in Docker |
JVM options; adjust alongside the container memory limit |
Rebuild and restart after changing bundled samples or frontend files. CSS and JS URLs include content hashes for cache invalidation. Ktor uses a 50 MiB multipart file limit; for larger reports, adjust receiveMultipart in server/src/main/kotlin/dev/gradleviewer/Main.kt and the reverse proxy upload limit together. The Docker host needs no Java or Python installation.
The deployment workflow runs on v* tags. It tests the Kotlin JVM code, publishes the image to GHCR, replaces the production container over SSH and waits for it to become healthy. Configure SSH_HOST, SSH_USERNAME and SSH_KEY in GitHub Actions secrets; registry access uses GITHUB_TOKEN.
Run ./gradlew bumpVersion from the repository root for a minor release. Pass --bump=major, --bump=minor, or --bump=patch to choose the version component. The task requires a clean Git working tree and a successful server build before updating gradle.properties. It commits the version bump, tags it, and pushes the current branch and the new tag. Pushing the tag triggers production deployment.
jenkins/generate-sample.Jenkinsfile turns a public GitHub Android repository into a new sample in app/static/sample/ and opens a pull request with it. It checks out the commit with git (without history, since some builds run git while Gradle configures them), checks that it is a Gradle project with a wrapper, works out the Gradle command to run (or takes it from GRADLE_COMMAND), runs it, converts the output to JSON, and deletes the downloaded project when it finishes. The sample's meta entry records the source repository and commit, and the app's launcher icon (a PNG or WebP bitmap from the app module, when it has one); the home page shows them with the sample. A new dump of a project replaces that project's older sample.
To set it up, create a Pipeline job ("Pipeline script from SCM") on this repository with the script path jenkins/generate-sample.Jenkinsfile, and add a "Username with password" credential with the ID github-credentials whose password is a GitHub token that can push branches and open pull requests (a non-dry run checks this before anything else runs). The job runs on the agent labelled self (an x86 machine), which needs git, python3, a JDK (21 or newer) and the Antigravity CLI at /home/fajar/.local/bin/agy (the AGY variable in the Jenkinsfile), signed in for non-interactive use. Gradle runs directly on the agent, without Docker; the Android SDK is optional, because recent Android Gradle plugins can dump dependencies without it. Building a downloaded project runs its code as the Jenkins user, so use an agent you are comfortable running untrusted builds on.
| Parameter | Default | Purpose |
|---|---|---|
REPO_URL |
e.g. https://github.com/android/architecture-samples
|
|
GIT_REF |
HEAD |
Branch, tag or commit |
SAMPLE_NAME |
repository name | Name shown on the home page |
GRADLE_COMMAND |
worked out from the Gradle files | Command whose output becomes the sample, e.g. ./gradlew app:dependencies --configuration debugRuntimeClasspath. It must start with ./gradlew and runs without a shell, so no redirects or pipes |
BASE_BRANCH |
main |
Branch the pull request targets |
CACHE_GRADLE |
true |
Keep Gradle's downloads on the agent between builds |
DRY_RUN |
false |
Only build and archive the JSON |
With CACHE_GRADLE on, the Gradle distribution and dependencies stay in ~/.cache/gradle-graph/gradle on the agent, so only the first build of a project downloads everything. Builds run one at a time because they share that cache. To start over, delete that directory on the agent.
When GRADLE_COMMAND is blank, the job sends the project's Gradle files (settings.gradle(.kts), build.gradle(.kts), gradle.properties) to the Antigravity CLI and asks which module and debug runtime classpath configuration to dump, so no Gradle run is needed to find them. The CLI gets no tools and cannot run commands; its answer must still be a ./gradlew command or the build fails. If it answers UNKNOWN, the build stops and names the reason, and you can re-run it with GRADLE_COMMAND set.
The orchestration steps are in jenkins/generate_sample.py and use the Python standard library. The pipeline builds the Kotlin CLI for parsing and summaries. Build it with ./gradlew :server:installDist before running convert or open-pr locally, or set VIEWER_CLI to another installed distribution. Repository inspection works directly, for example python3 jenkins/generate_sample.py validate path/to/project.
Visualize Gradle dependency reports as interactive graphs and trees. Upload a JSON graph exported by the Gradle plugin or a text report from the Gradle dependencies task.
The backend uses Kotlin and Ktor. The parser, filters, graph conversion, summaries and dependency export live in the core Kotlin Multiplatform module, using the Kotlin standard library and kotlinx.serialization. The frontend uses static JavaScript, CSS and D3 7.9.0.
To start the server from source:
./gradlew :server:runAccess the UI at http://127.0.0.1:8000.
Add Maven Central to the plugin repositories in your project's settings.gradle.kts:
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}Apply the plugin in the module you want to inspect:
plugins {
id("com.fajarnuha.gradle-graph") version "0.1.11"
}When upgrading from 0.1.10, replace the plugin ID com.fajarnuha.dependency-graph with com.fajarnuha.gradle-graph.
To use a local checkout, add includeBuild("../gradle-graph") to
pluginManagement and omit the version from the plugin declaration.
The plugin is built against the Gradle 9.6.0 API and requires JDK 17 or later.
./gradlew :app:exportDependencyGraph -PdependencyGraphConfiguration=debugRuntimeClasspathUpload app/build/reports/dependency-graph/debugRuntimeClasspath.json. The task defaults to
runtimeClasspath when you omit the property. It resolves one configuration without compiling
the app. If a dependency fails to resolve, the task fails and leaves any previous export intact.
The version 1 JSON includes the project path, configuration, root ID, selected variant nodes, and dependency edges with their requested selectors and constraint flags. The node IDs are opaque and local to the report.
To try the included Android sample, install Android SDK Platform 36, then run this command from the viewer repository root:
./gradlew -p samples/android :app:exportDependencyGraph -PdependencyGraphConfiguration=debugRuntimeClasspathUpload samples/android/app/build/reports/dependency-graph/debugRuntimeClasspath.json.
The graph shows that :app depends on :shared directly and through :feature.
You can also build the demo APK with ./gradlew -p samples/android :app:assembleDebug.
Run the following command in your Gradle project root to generate a text file of your dependencies.
Note: The configuration name (e.g., debugRuntimeClasspath) varies depending on your project's build variants and flavors. Check your available configurations by running ./gradlew app:dependencies without arguments first to decide which one you want to visualize.
./gradlew app:dependencies --configuration debugRuntimeClasspath > my_app.txt.json or .txt file.app/static/sample/.sessionStorage.androidx or :module-name, and highlight their connections.core/: Kotlin Multiplatform logic and shared tests, targeting JVM and JavaScript.gradle-plugin/: Gradle task for exporting resolved dependency graphs.samples/android/: Independent Android build that exercises the exporter.server/: Ktor server, JVM file and charset handling, CLI and server tests.app/: Static frontend, HTML templates and bundled JSON samples, packaged as server resources.tests/: Python tests for Chromium browser flows, accessibility, screenshots, Jenkins automation and the release script. These run against the Kotlin distribution in CI.jenkins/ and scripts/: Python standard-library automation for sample generation and releases. Dependency parsing uses the Kotlin CLI../gradlew :core:allTests :server:test :server:installDist :gradle-plugin:testTo run the browser and automation tests after building the distribution:
uv sync --frozen --dev
uv run playwright install chromium
uv run pytestThe shared core logic and tests live in commonMain and commonTest. JavaScript is a core test target; the frontend is maintained separately in app/. pyproject.toml and uv.lock manage test dependencies only.
The installed distribution can run the server or the CLI, without Gradle:
server/build/install/gradle-graph/bin/gradle-graph
server/build/install/gradle-graph/bin/gradle-graph parse my_app.txt --output my_app.json
server/build/install/gradle-graph/bin/gradle-graph tree my_app.json --filter androidx --output filtered.json
server/build/install/gradle-graph/bin/gradle-graph tree my_app.json --project-only
server/build/install/gradle-graph/bin/gradle-graph graph my_app.json --distance 2 --exclude kotlin --output graph.json
server/build/install/gradle-graph/bin/gradle-graph enlist my_app.json --output dependencies.yamlCLI commands print to stdout unless --output is supplied. summary FILE prints entry counts and validated sample metadata as JSON.
docker build -t gradle-graph .
docker run --rm -p 8000:8000 gradle-graphDocker builds and tests the JVM code, then copies the installed distribution into a Temurin 21 JRE image. It runs as UID 10001 and checks /healthz. Static assets and samples are packaged in the application resources. The server remains stateless and needs no data volume.
The server accepts these environment variables:
| Variable | Default | Purpose |
|---|---|---|
PORT |
8000 |
HTTP port |
HOST |
0.0.0.0 |
Listen address |
JAVA_OPTS |
-XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError in Docker |
JVM options; adjust alongside the container memory limit |
Rebuild and restart after changing bundled samples or frontend files. CSS and JS URLs include content hashes for cache invalidation. Ktor uses a 50 MiB multipart file limit; for larger reports, adjust receiveMultipart in server/src/main/kotlin/dev/gradleviewer/Main.kt and the reverse proxy upload limit together. The Docker host needs no Java or Python installation.
The deployment workflow runs on v* tags. It tests the Kotlin JVM code, publishes the image to GHCR, replaces the production container over SSH and waits for it to become healthy. Configure SSH_HOST, SSH_USERNAME and SSH_KEY in GitHub Actions secrets; registry access uses GITHUB_TOKEN.
Run ./gradlew bumpVersion from the repository root for a minor release. Pass --bump=major, --bump=minor, or --bump=patch to choose the version component. The task requires a clean Git working tree and a successful server build before updating gradle.properties. It commits the version bump, tags it, and pushes the current branch and the new tag. Pushing the tag triggers production deployment.
jenkins/generate-sample.Jenkinsfile turns a public GitHub Android repository into a new sample in app/static/sample/ and opens a pull request with it. It checks out the commit with git (without history, since some builds run git while Gradle configures them), checks that it is a Gradle project with a wrapper, works out the Gradle command to run (or takes it from GRADLE_COMMAND), runs it, converts the output to JSON, and deletes the downloaded project when it finishes. The sample's meta entry records the source repository and commit, and the app's launcher icon (a PNG or WebP bitmap from the app module, when it has one); the home page shows them with the sample. A new dump of a project replaces that project's older sample.
To set it up, create a Pipeline job ("Pipeline script from SCM") on this repository with the script path jenkins/generate-sample.Jenkinsfile, and add a "Username with password" credential with the ID github-credentials whose password is a GitHub token that can push branches and open pull requests (a non-dry run checks this before anything else runs). The job runs on the agent labelled self (an x86 machine), which needs git, python3, a JDK (21 or newer) and the Antigravity CLI at /home/fajar/.local/bin/agy (the AGY variable in the Jenkinsfile), signed in for non-interactive use. Gradle runs directly on the agent, without Docker; the Android SDK is optional, because recent Android Gradle plugins can dump dependencies without it. Building a downloaded project runs its code as the Jenkins user, so use an agent you are comfortable running untrusted builds on.
| Parameter | Default | Purpose |
|---|---|---|
REPO_URL |
e.g. https://github.com/android/architecture-samples
|
|
GIT_REF |
HEAD |
Branch, tag or commit |
SAMPLE_NAME |
repository name | Name shown on the home page |
GRADLE_COMMAND |
worked out from the Gradle files | Command whose output becomes the sample, e.g. ./gradlew app:dependencies --configuration debugRuntimeClasspath. It must start with ./gradlew and runs without a shell, so no redirects or pipes |
BASE_BRANCH |
main |
Branch the pull request targets |
CACHE_GRADLE |
true |
Keep Gradle's downloads on the agent between builds |
DRY_RUN |
false |
Only build and archive the JSON |
With CACHE_GRADLE on, the Gradle distribution and dependencies stay in ~/.cache/gradle-graph/gradle on the agent, so only the first build of a project downloads everything. Builds run one at a time because they share that cache. To start over, delete that directory on the agent.
When GRADLE_COMMAND is blank, the job sends the project's Gradle files (settings.gradle(.kts), build.gradle(.kts), gradle.properties) to the Antigravity CLI and asks which module and debug runtime classpath configuration to dump, so no Gradle run is needed to find them. The CLI gets no tools and cannot run commands; its answer must still be a ./gradlew command or the build fails. If it answers UNKNOWN, the build stops and names the reason, and you can re-run it with GRADLE_COMMAND set.
The orchestration steps are in jenkins/generate_sample.py and use the Python standard library. The pipeline builds the Kotlin CLI for parsing and summaries. Build it with ./gradlew :server:installDist before running convert or open-pr locally, or set VIEWER_CLI to another installed distribution. Repository inspection works directly, for example python3 jenkins/generate_sample.py validate path/to/project.