Skip to content

Commit 81efa80

Browse files
committed
Set LV for KMP manually because of the stdlib problems
1 parent 1596937 commit 81efa80

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

gradle-conventions/src/main/kotlin/conventions-kmp.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ withKmpConfig {
4242
configureJvm(isKmp = true)
4343

4444
configureJavaCompatibility(8)
45-
configureKotlinCompatibility("2.0.0")

gradle-conventions/src/main/kotlin/conventions-kotlin-version.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
56
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
7+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
8+
import util.other.libs
69
import util.withKotlinJvmExtension
710
import util.withKotlinKmpExtension
811

@@ -13,10 +16,26 @@ fun KotlinProjectExtension.optInForRpcApi() {
1316
}
1417
}
1518

19+
/**
20+
* Set the compatibility mode to the lower supported language version.
21+
*
22+
* This should be lined up with the minimal supported compiler plugin version.
23+
*
24+
* We update the language version only for the 'main' sources sets.
25+
* This makes our tests execute against the latest compiler plugin version (for example, with K2 instead of K1).
26+
*/
27+
fun KotlinCommonCompilerOptions.setProjectLanguageVersion() {
28+
languageVersion.set(KotlinVersion.KOTLIN_2_0)
29+
apiVersion.set(KotlinVersion.KOTLIN_2_0)
30+
}
31+
1632
withKotlinJvmExtension {
1733
optInForRpcApi()
1834
}
1935

2036
withKotlinKmpExtension {
2137
optInForRpcApi()
38+
39+
// We don't use `compat-patrouille` here because it sets stdlib version, and that breaks WASM tests.
40+
compilerOptions.setProjectLanguageVersion()
2241
}

0 commit comments

Comments
 (0)