1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Update the client.

This commit is contained in:
Cedric Beust 2016-06-22 01:29:29 -08:00
parent 1745194f5f
commit 09dcd84f79

View file

@ -53,7 +53,7 @@ class KobaltWebSocketClient : Runnable {
val client = OkHttpClient()
val request = Request.Builder()
// .url("ws://echo.websocket.org")
.url("ws://localhost:1234/v1/getDependencies?buildFile=/Users/beust/kotlin/kobalt/kobalt/src/Build.kt")
.url("ws://localhost:1238/v1/getDependencies?buildFile=/Users/beust/kotlin/kobalt/kobalt/src/Build.kt")
.build()
var webSocket: WebSocket? = null
val ws = WebSocketCall.create(client, request).enqueue(object: WebSocketListener {
@ -82,7 +82,8 @@ class KobaltWebSocketClient : Runnable {
} else {
if (wsCommand.commandName == DependencyData.GetDependenciesData.NAME) {
val dd = Gson().fromJson(wsCommand.payload, DependencyData.GetDependenciesData::class.java)
println("Received dependency data: " + dd.projects.size + " projects")
println("Received dependency data: " + dd.projects.size + " projects"
+ " error: " + dd.errorMessage)
} else if (wsCommand.commandName == ProgressCommand.NAME) {
val progress = Gson().fromJson(wsCommand.payload, ProgressCommand::class.java)
println(progress.message + (progress.progress ?: ""))