Fix build, update versions

This commit is contained in:
Alexander Nozik 2022-02-20 17:26:01 +03:00
parent 917b043b21
commit e89dff2975
9 changed files with 94 additions and 23 deletions

View File

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

View File

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

View File

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

View 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)
}

View File

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

View File

@ -1,6 +1,5 @@
plugins { plugins {
kotlin("multiplatform") id("ru.mipt.npm.gradle.mpp")
id("ru.mipt.npm.gradle.common")
`maven-publish` `maven-publish`
} }

View File

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

View File

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