Repository navigation
build: support Kotlin 2.2 on JVM and Android (#364) - #366
Merged
Merged
Conversation
Multik keeps building with the latest Kotlin (2.4.21), but projects on Kotlin 2.2 or newer can now use its JVM and Android artifacts: - languageVersion and apiVersion are 2.2, so classes carry 2.2.0 metadata and can't use newer language features or stdlib API. - coreLibrariesVersion is 2.2.0, so the published variants depend on kotlin-stdlib 2.2.0 instead of pulling 2.4.21 into the project. - JS and Wasm keep the stdlib and kotlin-test of the compiler, the only ones their compilers accept. They go to jsMain and wasmJsMain, not webMain: dependencies of shared source sets end up in the metadata variant, which multiplatform projects on Kotlin 2.2 resolve too. JS, WasmJS and Native still need Kotlin 2.4. Their klibs carry ABI version 2.4.0, which older compilers reject, and Kotlin 2.4 can export klibs only to 2.3 and only as pre-release binaries. Language version 2.2 also turns off JvmEnhancedBridges (since 2.4), so the API dump loses 12 synthetic bridges in MutableMultiArray and MemoryView. They came with the Kotlin 2.4 bump (#336), after 0.3.1; both classes now match the 0.3.1 dump.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the Kotlin 2.2 JVM and Android compatibility changes.
No open issues 🎉
What changed in this PR
Enables Kotlin 2.2 projects to consume Multik’s JVM and Android artifacts while retaining the Kotlin 2.4 build toolchain, addressing #364. JS, WasmJS, and Native still require Kotlin 2.4 or newer.
Changes:
- Sets language/API compatibility and the default standard-library dependency to Kotlin 2.2.
- Keeps web dependencies aligned with the compiler and updates the JVM API dump to reflect removed, unreleased synthetic bridges.
- Documents platform-specific Kotlin requirements.
| File | Description |
|---|---|
README.md |
Adds Kotlin version requirements by platform. |
multik-core/api/jvm/multik-core.api |
Removes 12 synthetic bridges disabled by language version 2.2. |
docs/topics/gettingStarted/installation.md |
Adds compatibility requirements and links to the FAQ. |
docs/topics/FAQ.md |
Explains platform requirements and older-compiler failures. |
buildSrc/src/main/kotlin/multik.base.gradle.kts |
Sets Kotlin 2.2 language/API versions and standard-library baseline. |
buildSrc/src/main/kotlin/multik.all-targets-kmp.gradle.kts |
Aligns JS/Wasm standard libraries and web test dependencies with the compiler. |
Review effort: Balanced
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.
Fixes #364.
Multik stays on the latest Kotlin, but
languageVersion,apiVersionand thekotlin-stdlibdependency are now 2.2, so JVM and Android projects on Kotlin 2.2+ can use it. JS, WasmJS and Native still need Kotlin 2.4: a project can't use klibs built with a newer Kotlin.JS and Wasm keep the compiler's stdlib and kotlin-test, because their compilers reject older ones.
The API dump loses 12 synthetic bridges that came with Kotlin 2.4 (#336), so
MutableMultiArrayandMemoryViewmatch 0.3.1 again.Testing
apiCheck korroCheckpass.develop, the JVM one fails on metadata 2.4.0.Checklist