Skip to content

Commit 668886e

Browse files
renovate[bot]osipxd
andcommitted
KTOR-7866: Update Kotlin to v2.1.0 (#4512)
* Update Kotlin to v2.1.0 * Update yarn.lock * Update kotlinter to 5.0.0 * Disable JteTest (KTOR-8030) * Decrease Kotlin daemon Xmx (KTOR-8035) --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Osip Fatkullin <[email protected]>
1 parent 9e3abf8 commit 668886e

File tree

10 files changed

+49
-66
lines changed

10 files changed

+49
-66
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[![Official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
1111
[![Maven Central](https://img.shields.io/maven-central/v/io.ktor/ktor-server)](https://central.sonatype.com/search?namespace=io.ktor)
12-
[![Kotlin](https://img.shields.io/badge/kotlin-2.0.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
12+
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
1313
[![Slack channel](https://img.shields.io/badge/chat-slack-green.svg?logo=slack)](https://kotlinlang.slack.com/messages/ktor/)
1414
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
1515
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/ktorio/ktor)

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

buildSrc/src/main/kotlin/Codestyle.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fun Project.configureCodestyle() {
1010
apply(plugin = "org.jmailen.kotlinter")
1111

1212
kotlinter.apply {
13-
ignoreFailures = true
13+
ignoreLintFailures = true
1414
reporters = arrayOf("checkstyle", "plain")
1515
}
1616

buildSrc/src/main/kotlin/Train.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
4-
import internal.*
5-
import org.gradle.api.*
6-
import org.gradle.api.provider.*
7-
import org.gradle.api.tasks.testing.*
8-
import org.gradle.kotlin.dsl.*
9-
import org.jetbrains.kotlin.gradle.dsl.*
4+
import internal.libs
5+
import org.gradle.api.Project
6+
import org.gradle.api.provider.Provider
7+
import org.gradle.api.tasks.testing.Test
8+
import org.gradle.kotlin.dsl.withType
9+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
1010

1111
fun Project.filterSnapshotTests() {
1212
if (!buildSnapshotTrain) return
@@ -90,7 +90,7 @@ fun Project.getKotlinLanguageVersion(): KotlinVersion =
9090
private fun Project.resolveKotlinLanguageVersion(): KotlinVersion {
9191
val languageVersion = rootProject.findProperty("kotlin_language_version")
9292
?.let { KotlinVersion.fromVersion(it.toString()) }
93-
?: KotlinVersion.KOTLIN_2_0
93+
?: KotlinVersion.KOTLIN_2_1
9494
logger.info("Kotlin language version: $languageVersion")
9595

9696
return languageVersion

gradle.properties

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
# Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
#
44

55
# styleguide
@@ -31,7 +31,7 @@ version=3.1.0-SNAPSHOT
3131
# To save some memory, shutting down Kotlin Daemon used for buildSrc compilation after 30 seconds of idle.
3232
# See: https://github.com/gradle/gradle/issues/29331
3333
org.gradle.jvmargs=-Xms2g -Xmx8g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx512m,Xms256m,-XX:MaxMetaspaceSize=256m,XX:+HeapDumpOnOutOfMemoryError
34-
kotlin.daemon.jvmargs=-Xms512m -Xmx4g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError
34+
kotlin.daemon.jvmargs=-Xms512m -Xmx2g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError
3535
# Gradle Doctor might increase memory consumption when task monitoring is enabled, so it is disabled by default.
3636
# Some features can't work without task monitoring:
3737
# doctor-negative-savings, doctor-slow-build-cache-connection, doctor-slow-maven-connection
@@ -47,14 +47,10 @@ org.gradle.parallel=true
4747
kotlin.native.ignoreDisabledTargets=true
4848
kotlin.mpp.stability.nowarn=true
4949
kotlin.mpp.enableCInteropCommonization=true
50-
kotlin.incremental.js.ir=false
51-
kotlin.incremental.js.klib=false
52-
kotlin.incremental.multiplatform=false
50+
kotlin.incremental.wasm=true
5351
kotlin.mpp.applyDefaultHierarchyTemplate=false
5452
kotlin.apple.xcodeCompatibility.nowarn=true
5553
kotlin.suppressGradlePluginWarnings=IncorrectCompileOnlyDependencyWarning
56-
#kotlinx.atomicfu.enableJvmIrTransformation=true
57-
#kotlinx.atomicfu.enableNativeIrTransformation=true
5854
kotlin.daemon.useFallbackStrategy=false
5955

6056
# dokka

gradle/libs.versions.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22

3-
kotlin = "2.0.21"
3+
kotlin = "2.1.0"
44
kotlinx-html = "0.11.0"
55
kotlinx-datetime = "0.6.1"
66
kotlinx-io = "0.6.0"
@@ -10,7 +10,7 @@ serialization = "1.7.3"
1010
binaryCompatibilityValidator = "0.17.0"
1111
dokka = "1.9.20"
1212
kover = "0.9.1"
13-
ktlint = "4.5.0"
13+
kotlinter = "5.0.0"
1414
kotlinx-browser = "0.3"
1515

1616
# Used for test server in buildSrc
@@ -227,7 +227,7 @@ tomlj = { module = "org.tomlj:tomlj", version.ref = "tomlj" }
227227

228228
develocity = { module = "com.gradle:develocity-gradle-plugin", version.ref = "develocity" }
229229
develocity-commonCustomUserData = { module = "com.gradle:common-custom-user-data-gradle-plugin", version.ref = "develocity-commonCustomUserData" }
230-
kotlinter = { module = "org.jmailen.gradle:kotlinter-gradle", version.ref = "ktlint" }
230+
kotlinter = { module = "org.jmailen.gradle:kotlinter-gradle", version.ref = "kotlinter" }
231231
gradleDoctor = { module = "com.osacky.doctor:doctor-plugin", version.ref = "gradleDoctor" }
232232

233233
[plugins]

kotlin-js-store/yarn.lock

+23-33
Original file line numberDiff line numberDiff line change
@@ -122,28 +122,12 @@
122122
dependencies:
123123
"@types/node" "*"
124124

125-
"@types/eslint-scope@^3.7.3":
126-
version "3.7.7"
127-
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5"
128-
integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==
129-
dependencies:
130-
"@types/eslint" "*"
131-
"@types/estree" "*"
132-
133-
"@types/eslint@*":
134-
version "8.44.8"
135-
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.8.tgz#f4fe1dab9b3d3dd98082d4b9f80e59ab40f1261c"
136-
integrity sha512-4K8GavROwhrYl2QXDXm0Rv9epkA8GBFu0EI+XrrnnuCl7u8CWBRusX7fXJfanhZTDWSAL24gDI/UqXyUM0Injw==
137-
dependencies:
138-
"@types/estree" "*"
139-
"@types/json-schema" "*"
140-
141-
"@types/estree@*", "@types/estree@^1.0.5":
125+
"@types/estree@^1.0.5":
142126
version "1.0.5"
143127
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
144128
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
145129

146-
"@types/json-schema@*", "@types/json-schema@^7.0.8":
130+
"@types/json-schema@^7.0.8":
147131
version "7.0.15"
148132
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
149133
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
@@ -851,7 +835,7 @@ engine.io@~6.5.2:
851835
engine.io-parser "~5.2.1"
852836
ws "~8.11.0"
853837

854-
enhanced-resolve@^5.17.0:
838+
enhanced-resolve@^5.17.1:
855839
version "5.17.1"
856840
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15"
857841
integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==
@@ -1443,10 +1427,10 @@ [email protected]:
14431427
minimatch "^9.0.3"
14441428
webpack-merge "^4.1.5"
14451429

1446-
1447-
version "6.4.3"
1448-
resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.3.tgz#763e500f99597218bbb536de1a14acc4ceea7ce8"
1449-
integrity sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q==
1430+
1431+
version "6.4.4"
1432+
resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.4.tgz#dfa5a426cf5a8b53b43cd54ef0d0d09742351492"
1433+
integrity sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==
14501434
dependencies:
14511435
"@colors/colors" "1.5.0"
14521436
body-parser "^1.19.0"
@@ -1478,6 +1462,13 @@ kind-of@^6.0.2:
14781462
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
14791463
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
14801464

1465+
1466+
version "2.0.0"
1467+
resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.0.0.tgz#b112096b273c1e733e0b86560998235c09a19286"
1468+
integrity sha512-xkVGl60Ygn/zuLkDPx+oHj7jeLR7hCvoNF99nhwXMn8a3ApB4lLiC9pk4ol4NHPjyoCbvQctBqvzUcp8pkqyWw==
1469+
dependencies:
1470+
format-util "^1.0.5"
1471+
14811472
lines-and-columns@^1.1.6:
14821473
version "1.2.4"
14831474
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
@@ -1601,10 +1592,10 @@ mkdirp@^0.5.5:
16011592
dependencies:
16021593
minimist "^1.2.6"
16031594

1604-
1605-
version "10.7.0"
1606-
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.0.tgz#9e5cbed8fa9b37537a25bd1f7fb4f6fc45458b9a"
1607-
integrity sha512-v8/rBWr2VO5YkspYINnvu81inSz2y3ODJrhO175/Exzor1RcEZZkizgE2A+w/CAXXoESS8Kys5E62dOHGHzULA==
1595+
1596+
version "10.7.3"
1597+
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752"
1598+
integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==
16081599
dependencies:
16091600
ansi-colors "^4.1.3"
16101601
browser-stdout "^1.3.1"
@@ -2422,12 +2413,11 @@ webpack-sources@^3.2.3:
24222413
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
24232414
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
24242415

2425-
webpack@5.93.0:
2426-
version "5.93.0"
2427-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.93.0.tgz#2e89ec7035579bdfba9760d26c63ac5c3462a5e5"
2428-
integrity sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==
2416+
webpack@5.94.0:
2417+
version "5.94.0"
2418+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f"
2419+
integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==
24292420
dependencies:
2430-
"@types/eslint-scope" "^3.7.3"
24312421
"@types/estree" "^1.0.5"
24322422
"@webassemblyjs/ast" "^1.12.1"
24332423
"@webassemblyjs/wasm-edit" "^1.12.1"
@@ -2436,7 +2426,7 @@ [email protected]:
24362426
acorn-import-attributes "^1.9.5"
24372427
browserslist "^4.21.10"
24382428
chrome-trace-event "^1.0.2"
2439-
enhanced-resolve "^5.17.0"
2429+
enhanced-resolve "^5.17.1"
24402430
es-module-lexer "^1.2.1"
24412431
eslint-scope "5.1.1"
24422432
events "^3.2.0"

ktor-io/posix/src/io/ktor/utils/io/locks/Synchronized.kt

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package io.ktor.utils.io.locks
66

77
import io.ktor.io.interop.mutex.*
88
import io.ktor.utils.io.*
99
import kotlinx.cinterop.*
10-
import platform.posix.*
10+
import platform.posix.pthread_self
11+
import platform.posix.pthread_t
1112
import kotlin.concurrent.AtomicNativePtr
1213
import kotlin.concurrent.AtomicReference
13-
import kotlin.native.concurrent.*
1414
import kotlin.native.internal.NativePtr
1515

1616
/**
@@ -217,18 +217,13 @@ public actual open class SynchronizedObject {
217217
}
218218
}
219219

220-
@OptIn(FreezingIsDeprecated::class)
221220
protected class LockState(
222221
public val status: Status,
223222
public val nestedLocks: Int,
224223
public val waiters: Int,
225224
public val ownerThreadId: pthread_t? = null,
226225
public val mutex: CPointer<ktor_mutex_node_t>? = null
227-
) {
228-
init {
229-
freeze()
230-
}
231-
}
226+
)
232227

233228
protected enum class Status { UNLOCKED, THIN, FAT }
234229

ktor-server/ktor-server-core/posix/src/io/ktor/server/config/ConfigLoadersNix.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/*
2-
* Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package io.ktor.server.config
66

77
import io.ktor.server.engine.*
8-
import io.ktor.utils.io.*
98

109
internal actual val CONFIG_PATH: List<String>
1110
get() = listOfNotNull(
@@ -18,6 +17,7 @@ internal actual val CONFIG_PATH: List<String>
1817
public actual val configLoaders: List<ConfigLoader>
1918
get() = _configLoaders
2019

20+
@Suppress("ObjectPropertyName")
2121
private val _configLoaders: MutableList<ConfigLoader> = mutableListOf()
2222

2323
public fun addConfigLoader(loader: ConfigLoader) {

ktor-server/ktor-server-plugins/ktor-server-jte/jvm/test/io/ktor/tests/jte/JteTest.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2012 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package io.ktor.tests.jte
@@ -28,6 +28,8 @@ import java.util.zip.*
2828
import kotlin.test.*
2929
import kotlin.text.Charsets
3030

31+
// TODO KTOR-8030: Enable tests after updating JTE
32+
@Ignore
3133
class JteTest {
3234

3335
@Test

0 commit comments

Comments
 (0)