Skip to content

ADFA-4907 | Standardize plugin toolchain: compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, Gradle 8.14.3 - #54

Merged
hal-eisen-adfa merged 6 commits into
mainfrom
ADFA-4907-compilesdk-36
Aug 7, 2026
Merged

ADFA-4907 | Standardize plugin toolchain: compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, Gradle 8.14.3#54
hal-eisen-adfa merged 6 commits into
mainfrom
ADFA-4907-compilesdk-36

Conversation

@hal-eisen-adfa

@hal-eisen-adfa hal-eisen-adfa commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What

Standardizes the build toolchain across all 25 example plugins, closing ADFA-4907.

Because these plugins are being built with Code On The Go itself (see ADFA-4693), the standard is pinned to CoGo's on-device toolchain — verified on an emulator (CoGo build C-d-0727-1613):

Bit Standard Why
compileSdk / targetSdk 36 CoGo's SDK ships only android-36
AGP 8.11.0 the only AGP in CoGo's Gradle caches
Gradle wrapper 8.14.3 CoGo's Gradle (and the shared root wrapper)
Kotlin 2.3.0 repo majority (22/25); CoGo doesn't pin Kotlin
Java / jvmTarget 17 (unchanged) already uniform

Changes

  • compileSdk & targetSdk → 36 in 22 plugins (the 3 template installers were already 36).
  • AGP → 8.11.0 in 5: ai-assistant, ai-core (from 8.13.2 — intentional downgrade to match CoGo); client-time-tracker, compose-preview, layout-editor (from 8.8.2).
  • Kotlin → 2.3.0 in flutter-template, pebble-custom-function-template-installer, template-manager (from 2.1.0).
  • Gradle wrapper → 8.14.3 in 5: ai-assistant, ai-core (from 8.14.4); client-time-tracker, compose-preview, layout-editor (from 8.10.2).
  • template-manager: migrated the deprecated kotlinOptions.jvmTarget = "17" string DSL to kotlin { compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } } — Kotlin 2.3.0 turns the old form into a hard error.

All values are plain literals (no version catalog).

Verification

  • Built every plugin with ../gradlew assemblePluginDebug. 20/25 build clean.
  • 5 fail with pre-existing errors, unrelated to this change (confirmed: they fail identically with these edits stashed). They reference newer API symbols absent from the committed libs/plugin-api.jar — a stale-libs issue, out of scope here:
    • ai-assistant, ai-core, speech-to-text-plugin → LlmInferenceService
    • code-suggestions-plugin → EditorContentChangeListener
    • vector-search-plugin → ProjectSearchExtension
  • Re-surveyed all 25: every plugin now reports compileSdk=36, targetSdk=36, AGP=8.11.0, Kotlin=2.3.0, Gradle=8.14.3, Java=17.

Scope notes

  • Does not address ADFA-4908 (shared libs/ path not resolving inside CoGo) — that's a separate structural issue. The 5 stale-libs failures above are adjacent to that libs work but distinct from this version-standardization.

…P 8.11.0, Kotlin 2.3.0, Gradle 8.14.3

Aligns all 25 example plugins with Code On The Go's on-device build toolchain
(verified on device: CoGo ships only android-36, AGP 8.11.0, Gradle 8.14.3;
does not pin Kotlin). Relevant because plugins are being built with CoGo itself
(ADFA-4693).

- compileSdk & targetSdk -> 36 (22 plugins; 3 template installers already 36)
- AGP -> 8.11.0 (ai-assistant, ai-core from 8.13.2; client-time-tracker,
  compose-preview, layout-editor from 8.8.2 -- downgrades intentional, match CoGo)
- Kotlin -> 2.3.0 (flutter-template, pebble, template-manager from 2.1.0)
- Gradle wrapper -> 8.14.3 (ai-assistant, ai-core from 8.14.4; client-time-tracker,
  compose-preview, layout-editor from 8.10.2)
- template-manager: migrate deprecated kotlinOptions.jvmTarget string DSL to
  compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } (required by Kotlin 2.3.0)

Java/jvmTarget already uniform at 17. 20/25 plugins build clean. 5 (ai-assistant,
ai-core, code-suggestions-plugin, speech-to-text-plugin, vector-search-plugin)
fail with pre-existing unresolved-reference errors (stale libs/plugin-api.jar,
missing newer API symbols) -- verified failing at baseline before this change,
out of scope here.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Resolves conflicts in ai-assistant/build.gradle.kts and
ai-core/build.gradle.kts. Both were the same adjacent-line collision:

  this branch: targetSdk 34 -> 36   (the point of ADFA-4907)
  main:        versionCode 1 -> 2, versionName 1.0.0 -> 1.1.0
               (#49, #50, #58)

Neither side touched the other's lines, so both changes are kept:
targetSdk = 36, versionCode = 2, versionName = "1.1.0".

Verified the merged build files differ from origin/main only in
compileSdk and targetSdk (34 -> 36), so all of main's work on these
two plugins is preserved.
Two plugins landed on main after this branch was cut, so they were never
standardized:

- project-to-template (#56): compileSdk/targetSdk 34 -> 36
- get-ai-models (#55):       Kotlin 2.1.0 -> 2.3.0

Both get-ai-models and template-manager pin Kotlin twice: the
kotlin-gradle-plugin classpath in settings.gradle.kts, and `kotlin` in
gradle/libs.versions.toml, which drives libs.kotlin.stdlib. The catalog
comment states the two must match, so both were bumped.

That surfaced a defect in this branch: it had already bumped
template-manager's classpath to 2.3.0 but left its catalog at 2.1.0, so
the compiler and stdlib disagreed. Fixed here.

Verified: all 27 plugins now report compileSdk/targetSdk 36, AGP 8.11.0,
Kotlin 2.3.0, with no catalog left at an older pin. All four affected
plugins build assemblePlugin successfully; kotlin-stdlib resolves to
2.3.0 in get-ai-models and template-manager, and the packaged manifests
of project-to-template and get-ai-models report targetSdkVersion=36.
Adds scripts/check-toolchain.sh and a pull_request-triggered workflow that
fails the build when any Gradle module drifts off the ADFA-4907 standard
(compileSdk/targetSdk 36, AGP 8.11.0, Kotlin 2.3.0, Gradle 8.14.3-bin,
Java 17).

Until now nothing enforced this. Both existing workflows are
workflow_dispatch-only, so a PR could move any of these values with zero CI
signal — which is how origin/main still carries compileSdk 33/34/35, AGP
8.8.2/8.13.2 and Gradle 8.10.2. The check is pure text inspection (no JDK,
no Gradle, no network), so it runs in seconds and is cheap to require.

It walks every build.gradle.kts, including subprojects. The earlier sweep
enumerated only top-level plugin folders, which is why ai-core/llama-impl
kept compileSdk = 34 through a dedicated standardization pass.

Files under src/main/assets/ are excluded: those are project templates that
Code On The Go stamps out for the user's own app, not our builds.

minSdk is deliberately not checked — it legitimately varies (21 template
installers, 26 most, 28 Beepy/sketch-to-ui, 33 the AI plugins).

Also fixes the nine violations the check found, so it lands green:
  * kotlin-stdlib pinned behind the Kotlin plugin -> 2.3.0
    (flutter-template, bookshelf, ndk-installer-plugin, cotg-ndk, pebble)
  * ai-core/llama-impl compileSdk 34 -> 36
  * ai-assistant + ai-core wrapper -all.zip -> -bin.zip
  * ai-core catalog agp "8.13.2" -> "8.11.0" (contradicted settings.gradle.kts)
Collapses the nine copy-pasted "extract, compare, report" blocks into two
helpers (check_value for first-match keys, check_every for all-match keys),
plus small file_matches/reject/module_of helpers.

That duplication had already caused a real defect: four of the nine copies
omitted the --list echo, so --list silently under-reported the
compose-compiler pin, the wrapper bin/all flavor, and both catalog entries.
Recording the value is now part of the helper, so it cannot be forgotten.
--list goes from 5 fact types / 134 lines to 9 / 164, sorted by module
instead of grouped by internal scan order.

Also:
  * One matching idiom. The header claimed grep|sed was avoided for BSD sed
    portability, then the kotlin-stdlib check used exactly that. Everything
    is bash =~ now, so the claim is true and no subprocesses are spawned.
  * One find traversal with a case dispatch instead of four full walks of
    the 12.8k-entry tree. Runtime 1.02s -> 0.38s.
  * Documents why discovery is deliberately broader than plugin_dirs() in
    .githooks/pre-push, so a future "DRY win" does not silently drop
    ai-core/llama-api and llama-impl from coverage.
  * Narrows the --list usage text, which overstated what it prints.
  * Workflow header no longer restates the version numbers (third copy).

Deliberately NOT changed: no declarative rules table (four of the checks
have genuinely different shapes and a table would gut the failure-message
hints), and the standard stays a set of literal constants rather than being
derived from the root wrapper -- deriving it would make a wrong root wrapper
undetectable.
The toolchain check enforces compileSdk/AGP/Kotlin/Gradle/Java, but every
other library version is unchecked, and the AI plugins had drifted as a
group -- all four kotlinx-coroutines 1.7.3 pins in the repo were AI plugins,
against a repo majority of 1.8.1.

Library alignments (all upgrades to the repo majority):
  * kotlinx-coroutines 1.7.3 -> 1.8.1 in ai-core, code-suggestions-plugin,
    speech-to-text-plugin, vector-search-plugin; -test 1.7.3 -> 1.8.1 in
    ai-assistant; get-ai-models catalog 1.6.4 -> 1.8.1 (was the oldest pin
    in the repo)
  * androidx.lifecycle 2.6.2 -> 2.8.7 in code-suggestions-plugin,
    speech-to-text-plugin and the get-ai-models catalog, matching
    client-time-tracker / compose-preview / sketch-to-ui
  * ai-assistant fragment-ktx 1.6.2 -> 1.8.8. This was the only 1.6.2 in the
    repo against 17 modules on 1.8.8, and the comment directly above it
    claimed the block matched random-xkcd, sketch-to-ui-plugin and Beepy --
    all three of which are on 1.8.8. The comment is now true.
  * ai-assistant org.json 20231013 -> 20240303

Deliberately NOT changed: coordinates where the AI plugins are merely AHEAD
of the majority (get-ai-models material 1.12.0, ai-literacy webkit 1.11.0,
llama-impl slf4j 2.0.12). Being ahead is not a defect, and downgrading
carries real risk for no gain.

ai-core/gradle/libs.versions.toml: pruned 334 lines -> 40.

It was copied wholesale from the CodeOnTheGo app repo and declared 281
entries of which exactly 4 were ever referenced (98.6% dead). The dead bulk
had drifted into self-contradiction -- androidx.core:core-ktx declared at
three different versions, appcompat at two, gson at two, plus a malformed
ksp = "2.3.6" and typo'd keys ("anroidx"). That is not inert: it is the
number the next person greps for.

While pruning, the two surviving aliases that encoded their version in the
NAME (androidx-core-ktx-v1120, androidx-appcompat-v171) were renamed to
version-neutral names, since such a name lies the moment the version moves.
Call sites in llama-impl updated to match.

The catalog also resolved two real conflicts inside a single Gradle build:
appcompat was 1.7.1 there while ai-core/build.gradle.kts pinned 1.6.1, and
llama-api pulled coroutines-core 1.10.2 while ai-core pulled
coroutines-android 1.8.1 -- the coroutines artifacts are released as a set
and must not be split.

Verified: all six changed AI plugins build assemblePluginDebug clean and
emit a .cgp. Resolved classpaths confirm coroutines is now uniformly 1.8.1
in ai-core (previously split), lifecycle 2.8.7, fragment-ktx 1.8.8. The
renamed catalog aliases were verified by forcing llama-api/llama-impl into
the build, with a negative control proving an unknown alias fails loudly.
@hal-eisen-adfa
hal-eisen-adfa merged commit bd38a86 into main Aug 7, 2026
1 check passed
@hal-eisen-adfa
hal-eisen-adfa deleted the ADFA-4907-compilesdk-36 branch August 7, 2026 21:47
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