From 866f3d960e5253f76163809b73f8ce1875c87f6b Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 18 Sep 2023 10:11:06 +0200 Subject: [PATCH] replace HTTP server (`netty` -> `ktorcio`) --- packages/patrol/android/build.gradle | 6 +++--- .../src/main/kotlin/pl/leancode/patrol/PatrolServer.kt | 4 ++-- packages/patrol/example/android/app/build.gradle | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 9aa4b1894e..c3ad2da43e 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -66,9 +66,9 @@ android { api "androidx.test.uiautomator:uiautomator:2.2.0" implementation platform("org.http4k:http4k-bom:5.7.4.0") - implementation "org.http4k:http4k-core:5.7.4.0" - implementation "org.http4k:http4k-client-apache:5.7.4.0" - implementation "org.http4k:http4k-server-netty:5.7.4.0" + implementation "org.http4k:http4k-core" + implementation "org.http4k:http4k-client-okhttp" + implementation "org.http4k:http4k-server-ktorcio" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2" diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index bfeb11c39d..3e8d395a84 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -5,7 +5,7 @@ import com.google.common.util.concurrent.SettableFuture import org.http4k.core.ContentType import org.http4k.filter.ServerFilters import org.http4k.server.Http4kServer -import org.http4k.server.Netty +import org.http4k.server.KtorCIO import org.http4k.server.asServer import java.util.concurrent.Future @@ -29,7 +29,7 @@ class PatrolServer { .withFilter(catcher) .withFilter(printer) .withFilter(ServerFilters.SetContentType(ContentType.TEXT_PLAIN)) - .asServer(Netty(port)) + .asServer(KtorCIO(port)) .start() Logger.i("Created and started PatrolServer, port: $port") diff --git a/packages/patrol/example/android/app/build.gradle b/packages/patrol/example/android/app/build.gradle index 55bba1cac1..7cb38b0dfc 100644 --- a/packages/patrol/example/android/app/build.gradle +++ b/packages/patrol/example/android/app/build.gradle @@ -34,11 +34,11 @@ android { } //TODO verify - packagingOptions { - pickFirst "META-INF/INDEX.LIST" - pickFirst "META-INF/io.netty.versions.properties" - pickFirst "META-INF/DEPENDENCIES" - } +// packagingOptions { +// pickFirst "META-INF/INDEX.LIST" +// pickFirst "META-INF/io.netty.versions.properties" +// pickFirst "META-INF/DEPENDENCIES" +// } sourceSets { main.java.srcDirs += "src/main/kotlin"