mbonnin
08/19/2025, 3:57 PMkotlin-stdlib
version of my project to a specific version for the JVM but not for other targets?
I have used coreLibrariesVersion
in the past but this has a lot of side effects, especially for targets like JS/Wasm that currently require their kotlin-stdlib
to be aligned with the compiler version.tapchicoma
08/19/2025, 4:18 PMmbonnin
08/19/2025, 4:20 PMmbonnin
08/19/2025, 4:21 PMjvmCoreLibrariesVersion
or something like sombonnin
08/19/2025, 4:21 PMjvmKotlinStdlibVersion
mbonnin
08/19/2025, 4:33 PMtapchicoma
08/19/2025, 4:33 PMkotlin-stdlib-common
will enforce newer stdlib version in JVM targettapchicoma
08/19/2025, 4:34 PMmbonnin
08/19/2025, 4:37 PMcoreLibrariesVersion = "2.0.0"
sourceSets.getByName("wasmJsMain") {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.2.0")
}
}
2.2.0
no matter what?mbonnin
08/19/2025, 4:39 PMtapchicoma
08/19/2025, 4:39 PMcoreLibrariesVersion
may work. Though in general I would advice to not mix stdlib versionsmbonnin
08/19/2025, 4:40 PMother way around by having lower version inThis is what I'm doing (I think?)may workcoreLibrariesVersion
mbonnin
08/19/2025, 4:40 PMcoreLibrariesVersion
is 2.0.0
I "upgrade" it explicitely to "2.2.0" in the dependencies for wasmJsMainmbonnin
08/19/2025, 4:41 PMThough in general I would advice to not mix stdlib versionsIt's an issue for compatibility because if I update everything to 2.2.0, I lose the JVM 2.0.0 consumers
mbonnin
08/19/2025, 4:42 PMapiVersion
and languageVersion
tapchicoma
08/19/2025, 4:45 PMkotlin-stdlib*
dependencies automatically
• If there is a dependency explicitly specified - KGP skips this logic
• kotlin-stdlib-common
has a dependency on kotlin-stdlib
So if coreLibrariesVersion
is lower than explicit added dependency - it worksmbonnin
08/19/2025, 4:47 PMkotlinStdlibVersion
separately from coreLibrariesVersion
?mbonnin
08/19/2025, 4:48 PMjvmCoreLibrariesVersion
• nonJvmCoreLibrariesVersion
(I know that feels uhhhh... 😅 )mbonnin
08/19/2025, 4:50 PMtapchicoma
08/19/2025, 4:50 PMtapchicoma
08/19/2025, 4:50 PMmbonnin
08/19/2025, 4:50 PMmbonnin
08/19/2025, 4:51 PMtapchicoma
08/19/2025, 4:51 PMmbonnin
08/19/2025, 4:51 PM