@@ -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}
0 commit comments