Skip to content

ADFA-6246 | Move the plugins to AGP 9.3.1 / Gradle 9.6.1 / Kotlin 2.3.21 - #108

Merged
Daniel-ADFA merged 5 commits into
mainfrom
fix/ADFA-6246-plugin-toolchain-agp9
Sep 25, 2026
Merged

Daniel-ADFA merged 5 commits into
mainfrom
fix/ADFA-6246-plugin-toolchain-agp9

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

ADFA-6246

Moves every plugin onto the toolchain Code On the Go ships: AGP 9.3.1, Gradle 9.6.1, Kotlin 2.3.21. scripts/check-toolchain.sh carries the new standard and gates it.

AGP 9 compiles Kotlin itself and refuses org.jetbrains.kotlin.android, so that plugin is gone from every module and Kotlin is pinned on the buildscript classpath instead.

Three things needed more than a version bump:

  • Gradle 9 turns an undeclared task dependency into an error. AI-Literacy-Course and NDK-Installer download into src/main/assets, and more than one task reads it — ordering mergeAssets alone just moved the failure to the lint model task.
  • litert-support:1.0.1 is an alias AAR with no classes whose manifest duplicates litert-support-api's namespace, which AGP 9 rejects. Sketch-to-UI now depends on the artifact that actually holds the classes.
  • Project-to-Template emitted kotlin("android") version ... into every template it generates, so the breakage landed on the user's generated project, not here. It now drops the line and pins KGP on the generated root buildscript. Regression test added; reverting the fix fails it.

PCFBuilder/PCFExample converted the same way ADFA-6180 did the NDK template. PCFBuilder's root build was pinning AGP 8.10.1 / Kotlin 2.0.21 through a hand-written catalog; it is now a .peb on AGP_VERSION, so it tracks the host.

Verified: assemblePlugin green for all 29 modules addons discover --include-skipped builds — cotg-ndk included — plus the pebble installer, which skip.txt holds out of that list. Project-to-Template's unit tests pass.

Review by commit: the first is mechanical, the rest are one behavioural change each.

….1 / Kotlin 2.3.21

Code On the Go ships AGP 9.3.1, Gradle 9.6.1 and Kotlin 2.3.21
(org.adfa.constants), so the standard these plugins track moves with it.
scripts/check-toolchain.sh holds the numbers and gates every PR; its header is
re-grounded on CoGo stage c263653bcf.

AGP 9 compiles Kotlin itself and refuses org.jetbrains.kotlin.android, so that
plugin is dropped from every module and Kotlin is pinned on the buildscript
classpath in settings.gradle.kts instead, which is where AGP 9 takes its
compiler from.

The check also skips the gitignored .cache/ clone that update-libs.sh creates.
CI never sees it, but locally it reported dozens of failures against a tree
that is not ours to hold to this standard.
…Gradle 9

Gradle 9 turns an undeclared task dependency into a hard error. AI-Literacy-Course
and NDK-Installer download their archives into src/main/assets, which more than one
task then reads, so ordering only mergeAssets after the download moves the failure
to the next consumer rather than fixing it -- the lint model task reads the same
directory. Order every other task after the producers instead.

mustRunAfter, not dependsOn: a bare assemblePlugin must keep failing loudly on a
missing archive rather than quietly fetching 110 MB, which is the behaviour the
guard below it exists to enforce.

Sketch-to-UI: litert-support:1.0.1 is a 587-byte alias AAR with no classes whose
manifest declares the same namespace as litert-support-api, and AGP 9 fails the
manifest merge on the duplicate. Depend on litert-support-api, which carries all
75 classes.
The same conversion ADFA-6180 made to the NDK template. PCFExample dropped the
kotlin("android") plugin request AGP 9 refuses, pins the Kotlin stdlib to
KOTLIN_VERSION rather than 1.9.22, and moves jvmTarget off the removed
kotlinOptions DSL.

PCFBuilder's root build was the older shape: a version catalog pinning AGP 8.10.1
and Kotlin 2.0.21 by hand, neither tracking the host. It becomes a .peb on
AGP_VERSION like every other template, so it follows Code On the Go instead of
drifting, and the catalog -- referenced by nothing once the plugin aliases are
gone -- is deleted rather than left as a stale number to grep.

Its wrapper also pinned Gradle 8.11.1 literally; it now takes GRADLE_VERSION.
Project-to-Template rewrote the user's Kotlin plugin line as
kotlin("android") version "${{KOTLIN_VERSION}}", so every template it produced
declared the one plugin AGP 9 refuses. The build stayed green here and broke in
the user's hands, on the generated project.

Drop the line instead, and pin the Kotlin Gradle plugin on the generated root
build's buildscript classpath, matching the core templates and what ADFA-6180
did to the NDK one. The LANGUAGE conditional went with it: it only ever wrapped
that plugin line.

The test asserts on generated file contents, which needs the real org.json --
the android.jar stub returns null under isReturnDefaultValues, which is why the
existing test only exercises the dry-run path. Reverting the fix fails the new
test on exactly its kotlin("android") assertion.
CLAUDE.md still told plugin authors to apply org.jetbrains.kotlin.android, which
AGP 9 rejects outright.
@Daniel-ADFA
Daniel-ADFA merged commit 7dc1b50 into main Sep 25, 2026
1 check passed
@Daniel-ADFA
Daniel-ADFA deleted the fix/ADFA-6246-plugin-toolchain-agp9 branch September 25, 2026 14:03
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.

3 participants