diff --git a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/VisualGroup3D.kt b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/VisualGroup3D.kt index d7709464..ba12fef2 100644 --- a/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/VisualGroup3D.kt +++ b/dataforge-vis-spatial/src/commonMain/kotlin/hep/dataforge/vis/spatial/VisualGroup3D.kt @@ -106,7 +106,7 @@ internal class Prototypes( override var styleSheet: StyleSheet? get() = null - set(value) { + set(_) { error("Can't define stylesheet for prototypes block") } @@ -123,7 +123,7 @@ internal class Prototypes( override var properties: Config? get() = null - set(value) { + set(_) { error("Can't define properties for prototypes block") } diff --git a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/readFile.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/readFile.kt index 95e3cdb7..be567114 100644 --- a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/readFile.kt +++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/readFile.kt @@ -34,14 +34,14 @@ fun Visual3D.Companion.readFile(file: File): VisualGroup3D = when { file.name.endsWith("json.zip") -> { file.inputStream().use { val unzip = ZipInputStream(it, Charsets.UTF_8) - val text = unzip.readAllBytes().decodeToString() + val text = unzip.readBytes().decodeToString() VisualGroup3D.parseJson(text) } } file.name.endsWith("json.gz") -> { file.inputStream().use { val unzip = GZIPInputStream(it) - val text = unzip.readAllBytes().decodeToString() + val text = unzip.readBytes().decodeToString() VisualGroup3D.parseJson(text) } } diff --git a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/saveToJson.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/saveToJson.kt index f2491423..b069debe 100644 --- a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/saveToJson.kt +++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vis/spatial/gdml/demo/saveToJson.kt @@ -5,6 +5,7 @@ import hep.dataforge.vis.spatial.VisualGroup3D import hep.dataforge.vis.spatial.gdml.LUnit import hep.dataforge.vis.spatial.gdml.readFile import hep.dataforge.vis.spatial.gdml.toVisual +import hep.dataforge.vis.spatial.stringify import scientifik.gdml.GDML import java.io.File import java.nio.file.Paths @@ -14,6 +15,6 @@ fun main() { val visual = gdml.toVisual { lUnit = LUnit.CM } - val json = Visual3D.json.stringify(VisualGroup3D.serializer(), visual) + val json = visual.stringify() File("D:\\Work\\Projects\\gdml.kt\\gdml-source\\cubes.json").writeText(json) } \ No newline at end of file diff --git a/demo/gdml/src/jvmTest/kotlin/hep/dataforge/vis/spatial/FileSerializationTest.kt b/demo/gdml/src/jvmTest/kotlin/hep/dataforge/vis/spatial/FileSerializationTest.kt index 672b041f..af51354b 100644 --- a/demo/gdml/src/jvmTest/kotlin/hep/dataforge/vis/spatial/FileSerializationTest.kt +++ b/demo/gdml/src/jvmTest/kotlin/hep/dataforge/vis/spatial/FileSerializationTest.kt @@ -8,7 +8,7 @@ class FileSerializationTest { @Test @Ignore fun testFileRead(){ - val text = this::class.java.getResourceAsStream("/cubes.json").readAllBytes().decodeToString() + val text = this::class.java.getResourceAsStream("/cubes.json").readBytes().decodeToString() val visual = VisualGroup3D.parseJson(text) visual["composite_001".asName()] } diff --git a/demo/muon-monitor/build.gradle.kts b/demo/muon-monitor/build.gradle.kts index c5692be4..53a05cd7 100644 --- a/demo/muon-monitor/build.gradle.kts +++ b/demo/muon-monitor/build.gradle.kts @@ -15,7 +15,7 @@ kotlin { jvm { withJava() - compilations.findByName("main").apply { + compilations.findByName("jvmMain").apply { tasks.getByName("jvmProcessResources") { dependsOn(installJS) afterEvaluate { diff --git a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt index 5a8ef3e6..72656f95 100644 --- a/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt +++ b/demo/muon-monitor/src/jsMain/kotlin/ru/mipt/npm/muon/monitor/MMDemoApp.kt @@ -28,6 +28,7 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import kotlinx.html.js.button import kotlinx.html.js.onClickFunction +import kotlinx.serialization.json.Json import org.w3c.dom.HTMLElement import kotlin.browser.document import kotlin.dom.clear @@ -38,7 +39,7 @@ private class MMDemoApp : Application { private val connection = HttpClient { install(JsonFeature) { - serializer = KotlinxSerializer(Visual3D.json) + serializer = KotlinxSerializer(Json(context = Visual3D.serialModule)) } } diff --git a/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt b/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt index 5cb275e1..4a12869f 100644 --- a/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt +++ b/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/readResource.kt @@ -1,7 +1,7 @@ package ru.mipt.npm.muon.monitor actual fun readResource(path: String): String { - return ClassLoader.getSystemClassLoader().getResourceAsStream(path)?.readAllBytes()?.decodeToString() + return ClassLoader.getSystemClassLoader().getResourceAsStream(path)?.readBytes()?.decodeToString() ?: error("Resource '$path' not found") } diff --git a/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/server/MMServer.kt b/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/server/MMServer.kt index 955ff67c..0cf95aa1 100644 --- a/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/server/MMServer.kt +++ b/demo/muon-monitor/src/jvmMain/kotlin/ru/mipt/npm/muon/monitor/server/MMServer.kt @@ -35,7 +35,7 @@ fun Application.module() { install(DefaultHeaders) install(CallLogging) install(ContentNegotiation) { - json(json = Visual3D.json) + json(module = Visual3D.serialModule) } install(Routing) { get("/event") { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index cc4fdc29..490fda85 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 94920145..a4b44297 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.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d9..62bd9b9c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"