Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/android buildtime bug #1708

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/patrol/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ 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-server-ktorcio"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package pl.leancode.patrol

import org.apache.hc.core5.util.Timeout
import pl.leancode.patrol.contracts.Contracts
import pl.leancode.patrol.contracts.PatrolAppServiceClientException
import java.util.concurrent.TimeUnit
import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client

/**
Expand All @@ -13,15 +13,16 @@ class PatrolAppServiceClient {
private var client: Client

// https://github.com/leancodepl/patrol/issues/1683
private val timeout = Timeout.ofHours(2)
private val timeout = 2L
private val timeUnit = TimeUnit.HOURS

constructor() {
client = Client(address = "localhost", port = 8082, timeout = timeout)
client = Client(address = "localhost", port = 8082)
Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}")
}

constructor(address: String) {
client = Client(address = address, port = 8082, timeout = timeout)
client = Client(address = address, port = 8082)
Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions packages/patrol/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}

//TODO verify
packagingOptions {
pickFirst "META-INF/INDEX.LIST"
pickFirst "META-INF/io.netty.versions.properties"
pickFirst "META-INF/DEPENDENCIES"
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
Expand Down
Loading