build: pin Gradle daemon to JDK 21, add ROADMAP.md - #50
Conversation
Gradle 8.10.2 cannot run on JDK 24 or newer, so contributors on a recent JDK hit an incompatibility error and had to switch JAVA_HOME to 21 by hand before every build. The project already targets Java 21 everywhere (sourceCompatibility/targetCompatibility VERSION_21, jvmTarget '21', jvmToolchain(21), temurin 21 in CI), so 21 is the intended toolchain rather than a workaround. Add gradle/gradle-daemon-jvm.properties with toolchainVersion=21 so Gradle selects an installed JDK 21 for the daemon regardless of JAVA_HOME, and correct the docs that advertised "JDK 21+" - the upper bound is what made this look like a dependency-version problem. A JDK 21 must still be installed locally; Gradle 8.10.2 will not provision one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDrXUWWRzyiXNdm3oXwJwj
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Confidence Score: 5/5Safe to merge — no application code is changed; the new properties file uses the correct key and value for Gradle 8.10.2, and the documentation corrections are accurate. The change is a single-property configuration file plus documentation updates. The Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| gradle/gradle-daemon-jvm.properties | New file pinning the Gradle daemon JVM to Java 21 using toolchainVersion=21; format is correct for Gradle 8.10.2 per official docs. |
| README.md | Prerequisite corrected from "JDK 21+" to "JDK 21 exactly" with accurate rationale explaining the Gradle 8.10.2 / JDK 24+ incompatibility. |
| docs/development_guide.md | Same JDK version correction as README with additional note that Gradle will not auto-provision the JDK. |
| ROADMAP.md | New living document added tracking current project state and upcoming work; references PR #50 as open (will be stale on merge, but expected for a living doc). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([Developer runs ./gradlew]) --> B{gradle-daemon-jvm.properties\nexists?}
B -- No\n(before this PR) --> C[Use JAVA_HOME as daemon JVM]
C --> D{JAVA_HOME ≥ JDK 24?}
D -- Yes --> E[💥 'not compatible with Java 25'\nGradle 8.10.2 fails]
D -- No --> F[✅ Daemon starts]
B -- Yes\ntoolchainVersion=21\n(after this PR) --> G[Gradle toolchain resolver\nscans installed JVMs]
G --> H{JDK 21 found?}
H -- Yes --> I[✅ Daemon starts on JDK 21\nregardless of JAVA_HOME]
H -- No --> J[❌ Explicit error:\n'no matching Java installation'\nfor version 21]
Reviews (2): Last reviewed commit: "docs: add ROADMAP.md" | Re-trigger Greptile
Records where the project stands at 1.0.2 and what comes next, anchored to files and tickets rather than intentions so items can be picked up without re-deriving context. Near-term items are the two with real deadlines or correctness cost: targetSdk 36 before Google Play's 2026-08-31 cutoff (currently 35), and the placeholder expectedSize values in OnDeviceModelRegistry, which download integrity checks currently compare against. Also records current health metrics (lint baseline size, test counts, instrumentation coverage) so later drift is visible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDrXUWWRzyiXNdm3oXwJwj
Description
Two independent changes, both docs/build only — no app code is touched.
1. Pin the Gradle daemon to JDK 21
Contributors on a recent JDK hit
... is not compatible with Java 25when running./gradlew, and had to switchJAVA_HOMEdown to 21 by hand before every build. Gradle 8.10.2 cannot run on JDK 24 or newer — Gradle 9.1.0 is the first release that supports Java 25 — so this is a local-JDK problem, not a change in any package or plugin version.Java 21 is already the intended toolchain across the project:
app/build.gradle:sourceCompatibility/targetCompatibilityVERSION_21,jvmTarget '21',jvmToolchain(21).github/workflows/android-ci.yml: all three jobs use temurin 21Changes:
gradle/gradle-daemon-jvm.propertieswithtoolchainVersion=21, so Gradle selects an installed JDK 21 for the daemon regardless of whatJAVA_HOMEpoints at. No more manual switching.README.mdanddocs/development_guide.md, which advertised "JDK 21+". The missing upper bound is what made this look like a dependency-version bug.A JDK 21 must still be installed locally — Gradle 8.10.2 will not provision one, so a machine with only JDK 25 now gets an explicit "no matching Java installation" error instead of a confusing incompatibility message.
Out of scope: building on JDK 25 natively would require Gradle 9.1+ and AGP 8.8.2 → 9.x, which is a real migration (removed Gradle 8 APIs such as
rootProject.buildDir, deprecatedkotlinOptions/packagingOptions, plus AGP 9 breaking changes). That belongs in its own PR — it is recorded in the roadmap below.2. Add
ROADMAP.mdRecords where the project stands at 1.0.2 and what comes next, anchored to specific files and tickets rather than intentions. Every claim in it is checked against the tree rather than assumed. The two near-term items that carry a deadline or a correctness cost:
targetSdk 36before 2026-08-31. Google Play requires Android 16 for new apps and updates from that date (extension available through 2026-11-01). The project targets 35.expectedSizevalues atapp/src/main/java/com/opendroid/ai/core/llm/OnDeviceModelRegistry.kt:132and:146(markedTODO, 2 GB / 4 GB). Download integrity checks compare against these, so the LiteRT-LM path currently verifies against invented numbers.It also snapshots health metrics — lint baseline size (49), unit-test classes (26), instrumentation tests (0, there is no
androidTestsource set) — so later drift is visible.Fixes # (issue)
Type of Change
How Has This Been Tested?
No app code changed, so there is nothing to verify on a device — the build change affects only which JVM runs the Gradle daemon, and the rest is documentation.
./gradlew --versionbefore the change →Daemon JVM: /usr/lib/jvm/java-21-openjdk-amd64 (no JDK specified, using current Java home)../gradlew --versionafter the change →Daemon JVM: Compatible with Java 21, any vendor (from gradle/gradle-daemon-jvm.properties), confirming Gradle 8.10.2 honors the criteria file.testDebugUnitTest+assembleDebug,lintDebug, unsignedassembleRelease), confirming it does not disturb daemon startup or toolchain resolution in a clean environment.dl.google.comis blocked by the sandbox network policy, so AGP and the AndroidX artifacts fail to resolve. CI is the validation path.JAVA_HOME. No JDK 25 could be installed in this environment (api.adoptium.netis also blocked), so the end-to-end "gradlew works while JAVA_HOME points at 25" path is unconfirmed and worth a check by whoever hit the original error.Checklist:
docs/folder (if applicable)