Repository navigation
Migrate to AGP 9 built-in Kotlin and new DSL [CLF-723] - #201
Merged
Merged
Conversation
Removes the temporary android.builtInKotlin=false / android.newDsl=false
opt-outs added with the Compose 1.12.1 upgrade. AGP marks both deprecated
and removes them in AGP 10.
- Drop the standalone org.jetbrains.kotlin.android plugin from every module;
AGP now compiles Kotlin itself. The Kotlin Gradle plugin stays on the
buildscript classpath to pin the Kotlin version (AGP depends on KGP at
runtime and a higher classpath version wins), and the
org.jetbrains.kotlin.plugin.compose plugin is still the Compose compiler
wiring for the Compose modules.
- Move compiler options from tasks.withType<KotlinCompile> to the kotlin {}
extension AGP registers. jvmTarget is no longer set explicitly: built-in
Kotlin defaults it to compileOptions.targetCompatibility, so radiography
stays on JVM 1.8 and the Compose test modules on JVM 11.
- Use kotlin { explicitApi() } in radiography; AGP applies it to production
sources only, resolving the old TODO.
- binary-compatibility-validator 0.16.3 only configures Android modules when
it sees the kotlin-android plugin id, so it registered no api tasks at all
under built-in Kotlin. radiography/build.gradle.kts now registers BCV's
public apiBuild/apiCheck/apiDump task types itself, mirroring BCV's
kotlin-android path, and adds kotlin-metadata-jvm to BCV's worker
classpath. api/radiography.api is unchanged.
- Drop the explicit kotlin("stdlib") dependency in stoic-plugin; built-in
Kotlin adds it.
Verified: ./gradlew build --warning-mode all is green with no deprecation
warnings, apiCheck passes with no .api changes (and fails on an added public
class), and connectedCheck passes on a Samsung SM-A256U1 (43 tests).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
joshfriend
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #199. That PR temporarily set
android.builtInKotlin=falseandandroid.newDsl=falseso the standaloneorg.jetbrains.kotlin.androidplugin kept working under AGP 9.1.1. AGP marks both flags deprecated and removes them in AGP 10. This PR removes them and finishes the migration.Stacked on #199 (base is
zachklipp/compose-1-12-a559f8); retarget tomainonce that merges.Changes
kotlin("android")from all six modules; AGP compiles Kotlin itself.kotlin-gradle-pluginstays on the buildscript classpath to pin the Kotlin version (AGP has a runtime dependency on KGP and a higher classpath version wins), andorg.jetbrains.kotlin.plugin.composeremains the Compose compiler wiring for the Compose modules.tasks.withType<KotlinCompile>to thekotlin {}extension AGP registers.jvmTargetis no longer set explicitly: built-in Kotlin defaults it tocompileOptions.targetCompatibility, soradiographystays on JVM 1.8 / compileSdk 35 (verified: release classes are major version 52, POM unchanged vs. 2.10) and the two Compose test modules on JVM 11 (major version 55).radiographynow useskotlin { explicitApi() }; AGP applies it to production sources only, which resolves the old TODO about KT-37652.pluginManager.withPlugin("kotlin-android"), so under built-in Kotlin it registered no api tasks and./gradlew apiCheckfailed with "task not found". Bumping BCV doesn't help, and KGP 2.3.10'sKotlinAndroidProjectExtensionhas noabiValidation.radiography/build.gradle.ktsnow registers BCV's publicKotlinApiBuildTask/KotlinApiCompareTaskplus anapiDumptask itself, mirroring BCV's kotlin-android path, and addskotlin-metadata-jvmto BCV's worker classpath.api/radiography.apiis unchanged.kotlin("stdlib")dependency instoic-plugin; built-in Kotlin adds it.Verification
./gradlew build --warning-mode all: green, zero deprecation warnings (none aboutorg.jetbrains.kotlin.android, the oldProject.android(...)DSL, orandroid.newDsl)../gradlew apiCheck: passes with no.apichanges;apiDumpis a no-op. Sanity-checked that it fails when a public class is added and that explicit API mode still rejects implicit visibility in main sources../gradlew connectedCheckon a USB Samsung SM-A256U1 (Android 16): 43 tests, 0 failures across all five instrumented modules.🤖 Generated with Claude Code