Skip to content

Commit f131756

Browse files
committed
Migrate testtool to ktor 3.0.0
1 parent 3dd6269 commit f131756

File tree

3 files changed

+18
-33
lines changed

3 files changed

+18
-33
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ kotlinx-kover = "0.8.3"
99
kotlinx-io = "0.5.4"
1010
kotlinx-serialization = "1.7.3"
1111
kotlinx-coroutines = "1.9.0"
12-
ktor = "2.3.12"
12+
ktor = "3.0.0"
1313

1414
# android
1515
android = "8.5.0"
@@ -21,7 +21,7 @@ maven-publish = "0.29.0"
2121

2222
# other
2323
bouncycastle = "1.78.1"
24-
logback = "1.2.11"
24+
logback = "1.5.9"
2525

2626
[libraries]
2727
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }

testtool/client/build.gradle.kts

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ kotlin {
2121
browser()
2222
}
2323
wasmJs {
24-
// No support from KTOR
2524
nodejs()
2625
browser()
2726
}
@@ -33,6 +32,7 @@ kotlin {
3332
watchosX64()
3433
watchosArm32()
3534
watchosArm64()
35+
watchosDeviceArm64()
3636
watchosSimulatorArm64()
3737

3838
tvosX64()
@@ -46,20 +46,16 @@ kotlin {
4646
linuxArm64()
4747
mingwX64()
4848

49-
// No support from KTOR
50-
watchosDeviceArm64()
49+
// No support from KTOR (TBD: problem with publication)
5150
androidNativeX64()
5251
androidNativeX86()
5352
androidNativeArm64()
5453
androidNativeArm32()
5554

5655
val supportsKtor: (KotlinCompilation<*>).() -> Boolean = {
57-
val konanTarget = (target as? KotlinNativeTarget)?.konanTarget
5856
when {
59-
konanTarget == KonanTarget.WATCHOS_DEVICE_ARM64 -> false
60-
konanTarget?.family == Family.ANDROID -> false
61-
platformType == KotlinPlatformType.wasm -> false
62-
else -> true
57+
(target as? KotlinNativeTarget)?.konanTarget?.family == Family.ANDROID -> false
58+
else -> true
6359
}
6460
}
6561

@@ -71,21 +67,20 @@ kotlin {
7167
}
7268
group("ktor") {
7369
withCompilations(supportsKtor)
74-
}
75-
group("nonKtor") {
76-
withCompilations { !supportsKtor(it) }
77-
}
78-
group("cio") {
79-
withCompilations {
80-
val target = (it.target as? KotlinNativeTarget)?.konanTarget
81-
when {
82-
target == KonanTarget.WATCHOS_DEVICE_ARM64 -> false
83-
target?.family?.isAppleFamily == true -> true
84-
target?.family == Family.LINUX -> true
85-
else -> false
70+
71+
group("cio") {
72+
withCompilations {
73+
it.supportsKtor() && it.platformType in setOf(
74+
KotlinPlatformType.jvm,
75+
KotlinPlatformType.androidJvm,
76+
KotlinPlatformType.native,
77+
)
8678
}
8779
}
8880
}
81+
group("nonKtor") {
82+
withCompilations { !it.supportsKtor() }
83+
}
8984
}
9085
}
9186

@@ -100,20 +95,10 @@ kotlin {
10095
implementation(libs.ktor.client.core)
10196
}
10297
}
103-
val jvmMain by getting {
104-
dependencies {
105-
implementation(libs.ktor.client.okhttp)
106-
}
107-
}
10898
val cioMain by getting {
10999
dependencies {
110100
implementation(libs.ktor.client.cio)
111101
}
112102
}
113-
val mingwMain by getting {
114-
dependencies {
115-
implementation(libs.ktor.client.winhttp)
116-
}
117-
}
118103
}
119104
}

testtool/server/src/main/kotlin/TesttoolServer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package dev.whyoleg.cryptography.testtool.server
77
import io.ktor.server.application.*
88
import io.ktor.server.engine.*
99
import io.ktor.server.netty.*
10-
import io.ktor.server.plugins.callloging.*
10+
import io.ktor.server.plugins.calllogging.*
1111
import io.ktor.server.plugins.cors.routing.*
1212
import io.ktor.server.routing.*
1313
import java.io.*

0 commit comments

Comments
 (0)