Skip to content

Commit

Permalink
Use CIO Engine, Fix JS Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gmitch215 committed Dec 21, 2024
1 parent 9a12609 commit 443f533
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
39 changes: 27 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
signing
}

val v = "0.1.2"
val v = "0.1.3"

group = "xyz.gmitch215"
version = "${if (project.hasProperty("snapshot")) "$v-SNAPSHOT" else v}${project.findProperty("suffix")?.toString()?.run { "-${this}" } ?: ""}"
Expand All @@ -40,29 +40,42 @@ kotlin {

jvm()
js {
nodejs {
browser {
testTask {
enabled = false
useMocha {
timeout = "10m"
}
}
}
browser {
nodejs {
testTask {
enabled = false
useMocha {
timeout = "10m"
}
}

useCommonJs()
}

binaries.executable()
generateTypeScriptDefinitions()
}
wasmJs {
browser {
testTask {
enabled = false
useMocha {
timeout = "10m"
}
}
}
nodejs {
testTask {
enabled = false
useMocha {
timeout = "10m"
}
}

useCommonJs()
}

binaries.executable()
Expand Down Expand Up @@ -121,13 +134,15 @@ kotlin {
implementation("io.ktor:ktor-client-winhttp:$ktorVersion")
}

appleMain.dependencies {
implementation("io.ktor:ktor-client-darwin:$ktorVersion")
}
val posixMain by creating {
dependsOn(commonMain.get())

linuxMain.dependencies {
implementation("io.ktor:ktor-client-curl:3.0.2")
dependencies {
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-network-tls:$ktorVersion")
}
}
listOf(appleMain, linuxMain).forEach { it.get().dependsOn(posixMain) }

jsMain.dependencies {
implementation("io.ktor:ktor-client-js:$ktorVersion")
Expand Down
20 changes: 0 additions & 20 deletions src/appleMain/kotlin/xyz/gmitch215/tabroom/util/http.apple.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package xyz.gmitch215.tabroom.util

import io.ktor.client.engine.*
import io.ktor.client.engine.curl.*
import io.ktor.client.engine.cio.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.IO

internal actual val engine: HttpClientEngine = Curl.create {
internal actual val engine: HttpClientEngine = CIO.create {
pipelining = true
dispatcher = Dispatchers.IO.limitedParallelism(PARALLEL_COUNT)

endpoint {
connectTimeout = 10000
requestTimeout = 10000
}
}

0 comments on commit 443f533

Please sign in to comment.