Skip to content

Commit 8853917

Browse files
authored
Bump Kotlin to 2.1.20 (#2963)
Fix incorrect configuration of animalSniffer: now, for MPP projects, `main` source set does not exist and `jvmMain` should be used instead.
1 parent 9adedb4 commit 8853917

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

buildSrc/src/main/kotlin/animalsniffer-conventions.gradle.kts

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ plugins.withId("org.jetbrains.kotlin.multiplatform") {
2828

2929
afterEvaluate { // Can be applied only when the project is evaluated
3030
extensions.configure<AnimalSnifferExtension> {
31-
sourceSets = listOf(this@afterEvaluate.sourceSets["main"])
31+
sourceSets = listOfNotNull(
32+
this@afterEvaluate.sourceSets.findByName("jvmMain"),
33+
this@afterEvaluate.sourceSets.findByName("main")
34+
)
3235

3336
val annotationValue = when(name) {
3437
"kotlinx-serialization-core" -> "kotlinx.serialization.internal.SuppressAnimalSniffer"
@@ -45,4 +48,4 @@ afterEvaluate { // Can be applied only when the project is evaluated
4548
"signature"("org.codehaus.mojo.signature:java18:1.0@signature")
4649
}
4750

48-
}
51+
}

buildSrc/src/main/kotlin/source-sets-conventions.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ kotlin {
2121
explicitApi()
2222

2323
jvm {
24-
@Suppress("DEPRECATION") // Migrate on Kotlin 2.1.20 update
25-
withJava()
2624
@OptIn(ExperimentalKotlinGradlePluginApi::class)
2725
compilerOptions {
2826
jvmTarget = JvmTarget.JVM_1_8

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
group=org.jetbrains.kotlinx
6-
version=1.8.0-SNAPSHOT
6+
version=1.8.1-SNAPSHOT
77
jdk_toolchain_version=11
88

99
# This version takes precedence if 'bootstrap' property passed to project

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
kotlin = "2.1.0"
2+
kotlin = "2.1.20"
33
kover = "0.8.2"
44
dokka = "2.0.0-Beta"
55
knit = "0.5.0"

integration-test/build.gradle.kts

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ kotlin {
4848
wasmWasi {
4949
nodejs()
5050
}
51-
jvm {
52-
withJava()
53-
}
51+
jvm()
5452
macosX64()
5553
macosArm64()
5654
linuxX64()

integration-test/gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
#
44

5-
mainKotlinVersion=2.1.0
6-
mainLibVersion=1.8.0-SNAPSHOT
5+
mainKotlinVersion=2.1.20
6+
mainLibVersion=1.8.1-SNAPSHOT
77

88
kotlin.code.style=official
99

0 commit comments

Comments
 (0)