Repository navigation
build: declare the Kotlin JVM toolchain explicitly - #883
Conversation
android-core, android-kit-base and tooling/android-plugin set a Java
sourceCompatibility/targetCompatibility but had no corresponding Kotlin
JVM target, relying on the Kotlin Gradle plugin's implicit default.
testutils declared one through the deprecated kotlinOptions.jvmTarget
DSL. Only tooling/common used the modern kotlin { jvmToolchain(...) }
API.
Apply that same, already-proven pattern to the remaining Kotlin-enabled
modules so every module compiles Kotlin against the same JDK release
(JAVA_VERSION, currently 17) as its Java sources, declared the same way
everywhere.
No source, dependency, or ProGuard changes. apiCheck passes with no
public API drift, and android-core/android-kit-base unit tests are
unaffected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Binary compatibility
Compares the release AAR against the same artifact at the last version published to Maven Central; R8-renamed classes and members are excluded (see the script docstring). Full japicmp HTML/XML reports are attached as the |
📦 SDK Size Impact ReportWhat the SDK adds to a minified release APK. Measured against an empty baseline app. Unlike the Rokt kit, android-core ships no Compose and no resources, so there is nothing here that a host app would already provide. mParticle Core SDK
➡️ SDK size impact change is minimal. Raw measurementsTarget branch: {"baseline_dex_bytes": 0, "baseline_download_bytes": 2518, "baseline_install_bytes": 7534, "core_dex_bytes": 218884, "core_download_bytes": 122935, "core_install_bytes": 130188}This PR: {"baseline_dex_bytes": 0, "baseline_download_bytes": 2512, "baseline_install_bytes": 7528, "core_dex_bytes": 218884, "core_download_bytes": 122943, "core_install_bytes": 130196} |
📦 SDK Size Impact ReportWhat the SDK adds to a minified release APK. Measured against a Compose + Material3 reference app, so these are the costs on top of an app that already ships Compose. The reference app's dependencies are a documented convention, not a measured average: see mParticle Core + Rokt kit
Rokt SDK+ umbrella (adds the payment extension)
➡️ SDK size impact change is minimal. Raw measurementsTarget branch: {"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4156052, "kit_download_bytes": 2540334, "kit_install_bytes": 2623275, "sdkplus_dex_bytes": 9278708, "sdkplus_download_bytes": 7978463, "sdkplus_install_bytes": 8148975}This PR: {"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4156052, "kit_download_bytes": 2540331, "kit_install_bytes": 2623275, "sdkplus_dex_bytes": 9278708, "sdkplus_download_bytes": 7978465, "sdkplus_install_bytes": 8148975} |
Why
Several modules in this SDK compile both Java and Kotlin source, and each one needs both languages to target the exact same JDK release so the two compilers produce compatible bytecode. Today, most of those modules declare that target for Java but never for Kotlin, so the Kotlin compiler is left to an implicit default instead. That gap is harmless right now only by coincidence, and it becomes a real risk as more of the SDK's internals move from Java to Kotlin: a silent mismatch would show up as a confusing compile failure, or worse, inconsistent bytecode in a published release. This change makes every module declare its Kotlin target the same explicit way a sibling module already does successfully, closing that gap before it can bite.
Programme
Part of an in-progress, internally planned Java-to-Kotlin migration for this SDK's core modules. No public tracking page exists yet; the migration's documentation and progress tracker are being added in mParticle/mparticle-android-sdk#846 (not yet merged).
What changes
Before:
android-core,android-kit-baseandtooling/android-plugindeclared a Java target but no Kotlin target at all;testutilsdeclared its Kotlin target through an API the Kotlin team has deprecated;tooling/custom-lint-ruleshardcoded its Java target as a literal number instead of using the shared project setting every other module uses.After: all five modules declare their Kotlin target the same explicit, current way, matching the one module (
tooling/common) that already did this correctly. The declared value is unchanged everywhere — this does not move any module to a different JDK release, it only makes the existing target explicit and consistent.No documentation, changelog or runbook changes accompany this: it has no user-visible behavior to describe. A reviewer can start with any one of the five files — the change is the same one-line addition (or deprecated-API swap) in each, so reading one tells you what the rest do. Nothing else in these files, and no other module, was touched.
Linked work
Depends on: None.
Unblocks: None.
Related: mParticle/mparticle-android-sdk#846 — adds the migration playbook and tracker this change is part of.
Rollout
Path: ships to consumers only when a release is next cut from
main; nothing about this PR itself triggers a release. It changes build configuration only, not the published artifacts' public API or runtime behavior.Feature flags: none.
Turning it off: revert the pull request; the previous build configuration returns immediately on the next build.
What we watch: standard CI build and test jobs on this and every subsequent pull request against
main— any JDK-target mismatch this change was meant to prevent would show up there as a compile failure, not silently in production.Risks
JAVA_VERSIONeach module's Java compilation already uses, and confirmed by a clean compile and a passing API-compatibility check with no detected drift; we would see it immediately as a compile failure or an API-check failure in CI, not in production.Risk class: low.
Who
Written by: Claude Code, an automated coding agent, from an internal Java-to-Kotlin migration plan agreed with the SDK team lead (September 2026).
Code reviewed before opening: automated adversarial review by Claude Code's commit-reviewer agent, twice (after an initial pass flagged two style inconsistencies, which were fixed and re-reviewed); no human review yet.
Design reviewed before opening: no one.
Decision this implements: the SDK team lead's decision to proceed with the Java-to-Kotlin migration plan, agreed September 2026.
Checked:
./gradlew compileReleaseKotlin/compileDebugKotlin/compileKotlinacross all five touched modules (clean, no new warnings),./gradlew apiCheck(passes, no public API drift), and./gradlew test(passes;android-core311 tests,android-kit-base89 tests, unchanged frommain) — all run locally just before opening this PR.Not checked: instrumented (
androidTest) tests were not run — this change affects only how Kotlin source is compiled, not runtime behavior, so the unit-test and API-compatibility checks above are the relevant signal. The kits underkits/build via a separate Gradle invocation and were not touched or rebuilt; they are unaffected by this change.Size
Hand-written: 22 lines, 5 files.
Generated: none.
🤖 Generated with Claude Code