Gradle
Status
Section titled “Status”Version: 1.2.0 | Tests: Passing
{
"features": {
"ghcr.io/infrashift/trusted-devcontainer-features/gradle:latest": {
"target_version": "9.8.2"
}
}
} Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
target_version | string | 9.8.2 | Select a supported Gradle version |
target_checksum | string | "" | SHA256 of gradle-<version>-bin.zip. Required only when target_version is not pinned in the role's _gradle_pinned_checksums map. |
Dependencies
Section titled “Dependencies”How It Works
Section titled “How It Works”This feature installs Gradle as gradle. The Ansible role downloads the binary-only distribution (gradle-<version>-bin.zip) from services.gradle.org and verifies it against a pinned SHA256, or against an explicit target_checksum if one is provided; Gradle publishes a .sha256 next to every distribution, which is where the pins come from. Gradle is pure Java, so one digest per version covers both architectures. Version strings may be X.Y (8.14) or X.Y.Z (9.7.1), matching how Gradle numbers releases and patches.
The distribution lands under a version-scoped prefix, ~/.local/share/gradle/gradle-<version>/, and gradle is symlinked into ~/.local/bin, which the base image already puts on PATH. The launcher resolves that symlink to find its own home, so no GRADLE_HOME and no containerEnv entry is needed. The prefix doubles as the idempotency probe: if it already holds bin/gradle, the download is skipped and a re-run reports no change. GRADLE_USER_HOME stays at its default, ~/.gradle, and projects that ship a Gradle wrapper keep using the wrapper’s own pinned distribution.
Gradle cannot run without a JDK. The feature declares installsAfter openjdk for ordering only; it does not force openjdk in, so a system JDK on PATH works too. Because the feature runner’s userland lane does not carry openjdk’s containerEnv, the role points JAVA_HOME at ~/.local/share/java when that feature’s JDK is present, then verifies the install by running gradle --version and matching the requested version as a whole line.