File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
gradle-conventions/src/main/kotlin Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -42,4 +42,3 @@ withKmpConfig {
4242configureJvm(isKmp = true )
4343
4444configureJavaCompatibility(8 )
45- configureKotlinCompatibility(" 2.0.0" )
Original file line number Diff line number Diff line change 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
56import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
7+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
8+ import util.other.libs
69import util.withKotlinJvmExtension
710import 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+
1632withKotlinJvmExtension {
1733 optInForRpcApi()
1834}
1935
2036withKotlinKmpExtension {
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}
You can’t perform that action at this time.
0 commit comments