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 dataforgeVersion: String by extra("0.2.1-dev-2")
val ktorVersion: String by extra("1.4.3") val ktorVersion: String by extra("1.5.0")
val rsocketVersion by extra("0.11.1") val rsocketVersion by extra("0.12.0")
allprojects { allprojects {
repositories { repositories {
mavenLocal() mavenLocal()
maven("https://dl.bintray.com/pdvrieze/maven") //maven("https://dl.bintray.com/pdvrieze/maven")
maven("http://maven.jzy3d.org/releases") //maven("http://maven.jzy3d.org/releases")
maven("https://kotlin.bintray.com/js-externals") maven("https://kotlin.bintray.com/js-externals")
maven("https://maven.pkg.github.com/altavir/kotlin-logging/") maven("https://maven.pkg.github.com/altavir/kotlin-logging/")
maven("https://dl.bintray.com/rsocket-admin/RSocket") //maven("https://dl.bintray.com/rsocket-admin/RSocket")
maven("https://maven.pkg.github.com/altavir/ktor-client-sse") //maven("https://maven.pkg.github.com/altavir/ktor-client-sse")
} }
group = "hep.dataforge" group = "hep.dataforge"
@ -24,7 +24,7 @@ allprojects {
} }
ksciencePublish { ksciencePublish {
githubProject = "dataforge-control" githubProject = "controls.kt"
bintrayRepo = "dataforge" bintrayRepo = "dataforge"
} }

View File

@ -20,7 +20,7 @@ public class DeviceManager : AbstractPlugin(), DeviceHub {
override val devices: Map<NameToken, Device> get() = top override val devices: Map<NameToken, Device> get() = top
public val controller: HubController by lazy { public val controller: HubController by lazy {
HubController(this, context) HubController(this)
} }
public fun registerDevice(name: NameToken, device: Device) { 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 // //Check if application supports websockets and if it does add a push channel
if (this.application.featureOrNull(WebSockets) != null) { // if (this.application.featureOrNull(WebSockets) != null) {
webSocket("ws") { // webSocket("ws") {
//subscribe on device // //subscribe on device
val target: String? by call.request.queryParameters // val target: String? by call.request.queryParameters
//
try { // try {
application.log.debug("Opened server socket for ${call.request.queryParameters}") // application.log.debug("Opened server socket for ${call.request.queryParameters}")
//
manager.controller.envelopeOutput().collect { // manager.controller.envelopeOutput().collect {
outgoing.send(it.toFrame()) // outgoing.send(it.toFrame())
} // }
//
} catch (ex: Exception) { // } catch (ex: Exception) {
application.log.debug("Closed server socket for ${call.request.queryParameters}") // application.log.debug("Closed server socket for ${call.request.queryParameters}")
} // }
} // }
} // }
post("message") { post("message") {
val body = call.receiveText() val body = call.receiveText()

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

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

View File

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

View File

@ -1,6 +1,6 @@
pluginManagement { pluginManagement {
val kotlinVersion = "1.4.20" val kotlinVersion = "1.4.21"
val toolsVersion = "0.7.0" val toolsVersion = "0.7.1"
repositories { repositories {
mavenLocal() mavenLocal()
@ -24,20 +24,20 @@ pluginManagement {
} }
} }
rootProject.name = "dataforge-control" rootProject.name = "controls.kt"
include( include(
":dataforge-device-core", ":dataforge-device-core",
":dataforge-device-tcp", ":dataforge-device-tcp",
":dataforge-device-serial", ":dataforge-device-serial",
":dataforge-device-server", ":dataforge-device-server",
":dataforge-magix-client",
":motors",
":demo", ":demo",
":magix", ":magix",
":magix:magix-api", ":magix:magix-api",
":magix:magix-server", ":magix:magix-server",
":magix:magix-service" ":magix:magix-service",
":dataforge-magix-client",
":motors"
) )
//includeBuild("../dataforge-core") //includeBuild("../dataforge-core")