From 65acfe824b698c22cfbcf9947d419ad522b134f4 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 10 Jan 2021 18:41:52 +0300 Subject: [PATCH] fix build inconsistencies --- build.gradle.kts | 14 ++++---- .../control/controllers/DeviceManager.kt | 2 +- .../control/server/deviceWebServer.kt | 36 +++++++++---------- gradle/wrapper/gradle-wrapper.properties | 2 +- magix/magix-api/build.gradle.kts | 1 + .../hep/dataforge/magix/server/magixModule.kt | 2 +- settings.gradle.kts | 12 +++---- 7 files changed, 35 insertions(+), 34 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0b9825b..f28deb6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,18 +5,18 @@ plugins { } val dataforgeVersion: String by extra("0.2.1-dev-2") -val ktorVersion: String by extra("1.4.3") -val rsocketVersion by extra("0.11.1") +val ktorVersion: String by extra("1.5.0") +val rsocketVersion by extra("0.12.0") allprojects { repositories { mavenLocal() - maven("https://dl.bintray.com/pdvrieze/maven") - maven("http://maven.jzy3d.org/releases") + //maven("https://dl.bintray.com/pdvrieze/maven") + //maven("http://maven.jzy3d.org/releases") maven("https://kotlin.bintray.com/js-externals") maven("https://maven.pkg.github.com/altavir/kotlin-logging/") - maven("https://dl.bintray.com/rsocket-admin/RSocket") - maven("https://maven.pkg.github.com/altavir/ktor-client-sse") + //maven("https://dl.bintray.com/rsocket-admin/RSocket") + //maven("https://maven.pkg.github.com/altavir/ktor-client-sse") } group = "hep.dataforge" @@ -24,7 +24,7 @@ allprojects { } ksciencePublish { - githubProject = "dataforge-control" + githubProject = "controls.kt" bintrayRepo = "dataforge" } diff --git a/dataforge-device-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceManager.kt b/dataforge-device-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceManager.kt index 11a2399..d434819 100644 --- a/dataforge-device-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceManager.kt +++ b/dataforge-device-core/src/commonMain/kotlin/hep/dataforge/control/controllers/DeviceManager.kt @@ -20,7 +20,7 @@ public class DeviceManager : AbstractPlugin(), DeviceHub { override val devices: Map get() = top public val controller: HubController by lazy { - HubController(this, context) + HubController(this) } public fun registerDevice(name: NameToken, device: Device) { diff --git a/dataforge-device-server/src/main/kotlin/hep/dataforge/control/server/deviceWebServer.kt b/dataforge-device-server/src/main/kotlin/hep/dataforge/control/server/deviceWebServer.kt index 9dc39e2..55cfba5 100644 --- a/dataforge-device-server/src/main/kotlin/hep/dataforge/control/server/deviceWebServer.kt +++ b/dataforge-device-server/src/main/kotlin/hep/dataforge/control/server/deviceWebServer.kt @@ -163,24 +163,24 @@ public fun Application.deviceModule( } } } - //Check if application supports websockets and if it does add a push channel - if (this.application.featureOrNull(WebSockets) != null) { - webSocket("ws") { - //subscribe on device - val target: String? by call.request.queryParameters - - try { - application.log.debug("Opened server socket for ${call.request.queryParameters}") - - manager.controller.envelopeOutput().collect { - outgoing.send(it.toFrame()) - } - - } catch (ex: Exception) { - application.log.debug("Closed server socket for ${call.request.queryParameters}") - } - } - } +// //Check if application supports websockets and if it does add a push channel +// if (this.application.featureOrNull(WebSockets) != null) { +// webSocket("ws") { +// //subscribe on device +// val target: String? by call.request.queryParameters +// +// try { +// application.log.debug("Opened server socket for ${call.request.queryParameters}") +// +// manager.controller.envelopeOutput().collect { +// outgoing.send(it.toFrame()) +// } +// +// } catch (ex: Exception) { +// application.log.debug("Closed server socket for ${call.request.queryParameters}") +// } +// } +// } post("message") { val body = call.receiveText() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d9ca16..da9702f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/magix/magix-api/build.gradle.kts b/magix/magix-api/build.gradle.kts index 0b5a962..9babc42 100644 --- a/magix/magix-api/build.gradle.kts +++ b/magix/magix-api/build.gradle.kts @@ -4,6 +4,7 @@ plugins { } kscience { + useCoroutines() useSerialization{ json() } diff --git a/magix/magix-server/src/main/kotlin/hep/dataforge/magix/server/magixModule.kt b/magix/magix-server/src/main/kotlin/hep/dataforge/magix/server/magixModule.kt index 2204a02..18744b1 100644 --- a/magix/magix-server/src/main/kotlin/hep/dataforge/magix/server/magixModule.kt +++ b/magix/magix-server/src/main/kotlin/hep/dataforge/magix/server/magixModule.kt @@ -52,7 +52,7 @@ internal fun CoroutineScope.magixAcceptor(magixFlow: MutableSharedFlow -> + requestChannel { _: Payload, input: Flow -> input.onEach { magixFlow.emit(magixJson.decodeFromString(genericMessageSerializer, it.data.readText())) }.launchIn(this@magixAcceptor) diff --git a/settings.gradle.kts b/settings.gradle.kts index c93b84c..d08689d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { - val kotlinVersion = "1.4.20" - val toolsVersion = "0.7.0" + val kotlinVersion = "1.4.21" + val toolsVersion = "0.7.1" repositories { mavenLocal() @@ -24,20 +24,20 @@ pluginManagement { } } -rootProject.name = "dataforge-control" +rootProject.name = "controls.kt" include( ":dataforge-device-core", ":dataforge-device-tcp", ":dataforge-device-serial", ":dataforge-device-server", - ":dataforge-magix-client", - ":motors", ":demo", ":magix", ":magix:magix-api", ":magix:magix-server", - ":magix:magix-service" + ":magix:magix-service", + ":dataforge-magix-client", + ":motors" ) //includeBuild("../dataforge-core")