File tree Expand file tree Collapse file tree 8 files changed +36
-439
lines changed
build-logic/src/main/kotlin/kotlinx/io/conventions Expand file tree Collapse file tree 8 files changed +36
-439
lines changed Original file line number Diff line number Diff line change 4
4
[ ![ JetBrains incubator project] ( https://jb.gg/badges/incubator.svg )] ( https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub )
5
5
[ ![ GitHub license] ( https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat )] ( http://www.apache.org/licenses/LICENSE-2.0 )
6
6
[ ![ 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 )
8
8
[ ![ 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 )
9
9
[ ![ KDoc link] ( https://img.shields.io/badge/API_reference-KDoc-blue )] ( https://fzhinkin.github.io/kotlinx-io-dokka-docs-preview/ )
10
10
Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ kotlin {
30
30
31
31
js(IR ) {
32
32
browser {
33
- testTask {
33
+ testTask( Action {
34
34
filter.setExcludePatterns(" *SmokeFileTest*" )
35
- }
35
+ })
36
36
}
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -10,18 +10,18 @@ plugins {
10
10
kotlin {
11
11
js(IR ) {
12
12
nodejs {
13
- testTask {
13
+ testTask( Action {
14
14
useMocha {
15
15
timeout = " 30s"
16
16
}
17
- }
17
+ })
18
18
}
19
19
browser {
20
- testTask {
20
+ testTask( Action {
21
21
useMocha {
22
22
timeout = " 30s"
23
23
}
24
- }
24
+ })
25
25
}
26
26
}
27
27
}
Original file line number Diff line number Diff line change @@ -15,18 +15,18 @@ plugins {
15
15
kotlin {
16
16
js(IR ) {
17
17
nodejs {
18
- testTask {
18
+ testTask( Action {
19
19
useMocha {
20
20
timeout = " 300s"
21
21
}
22
- }
22
+ })
23
23
}
24
24
browser {
25
- testTask {
25
+ testTask( Action {
26
26
useMocha {
27
27
timeout = " 300s"
28
28
}
29
- }
29
+ })
30
30
}
31
31
}
32
32
Original file line number Diff line number Diff line change 3
3
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
4
4
*/
5
5
6
+ @file:OptIn(kotlinx.cinterop.ExperimentalForeignApi ::class )
7
+
6
8
package kotlinx.io.files
7
9
8
10
import kotlinx.cinterop.*
Original file line number Diff line number Diff line change 2
2
* Copyright 2017-2023 JetBrains s.r.o. and respective authors and developers.
3
3
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
4
4
*/
5
+
6
+ @file:OptIn(kotlinx.cinterop.ExperimentalForeignApi ::class )
7
+
5
8
package kotlinx.io
6
9
7
- import kotlinx.cinterop.*
10
+ import kotlinx.cinterop.UnsafeNumber
11
+ import kotlinx.cinterop.cstr
12
+ import kotlinx.cinterop.toKString
8
13
import platform.posix.*
9
14
import kotlin.random.Random
10
- import kotlin.system.getTimeMillis
11
15
16
+ @OptIn(UnsafeNumber ::class )
12
17
actual fun createTempFile (): String {
13
18
val template = " tmp-XXXXXX"
14
19
val path = mktemp(template.cstr) ? : throw IOException (" Filed to create temp file: ${strerror(errno)} " )
15
20
// mktemp don't work on MacOS 13+ (as well as mkstemp), at least the way it's expected.
16
21
if (path.toKString() == " " ) {
17
22
val tmpDir = getenv(" TMPDIR" )?.toKString() ? : getenv(" TMP" )?.toKString() ? : " "
18
- val rnd = Random (getTimeMillis( ))
23
+ val rnd = Random (time( null ))
19
24
var manuallyConstructedPath: String
20
25
do {
21
26
manuallyConstructedPath = " $tmpDir /tmp-${rnd.nextInt()} "
@@ -30,4 +35,4 @@ actual fun deleteFile(path: String) {
30
35
if (remove(path) != 0 ) {
31
36
throw IOException (" Failed to delete file $path : ${strerror(errno)?.toKString()} " )
32
37
}
33
- }
38
+ }
Original file line number Diff line number Diff line change 1
1
[versions ]
2
- kotlin = " 1.8.21 "
2
+ kotlin = " 1.9.0 "
3
3
java = " 8"
4
4
dokka = " 1.8.20"
5
5
kover = " 0.7.1"
You can’t perform that action at this time.
0 commit comments