File tree Expand file tree Collapse file tree 9 files changed +119
-2
lines changed
build-logic/src/main/kotlin/kotlinx/io/conventions Expand file tree Collapse file tree 9 files changed +119
-2
lines changed Original file line number Diff line number Diff line change 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.9.0 -blue.svg?logo=kotlin )] ( http://kotlinlang.org )
7+ [ ![ Kotlin] ( https://img.shields.io/badge/kotlin-1.9.10 -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
Original file line number Diff line number Diff line change 55
66import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
77import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
8+ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
89import kotlin.jvm.optionals.getOrNull
910
1011plugins {
@@ -36,6 +37,14 @@ kotlin {
3637 }
3738 }
3839
40+ @OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl ::class )
41+ wasm {
42+ nodejs()
43+ // Disabled because we can't exclude some tests: https://youtrack.jetbrains.com/issue/KT-58291
44+ // browser()
45+ binaries.executable()
46+ }
47+
3948 sourceSets {
4049 commonTest {
4150 dependencies {
@@ -163,3 +172,7 @@ fun androidTargets() = listOf(
163172 " androidNativeX64" ,
164173 " androidNativeX86"
165174)
175+
176+ rootProject.the<NodeJsRootExtension >().apply {
177+ nodeVersion = " 20.4.0"
178+ }
Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ kotlin {
3131 }
3232 }
3333
34+ @OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl ::class )
35+ wasm {
36+ nodejs {
37+ testTask(Action {
38+ useMocha {
39+ timeout = " 300s"
40+ }
41+ filter.setExcludePatterns(" *SmokeFileTest*" )
42+ })
43+ }
44+ }
45+
3446 sourceSets {
3547 commonMain {
3648 dependencies {
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io
7+
8+ import kotlinx.io.internal.commonAsUtf8ToByteArray
9+
10+ internal actual fun String.asUtf8ToByteArray (): ByteArray = commonAsUtf8ToByteArray()
11+
12+ public actual open class IOException actual constructor(
13+ message : String? ,
14+ cause : Throwable ?
15+ ) : Exception(message, cause) {
16+ public actual constructor (message: String? ) : this (message, null )
17+ }
18+
19+ public actual open class EOFException actual constructor(message : String? ) : IOException(message)
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io
7+
8+ @OptIn(ExperimentalStdlibApi ::class )
9+ public actual interface RawSink : AutoCloseableAlias {
10+ public actual fun write (source : Buffer , byteCount : Long )
11+
12+ public actual fun flush ()
13+
14+ actual override fun close ()
15+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io
7+
8+ internal actual object SegmentPool {
9+ actual val MAX_SIZE : Int = 0
10+
11+ actual val byteCount: Int = 0
12+
13+ actual fun take (): Segment = Segment ()
14+
15+ actual fun recycle (segment : Segment ) {
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io.files
7+
8+ import kotlinx.io.Sink
9+ import kotlinx.io.Source
10+
11+
12+ public actual class Path internal constructor(private val path : String ,
13+ @Suppress(" UNUSED_PARAMETER" ) any : Any? ) {
14+ override fun toString (): String = path
15+ }
16+
17+ public actual fun Path (path : String ): Path {
18+ return Path (path, null )
19+ }
20+
21+ public actual fun Path.source (): Source {
22+ TODO (" Paths are not supported for Wasm target" )
23+ }
24+
25+ public actual fun Path.sink (): Sink {
26+ TODO (" Paths are not supported for Wasm target" )
27+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+ */
5+
6+ package kotlinx.io
7+
8+ actual fun createTempFile (): String {
9+ TODO (" Paths are not supported for Wasm target" )
10+ }
11+
12+ actual fun deleteFile (path : String ) {
13+ TODO (" Paths are not supported for Wasm target" )
14+ }
Original file line number Diff line number Diff line change 11[versions ]
2- kotlin = " 1.9.0 "
2+ kotlin = " 1.9.10 "
33java = " 8"
44dokka = " 1.8.20"
55kover = " 0.7.3"
You can’t perform that action at this time.
0 commit comments