Skip to content
This repository was archived by the owner on Oct 5, 2026. It is now read-only.

Bump Kotlin to 2.0.21 with language/API version pinned to 1.9 - #1830

Open
Mohit (mohitc1) wants to merge 4 commits into
devfrom
mchand/kotlin-2.0.21
Open

Mohit (mohitc1) wants to merge 4 commits into
devfrom
mchand/kotlin-2.0.21

Conversation

@mohitc1

@mohitc1 Mohit (mohitc1) commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Bumps Kotlin from 1.8.0 to 2.0.21, with languageVersion/apiVersion pinned to 1.9 on every module that publishes a consumable artifact.

Why

Kotlin 1.8 cannot read dependency metadata stamped by a Kotlin 2.0 compiler, which forces -Xskip-metadata-version-check onto any module consuming a modern dependency. That flag is module-wide, so it silently disables the check for every dependency, not just the intended one. This removes the need for it.

How it works

  • The 2.0.21 compiler reads dependency metadata up to Kotlin 2.1, so no skip flag is required.
  • languageVersion/apiVersion = 1.9 keeps the K1 frontend, so this is not a K2 migration — no smart-cast/inference/Lombok-interop fallout.
  • Emitted metadata is therefore version 1.9.0, which consumers still on Kotlin 1.8 can read. No downstream break for MSAL customers, OneAuth, Teams or Outlook.

Verified by inspecting the compiled output: kotlin.Metadata(mv=[1,9,0]).

Validation

  • :common:compileLocalDebugKotlin — BUILD SUCCESSFUL
  • :common:compileLocalDebugUnitTestKotlin — BUILD SUCCESSFUL
  • :common:testLocalDebugUnitTest — 1925 tests, 1786 passed. The 139 failures are all pre-existing and environmental: the nativeauth.integration suites require the pipeline-supplied MOCK_API_URL, which is empty on a dev box, and one PackageUtilsTest failure is Mockito state bleed from SignUpOAuth2StrategyTest.setup in the same worker JVM.

Notes for reviewers

  • Test apps and mock apps are deliberately not pinned — nothing consumes their metadata. They will compile under K2, so they are the most likely place to see new errors.
  • common/testutils is pinned: it is maven-publish + kotlin-android, so it emits metadata consumed by the broker/msal/adal automation suites.
  • This also aligns the monorepo with the Authenticator app, which is already on Kotlin 2.0.21 and was previously the de-facto source of truth for the Compose/KSP plugin versions while kotlinVersion said 1.8.0.

Work item

  • AB#3742062 - Bump Kotlin to 2.0.21 across common, broker, msal, adal and android-complete

assistance: agentic-ide
type: chore
agent-tool: copilot-chat
agent-model: claude-opus-4.5
work-item: AB#3742062

Mohit added 2 commits August 27, 2026 13:46
The 2.0.21 compiler reads dependency metadata up to Kotlin 2.1, removing the
need for -Xskip-metadata-version-check. Pinning languageVersion/apiVersion to
1.9 keeps the K1 frontend (no K2 migration) and emits metadata version 1.9.0,
so consumers still on Kotlin 1.8 are unaffected.
@mohitc1
Mohit (mohitc1) marked this pull request as ready for review August 28, 2026 17:17
@mohitc1
Mohit (mohitc1) requested a review from a team as a code owner August 28, 2026 17:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants