Skip to content

build: upgrade to AGP 9.5.0, Gradle 9.8.2, Kotlin 2.4.21 - #248

Open
dipenpradhan wants to merge 1 commit into
masterfrom
upgrade-1-toolchain
Open

dipenpradhan wants to merge 1 commit into
masterfrom
upgrade-1-toolchain

Conversation

@dipenpradhan

Copy link
Copy Markdown
Collaborator

Part of #236. First of two stacked PRs (this one, then the Compose BOM upgrade on top).

What

  • Gradle wrapper 9.8.2 (regenerated; gradle-wrapper.jar matches the official 9.8.2 checksum 3b8a2577…e98).
  • AGP 9.5.0 with built-in Kotlin: the org.jetbrains.kotlin.android plugin is removed from the app, the buildSrc convention scripts and demos/cryptoapp.
  • Kotlin 2.4.21, KSP 2.3.13 (KSP is versioned independently of Kotlin since 2.2).
  • kotlinOptions moved to the top-level kotlin { compilerOptions { … } } DSL; JVM targets unchanged (libraries 17, app 1.8 in this PR).
  • targetSdk removed from library defaultConfig (removed for libraries in AGP 9; the app keeps it).
  • Roborazzi 1.77.0 (1.46.1 relies on the removed TestedExtension).
  • Compose BOM intentionally stays on 2024.12.01 here; the next PR bumps it.

Why

Compose 1.12 (BOM 2026.09.00) requires AGP 9.1.0+ and compileSdk 37, so the toolchain has to move first.

Testing

  • ./gradlew clean build testDebugUnitTest --continue --no-build-cache on this commit alone: BUILD SUCCESSFUL, 16/16 unit tests, 0 lint errors.
  • ./gradlew ktfmtCheck: green.

- Bump Gradle wrapper to 9.8.2
- Bump AGP to 9.5.0, Kotlin to 2.4.21 (Compose Compiler plugin tracks Kotlin)
- Bump KSP to 2.3.13 (versioned independently of Kotlin since 2.2)
- Adopt AGP 9 built-in Kotlin: drop org.jetbrains.kotlin.android plugin
- Migrate kotlinOptions/ freeCompilerArgs opt-ins to the top-level
  kotlin { compilerOptions } DSL
- Remove targetSdk from library defaultConfig (removed in AGP 9)
- Bump Roborazzi to 1.66.0 for AGP 9 compatibility (1.77.0 needs a newer
  Compose runtime than this BOM); the BOM commit moves Roborazzi to 1.77.0
- Compose BOM stays on 2024.12.01 until the BOM upgrade commit
- ktfmt-gradle 0.22.0 -> 0.27.0: 0.22.0 only registered its per-source-set
  check/format tasks when the kotlin-android plugin was applied, which AGP 9
  built-in Kotlin no longer is, so ktfmtCheck silently checked nothing. 0.27.0
  (AGP 9.x support) discovers source sets from the common extension instead.
  The stricter formatter (ktfmt 0.64) re-wraps a handful of >100-char lines in
  this commit so ktfmtCheck passes again.

./gradlew build, ktfmtCheck and unit tests are green
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