Skip to content

Commit 5ed64d6

Browse files
authored
Upgrade Kotlin to 1.9 (#199)
* Upgraded Kotlin to 1.9 * Fixed Gradle's deprecation warnings
1 parent 6fbee4b commit 5ed64d6

File tree

8 files changed

+36
-439
lines changed

8 files changed

+36
-439
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![JetBrains incubator project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
55
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
66
[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-io-core?versionSuffix=0.2.1)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-io-core/0.2.1)
7-
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
7+
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
88
[![TeamCity build](https://img.shields.io/teamcity/build/s/KotlinTools_KotlinxIo_BuildAggregated.svg?server=http%3A%2F%2Fteamcity.jetbrains.com)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=KotlinTools_KotlinxIo_BuildAggregated&guest=1)
99
[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://fzhinkin.github.io/kotlinx-io-dokka-docs-preview/)
1010

build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-multiplatform.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ kotlin {
3030

3131
js(IR) {
3232
browser {
33-
testTask {
33+
testTask(Action {
3434
filter.setExcludePatterns("*SmokeFileTest*")
35-
}
35+
})
3636
}
3737
}
3838

bytestring/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ plugins {
1010
kotlin {
1111
js(IR) {
1212
nodejs {
13-
testTask {
13+
testTask(Action {
1414
useMocha {
1515
timeout = "30s"
1616
}
17-
}
17+
})
1818
}
1919
browser {
20-
testTask {
20+
testTask(Action {
2121
useMocha {
2222
timeout = "30s"
2323
}
24-
}
24+
})
2525
}
2626
}
2727
}

core/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ plugins {
1515
kotlin {
1616
js(IR) {
1717
nodejs {
18-
testTask {
18+
testTask(Action {
1919
useMocha {
2020
timeout = "300s"
2121
}
22-
}
22+
})
2323
}
2424
browser {
25-
testTask {
25+
testTask(Action {
2626
useMocha {
2727
timeout = "300s"
2828
}
29-
}
29+
})
3030
}
3131
}
3232

core/native/src/files/PathsNative.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
44
*/
55

6+
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
7+
68
package kotlinx.io.files
79

810
import kotlinx.cinterop.*

core/native/test/util.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@
22
* Copyright 2017-2023 JetBrains s.r.o. and respective authors and developers.
33
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
44
*/
5+
6+
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
7+
58
package kotlinx.io
69

7-
import kotlinx.cinterop.*
10+
import kotlinx.cinterop.UnsafeNumber
11+
import kotlinx.cinterop.cstr
12+
import kotlinx.cinterop.toKString
813
import platform.posix.*
914
import kotlin.random.Random
10-
import kotlin.system.getTimeMillis
1115

16+
@OptIn(UnsafeNumber::class)
1217
actual fun createTempFile(): String {
1318
val template = "tmp-XXXXXX"
1419
val path = mktemp(template.cstr) ?: throw IOException("Filed to create temp file: ${strerror(errno)}")
1520
// mktemp don't work on MacOS 13+ (as well as mkstemp), at least the way it's expected.
1621
if (path.toKString() == "") {
1722
val tmpDir = getenv("TMPDIR")?.toKString() ?: getenv("TMP")?.toKString() ?: ""
18-
val rnd = Random(getTimeMillis())
23+
val rnd = Random(time(null))
1924
var manuallyConstructedPath: String
2025
do {
2126
manuallyConstructedPath = "$tmpDir/tmp-${rnd.nextInt()}"
@@ -30,4 +35,4 @@ actual fun deleteFile(path: String) {
3035
if (remove(path) != 0) {
3136
throw IOException("Failed to delete file $path: ${strerror(errno)?.toKString()}")
3237
}
33-
}
38+
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
kotlin = "1.8.21"
2+
kotlin = "1.9.0"
33
java = "8"
44
dokka = "1.8.20"
55
kover = "0.7.1"

0 commit comments

Comments
 (0)