Upgrade to AGP 9.2.1, Gradle 9.6.1 and Kotlin 2.3.21 - #26
Merged
Conversation
added 2 commits
July 9, 2026 11:01
Build system:
- AGP 8.13.2 -> 9.2.1, Gradle wrapper 8.13 -> 9.6.1,
Kotlin 1.9.21 -> 2.3.21, KSP -> 2.3.9 (new standalone versioning,
symbol-processing-gradle-plugin artifact)
- Migrate Android modules (demo, demolibrary, kokain-di) to built-in
Kotlin: drop kotlin-android plugin, remove manual KSP srcDir blocks
and explicit kotlin-stdlib dependencies
- Migrate to the new AGP DSL: minSdk/targetSdk properties, packaging{},
proguard-android-optimize.txt, compileSdk/targetSdk 33 -> 36, drop
versionCode/versionName from library modules, add
publishing.singleVariant('release') to kokain-di, remove stale
buildscript block
- Gradle 9: move source/targetCompatibility into the java{} extension,
remove jcenter() repositories, drop obsolete jetifier and
illegal-access properties from gradle.properties
- ktlint-gradle 11.5.1 -> 14.2.0: rule configuration moved to new
.editorconfig (intellij_idea code style), ktlintFormat applied
Code fixes for the new toolchain:
- kotlinpoet 1.15.3 -> 2.3.0: KotlinPoetMetadataPreview/toKmClass are
gone; read KmClass via kotlin-metadata-jvm (KotlinClassMetadata
.readStrict) and use the typed visibility accessor instead of Flag
- kctfork 0.4.0 -> 0.13.0: configure processors via configureKsp{}
(KSP2)
- Replace deprecated-to-error String.toLowerCase with lowercase()
- LoggerTest: use Assert.assertThrows (junit 4.13.2) to satisfy PMD 7
- FactoryGenerator: constant moved to top-level const val (ktlint
property-naming)
Android Studio generated gradle-daemon-jvm.properties requiring a JetBrains JDK 21 daemon. With the daemon on 21, the Kotlin JVM modules compiled Kotlin against target 21 while Java stayed on 17, failing KGP's jvm-target consistency check; the CLI also could not provision the JetBrains JDK on this network. - kotlin.jvmToolchain(17) in all six JVM modules, making compilation independent of the daemon JVM - daemon JVM criteria set to plain Java 17 (matches CI and the locally installed JDKs; no vendor pin) - keep the IDE-added foojay-resolver-convention plugin in settings.gradle so toolchains can be auto-provisioned when needed
recroj
requested review from
a team,
mpradzin,
sbra0902 and
sden1403
as code owners
July 9, 2026 09:35
sbra0902
approved these changes
Jul 9, 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.
Summary
Migrates the project from AGP 8.13.2 / Gradle 8.13 / Kotlin 1.9.21 to:
Build system changes
kotlin-androidplugin fromdemo,demolibraryandkokain-di; dropped manual KSPsrcDirregistrations and explicit stdlib dependencies.kotlin-allopenkeeps working with built-in Kotlin.minSdk/targetSdkproperties,packaging {}block,proguard-android-optimize.txt(AGP 9 rejectsproguard-android.txt),publishing.singleVariant('release')forkokain-di, removedversionCode/versionNamefrom library modules; compileSdk/targetSdk 33 → 36.source/targetCompatibilitymoved into thejava {}extension, removedjcenter(), cleaned obsoletegradle.propertiesflags (jetifier,--illegal-access)..editorconfig(intellij_ideacode style to keep the previous rule behaviour),ktlintFormatapplied.gradle-daemon-jvm.properties, so builds are independent of the daemon JVM.Code changes
kokain-processor/EBeanModel: kotlinpoet 2.x madetoKmClassinternal → readKmClassvia the publickotlin-metadata-jvmAPI (KotlinClassMetadata.readStrict) and use the typedvisibilityaccessor instead of the removedFlagAPI.kokain-ksptests: kctfork 0.13 configures processors viaconfigureKsp {}(KSP2).String.toLowerCase()→lowercase()(deprecation promoted to error in Kotlin 2.x).LoggerTest:Assert.assertThrows(junit 4.13.2) instead of try/catch to satisfy PMD 7.Verification
./gradlew buildgreen: all 331 tasks incl. lint, ktlint, PMD./gradlew ktlintCheck jacocoTestReport(exact CI command) green:demo:installDebug— demo app installed and launched on a physical device; KSP2 code generation verified (GeneratedFactory.kt, shadow classes)