Skip to content

Upgrade Java, Kotlin, and AGP - #3292

Open
jaschdoc wants to merge 13 commits into
mainfrom
upgrade_kotlin_agp_versions
Open

jaschdoc wants to merge 13 commits into
mainfrom
upgrade_kotlin_agp_versions

Conversation

@jaschdoc

@jaschdoc jaschdoc commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@jaschdoc
jaschdoc force-pushed the upgrade_kotlin_agp_versions branch from fdd9d50 to 3fc0f60 Compare November 4, 2026 13:45
- Bump `distributionUrl` and `distributionSha256Sum` in
  `gradle/wrapper/gradle-wrapper.properties` to Gradle 9.8.2.
- Align `com.android.lint` in `gradle/libs.versions.toml` with `agp-base`
  instead of pinning `8.13.0`, which referenced
  `org.gradle.api.problems.internal.InternalProblems` (removed in Gradle 9.6.0)
  and broke project configuration on Gradle 9.8.2.
- Regenerate `gradle/wrapper/gradle-wrapper.jar`, `gradlew`, and `gradlew.bat`
  via `./gradlew wrapper` and update `gradle/wrapper/gradle-wrapper.jar.sha256sum`.
Upgrade the base Kotlin and Android Gradle Plugin versions and update the
integration test suites to run on Kotlin 2.4.0 and AGP 9.4.0-alpha01 without
passing `-Xskip-metadata-version-check`:

- Bump `kotlinBaseVersion` / `kotlin-base` from `2.3.20` to `2.4.0` and
  `agpBaseVersion` / `agp-base` from `9.3.0-alpha01` to `9.4.0-alpha01` in
  `gradle.properties` and `gradle/libs.versions.toml`, keeping KSP's own
  `languageVersion` at `2.3` so published artifacts remain readable by
  Kotlin 2.2+ consumers.
- Update `:gradle-plugin` and `:integration-tests` Java/Kotlin JVM targets
  from 11 to 17, as `com.android.tools.build:gradle:9.4.0-alpha01` requires
  a Java 17 consumer (`org.gradle.jvm.version = 17`). Consumer-facing KSP
  runtime artifacts remain at JVM target 1.8.
- Override AGP's bundled Kotlin Gradle Plugin (`2.2.10` in
  `com.android.tools.build:gradle-kotlin:9.4.0-alpha01`) with
  `org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion` in the
  `buildscript` classpath of Built-in Kotlin integration test fixtures
  (`playground-android-builtinkotlin`, `android-data-binding-builtinkotlin`,
  and `legacy-kapt`) so workloads and test processors both compile with
  Kotlin 2.4.0 without metadata version mismatches.
- Clean up redundant stage-2 `buildscript` appends in `AndroidBuiltInKotlinIT`
  and `AGPVersionBuiltInKotlinIT`, remove the stale `agpVersion=9.0.0-beta05`
  override in `AndroidBuiltInKotlinIT`, and add a `Latest` (`null, null, null`)
  matrix entry to `AGPVersionBuiltInKotlinIT`.
- Update integration test assertions in `PlaygroundIT` and `AndroidIT` for
  Kotlin 2.4.0 changes: minimum supported language version `2.0` (replacing
  removed `1.9`) and default subproject `moduleName` prefixing
  (`playground:workload`, `playground:workload_debug`, and
  `playground:workload_release`).
Replace the pre-release Kotlin 2.3.0-RC test matrix entries in
AGPVersionIT with the stable 2.3.20 release across AGP 8.12.0,
9.0.0-alpha12, 9.0.0-alpha14, and 9.0.0-beta01.
Add Kotlin 2.4.21 test matrix entries alongside 2.3.20 and 2.4.0 in
AGPVersionIT across AGP 8.12.0, 9.0.0-alpha12, 9.0.0-alpha14, and
9.0.0-beta01.
Replace the pre-release Kotlin 2.3.0-RC test matrix entries in
AGPVersionBuiltInKotlinIT with the stable 2.3.20 release across AGP
9.0.0-alpha14 and 9.0.0-beta01.
Add Kotlin 2.4.21 test matrix entries alongside 2.3.20 and 2.4.0 in
AGPVersionBuiltInKotlinIT across AGP 9.0.0-alpha14 and 9.0.0-beta01.
Update kotlinBaseVersion in gradle.properties and kotlin-base in
gradle/libs.versions.toml from 2.4.0 to 2.4.21 while keeping
buildKotlinVersion at 2.4.0 and leaving aa-* artifacts unchanged.
Add AGP 9.6.0-alpha02 test matrix entries across Kotlin 2.3.20, 2.4.0,
and 2.4.21 on Gradle 9.8.2 in AGPVersionIT.
Add AGP 9.6.0-alpha02 test matrix entries across Kotlin 2.3.20, 2.4.0,
and 2.4.21 on Gradle 9.8.2 in AGPVersionBuiltInKotlinIT.
AGP 9.6 enables android.experimental.enableJavaResourceOptimizations by
default, replacing processDebugJavaRes/out with
compressDebugJavaRes/java_res.jar and filtering /META-INF/proguard/*
from Java resources via default packaging excludes.

Assert generated resources in workload/build/generated/ksp/debug/resources
and check TestProcessor.log in compressDebugJavaRes/java_res.jar when
present while retaining the processDebugJavaRes/out fallback for older
AGP versions.
Support AGP 9.6's default compressDebugJavaRes/java_res.jar output in
testPlaygroundAndroidWithBuiltInKotlin alongside asserting KSP's
generated resources directory, while keeping the processDebugJavaRes/out
fallback for older AGP versions.
Update agpBaseVersion in gradle.properties and agp-base in
gradle/libs.versions.toml from 9.4.0-alpha01 to 9.6.0-alpha02.
Update buildKotlinVersion in gradle.properties from 2.4.0 to 2.4.21 to
align KSP's build Kotlin plugin and published kotlin-stdlib dependency
in symbol-processing-api and symbol-processing-common-deps with
kotlinBaseVersion (2.4.21), while keeping languageVersion at 2.3.
@jaschdoc
jaschdoc force-pushed the upgrade_kotlin_agp_versions branch from 3fc0f60 to cf252f4 Compare November 16, 2026 10:27
@jaschdoc
jaschdoc marked this pull request as ready for review November 16, 2026 12:13
@jaschdoc
jaschdoc enabled auto-merge November 16, 2026 12:13

@hfmehmed hfmehmed left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just leaving this until i have more time to check this out properly. I believe that the PR couples builddependency upgrades directly to published artifact metadata and bytecode targets. And I am not sure what the consequences of the latter to the consumer of KSP jars are.

@jaschdoc
jaschdoc disabled auto-merge November 17, 2026 13:09
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