Fix build, update versions
This commit is contained in:
parent
917b043b21
commit
e89dff2975
@ -1,15 +0,0 @@
|
|||||||
plugins {
|
|
||||||
`kotlin-dsl`
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("https://repo.kotlin.link")
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
api("com.squareup.wire:wire-gradle-plugin:3.7.1")
|
|
||||||
api("ru.mipt.npm:gradle-tools:0.10.7")
|
|
||||||
}
|
|
15
gradle.properties
Normal file
15
gradle.properties
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2018-2021 KMath contributors.
|
||||||
|
# Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
#
|
||||||
|
|
||||||
|
kotlin.code.style=official
|
||||||
|
kotlin.mpp.stability.nowarn=true
|
||||||
|
|
||||||
|
kotlin.jupyter.add.scanner=false
|
||||||
|
|
||||||
|
org.gradle.configureondemand=true
|
||||||
|
org.gradle.parallel=true
|
||||||
|
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1G
|
||||||
|
|
||||||
|
toolsVersion=0.11.1-kotlin-1.6.10
|
@ -1,7 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
id("ru.mipt.npm.gradle.common")
|
id("ru.mipt.npm.gradle.common")
|
||||||
id("com.squareup.wire")
|
id("com.squareup.wire") version "4.2.0"
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import space.kscience.dataforge.names.plus
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
internal class TaggedNumassEnvelopeFormat(private val io: IOPlugin) : EnvelopeFormat {
|
public class TaggedNumassEnvelopeFormat(private val io: IOPlugin) : EnvelopeFormat {
|
||||||
|
|
||||||
private fun Tag.toBinary() = Binary(24) {
|
private fun Tag.toBinary() = Binary(24) {
|
||||||
writeRawString(START_SEQUENCE)
|
writeRawString(START_SEQUENCE)
|
||||||
|
12
numass-detector-client/build.gradle.kts
Normal file
12
numass-detector-client/build.gradle.kts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
plugins {
|
||||||
|
id("ru.mipt.npm.gradle.jvm")
|
||||||
|
}
|
||||||
|
|
||||||
|
val dataforgeVersion: String by rootProject.extra
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
||||||
|
// implementation("io.ktor:ktor-client-logging:$ktorVersion")
|
||||||
|
implementation(npmlibs.ktor.client.cio)
|
||||||
|
api(projects.numassDataProto)
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package ru.inr.mass.detector
|
||||||
|
|
||||||
|
import io.ktor.network.selector.ActorSelectorManager
|
||||||
|
import io.ktor.network.sockets.*
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import ru.inr.mass.data.proto.TaggedNumassEnvelopeFormat
|
||||||
|
import space.kscience.dataforge.context.Context
|
||||||
|
import space.kscience.dataforge.context.ContextAware
|
||||||
|
import space.kscience.dataforge.io.*
|
||||||
|
import space.kscience.dataforge.meta.MutableMeta
|
||||||
|
import java.net.InetSocketAddress
|
||||||
|
|
||||||
|
public class DetectorClient(override val context: Context) : ContextAware {
|
||||||
|
private val format: EnvelopeFormat = TaggedNumassEnvelopeFormat(context.io)
|
||||||
|
|
||||||
|
private var connection: Connection? = null
|
||||||
|
|
||||||
|
private suspend fun request(metaBuilder: MutableMeta.() -> Unit): Envelope {
|
||||||
|
return connection?.let { connection ->
|
||||||
|
// val requestEnvelope = Envelope {
|
||||||
|
// meta(metaBuilder)
|
||||||
|
// }
|
||||||
|
// val request = format.toBinary(requestEnvelope).toByteArray()
|
||||||
|
// connection.output.writeAvailable(request)
|
||||||
|
// val response = connection.input.read
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
connection.output.цкasOut
|
||||||
|
} ?: error("Not connected")
|
||||||
|
}
|
||||||
|
|
||||||
|
public suspend fun connect(host: String, port: Int) {
|
||||||
|
connection = aSocket(ActorSelectorManager(Dispatchers.IO))
|
||||||
|
.tcp().connect(InetSocketAddress(host, port)).connection()
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform")
|
id("ru.mipt.npm.gradle.mpp")
|
||||||
id("ru.mipt.npm.gradle.common")
|
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ kotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val dataforgeVersion: String by rootProject.extra
|
val dataforgeVersion: String by rootProject.extra
|
||||||
val plotlyVersion: String by rootProject.extra
|
val plotlyVersion: String by rootProject.extra("0.5.0")
|
||||||
val kmathVersion: String by rootProject.extra
|
val kmathVersion: String by rootProject.extra
|
||||||
val tablesVersion: String by rootProject.extra
|
val tablesVersion: String by rootProject.extra
|
||||||
|
|
||||||
|
@ -1,7 +1,29 @@
|
|||||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||||
enableFeaturePreview("VERSION_CATALOGS")
|
enableFeaturePreview("VERSION_CATALOGS")
|
||||||
|
|
||||||
|
pluginManagement {
|
||||||
|
|
||||||
|
val toolsVersion: String by extra
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
maven("https://repo.kotlin.link")
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("ru.mipt.npm.gradle.project") version toolsVersion
|
||||||
|
id("ru.mipt.npm.gradle.mpp") version toolsVersion
|
||||||
|
id("ru.mipt.npm.gradle.jvm") version toolsVersion
|
||||||
|
id("ru.mipt.npm.gradle.js") version toolsVersion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
|
|
||||||
|
val toolsVersion: String by extra
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven("https://repo.kotlin.link")
|
maven("https://repo.kotlin.link")
|
||||||
@ -9,8 +31,8 @@ dependencyResolutionManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
versionCatalogs {
|
versionCatalogs {
|
||||||
create("npm") {
|
create("npmlibs") {
|
||||||
from("ru.mipt.npm:version-catalog:0.10.7")
|
from("ru.mipt.npm:version-catalog:$toolsVersion")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,5 +43,6 @@ include(
|
|||||||
":numass-data-proto",
|
":numass-data-proto",
|
||||||
//":numass-data-server",
|
//":numass-data-server",
|
||||||
":numass-workspace",
|
":numass-workspace",
|
||||||
":numass-model"
|
":numass-model",
|
||||||
|
//":numass-detector-client"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user