Skip to content

Upgrade kotlin #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![JetBrains incubator project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![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)
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![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)
[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://fzhinkin.github.io/kotlinx-io-dokka-docs-preview/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ kotlin {

js(IR) {
browser {
testTask {
testTask(Action {
filter.setExcludePatterns("*SmokeFileTest*")
}
})
}
}

Expand Down
8 changes: 4 additions & 4 deletions bytestring/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ plugins {
kotlin {
js(IR) {
nodejs {
testTask {
testTask(Action {
useMocha {
timeout = "30s"
}
}
})
}
browser {
testTask {
testTask(Action {
useMocha {
timeout = "30s"
}
}
})
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ plugins {
kotlin {
js(IR) {
nodejs {
testTask {
testTask(Action {
useMocha {
timeout = "300s"
}
}
})
}
browser {
testTask {
testTask(Action {
useMocha {
timeout = "300s"
}
}
})
}
}

Expand Down
2 changes: 2 additions & 0 deletions core/native/src/files/PathsNative.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
*/

@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)

package kotlinx.io.files

import kotlinx.cinterop.*
Expand Down
13 changes: 9 additions & 4 deletions core/native/test/util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@
* Copyright 2017-2023 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
*/

@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)

package kotlinx.io

import kotlinx.cinterop.*
import kotlinx.cinterop.UnsafeNumber
import kotlinx.cinterop.cstr
import kotlinx.cinterop.toKString
import platform.posix.*
import kotlin.random.Random
import kotlin.system.getTimeMillis

@OptIn(UnsafeNumber::class)
actual fun createTempFile(): String {
val template = "tmp-XXXXXX"
val path = mktemp(template.cstr) ?: throw IOException("Filed to create temp file: ${strerror(errno)}")
// mktemp don't work on MacOS 13+ (as well as mkstemp), at least the way it's expected.
if (path.toKString() == "") {
val tmpDir = getenv("TMPDIR")?.toKString() ?: getenv("TMP")?.toKString() ?: ""
val rnd = Random(getTimeMillis())
val rnd = Random(time(null))
var manuallyConstructedPath: String
do {
manuallyConstructedPath = "$tmpDir/tmp-${rnd.nextInt()}"
Expand All @@ -30,4 +35,4 @@ actual fun deleteFile(path: String) {
if (remove(path) != 0) {
throw IOException("Failed to delete file $path: ${strerror(errno)?.toKString()}")
}
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "1.8.21"
kotlin = "1.9.0"
java = "8"
dokka = "1.8.20"
kover = "0.7.1"
Expand Down
Loading