fix build inconsistencies

This commit is contained in:
Alexander Nozik 2021-01-10 18:41:52 +03:00
parent 93c82db08e
commit 65acfe824b
7 changed files with 35 additions and 34 deletions

View File

@ -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"
}

View File

@ -20,7 +20,7 @@ public class DeviceManager : AbstractPlugin(), DeviceHub {
override val devices: Map<NameToken, Device> get() = top
public val controller: HubController by lazy {
HubController(this, context)
HubController(this)
}
public fun registerDevice(name: NameToken, device: Device) {

View File

@ -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()

View File

@ -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

View File

@ -4,6 +4,7 @@ plugins {
}
kscience {
useCoroutines()
useSerialization{
json()
}

View File

@ -52,7 +52,7 @@ internal fun CoroutineScope.magixAcceptor(magixFlow: MutableSharedFlow<GenericMa
magixFlow.emit(message)
}
// bi-directional connection
requestChannel { input: Flow<Payload> ->
requestChannel { _: Payload, input: Flow<Payload> ->
input.onEach {
magixFlow.emit(magixJson.decodeFromString(genericMessageSerializer, it.data.readText()))
}.launchIn(this@magixAcceptor)

View File

@ -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")