Skip to content

build: pin Gradle daemon to JDK 21, add ROADMAP.md - #50

Open
JMAN730 wants to merge 2 commits into
mainfrom
claude/new-session-856enf
Open

build: pin Gradle daemon to JDK 21, add ROADMAP.md#50
JMAN730 wants to merge 2 commits into
mainfrom
claude/new-session-856enf

Conversation

@JMAN730

@JMAN730 JMAN730 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

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 25 when running ./gradlew, and had to switch JAVA_HOME down 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 / targetCompatibility VERSION_21, jvmTarget '21', jvmToolchain(21)
  • .github/workflows/android-ci.yml: all three jobs use temurin 21

Changes:

  • Add gradle/gradle-daemon-jvm.properties with toolchainVersion=21, so Gradle selects an installed JDK 21 for the daemon regardless of what JAVA_HOME points at. No more manual switching.
  • Correct README.md and docs/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, deprecated kotlinOptions / packagingOptions, plus AGP 9 breaking changes). That belongs in its own PR — it is recorded in the roadmap below.

2. Add ROADMAP.md

Records 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 36 before 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.
  • Placeholder expectedSize values at app/src/main/java/com/opendroid/ai/core/llm/OnDeviceModelRegistry.kt:132 and :146 (marked TODO, 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 androidTest source set) — so later drift is visible.

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

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.

  • Test Configuration: Linux x64, JDK 21.0.10 (Temurin/Ubuntu), Gradle 8.10.2 wrapper.
  • Manual Verification steps:
    1. Ran ./gradlew --version before the change → Daemon JVM: /usr/lib/jvm/java-21-openjdk-amd64 (no JDK specified, using current Java home).
    2. Ran ./gradlew --version after 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.
    3. CI passed all three Gradle jobs with the criteria file in place (testDebugUnitTest + assembleDebug, lintDebug, unsigned assembleRelease), confirming it does not disturb daemon startup or toolchain resolution in a clean environment.
    4. A full Android build could not be run locally: dl.google.com is blocked by the sandbox network policy, so AGP and the AndroidX artifacts fail to resolve. CI is the validation path.
    5. Not verified: behavior with JDK 25 as JAVA_HOME. No JDK 25 could be installed in this environment (api.adoptium.net is 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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new build errors or warnings
  • I have updated the documentation in the docs/ folder (if applicable)

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
@JMAN730
JMAN730 marked this pull request as ready for review July 30, 2026 16:40
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe 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 toolchainVersion=21 key is the exact format shown in the Gradle 8.10.2 official docs, and the wrapper confirms the project is on 8.10.2. No build logic, Kotlin source, or CI workflow is modified, so there is nothing that could regress a build that was already passing.

Files Needing Attention: No files require special attention.

Important Files Changed

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]
Loading

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
@JMAN730 JMAN730 changed the title build: pin Gradle daemon to JDK 21 build: pin Gradle daemon to JDK 21, add ROADMAP.md Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants