From 730ac69544fb26b8b350c7da28e8414bda4dc649 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 5 Feb 2021 09:49:35 +0300 Subject: [PATCH 1/2] build tools 0.7.5 and JVM-IR --- .../kotlin/hep/dataforge/properties/bindings.kt | 4 ++-- dataforge-io/dataforge-io-yaml/build.gradle.kts | 15 +++++++++------ .../io/yaml/FrontMatterEnvelopeFormat.kt | 5 ++--- .../hep/dataforge/io/yaml/YamlMetaFormat.kt | 7 +++---- .../hep/dataforge/io/yaml/YamlMetaFormatTest.kt | 0 .../kotlin/hep/dataforge/io/FileBinaryTest.kt | 2 +- .../kotlin/hep/dataforge/io/FileEnvelopeTest.kt | 4 ++-- settings.gradle.kts | 4 ++-- 8 files changed, 21 insertions(+), 20 deletions(-) rename dataforge-io/dataforge-io-yaml/src/{commonMain => jvmMain}/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt (97%) rename dataforge-io/dataforge-io-yaml/src/{commonMain => jvmMain}/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt (94%) rename dataforge-io/dataforge-io-yaml/src/{commonTest => jvmTest}/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt (100%) diff --git a/dataforge-context/src/jsMain/kotlin/hep/dataforge/properties/bindings.kt b/dataforge-context/src/jsMain/kotlin/hep/dataforge/properties/bindings.kt index 05818cae..7ef8d72d 100644 --- a/dataforge-context/src/jsMain/kotlin/hep/dataforge/properties/bindings.kt +++ b/dataforge-context/src/jsMain/kotlin/hep/dataforge/properties/bindings.kt @@ -4,7 +4,7 @@ import hep.dataforge.meta.DFExperimental import org.w3c.dom.HTMLInputElement @DFExperimental -fun HTMLInputElement.bindValue(property: Property) { +public fun HTMLInputElement.bindValue(property: Property) { if (this.onchange != null) error("Input element already bound") this.onchange = { property.value = this.value @@ -18,7 +18,7 @@ fun HTMLInputElement.bindValue(property: Property) { } @DFExperimental -fun HTMLInputElement.bindChecked(property: Property) { +public fun HTMLInputElement.bindChecked(property: Property) { if (this.onchange != null) error("Input element already bound") this.onchange = { property.value = this.checked diff --git a/dataforge-io/dataforge-io-yaml/build.gradle.kts b/dataforge-io/dataforge-io-yaml/build.gradle.kts index b8ce9caf..d325a8c8 100644 --- a/dataforge-io/dataforge-io-yaml/build.gradle.kts +++ b/dataforge-io/dataforge-io-yaml/build.gradle.kts @@ -1,14 +1,10 @@ plugins { id("ru.mipt.npm.mpp") - id("ru.mipt.npm.native") +// id("ru.mipt.npm.native") } description = "YAML meta IO" -repositories{ - jcenter() -} - kscience { useSerialization{ yamlKt() @@ -20,8 +16,15 @@ kotlin { commonMain{ dependencies { api(project(":dataforge-io")) -// api("net.mamoe.yamlkt:yamlkt:${ru.mipt.npm.gradle.KScienceVersions.Serialization.yamlKtVersion}") + //api("net.mamoe.yamlkt:yamlkt:${ru.mipt.npm.gradle.KScienceVersions.Serialization.yamlKtVersion}") } } } } + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE + description =""" + YAML meta converters and Front Matter envelope format + """.trimIndent() +} diff --git a/dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt b/dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt similarity index 97% rename from dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt rename to dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt index 254234dd..69100422 100644 --- a/dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt +++ b/dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt @@ -17,8 +17,7 @@ public class FrontMatterEnvelopeFormat( ) : EnvelopeFormat { override fun readPartial(input: Input): PartialEnvelope { - @Suppress("VARIABLE_WITH_REDUNDANT_INITIALIZER") - var line = "" + var line: String var offset = 0u do { line = input.readUtf8Line() //?: error("Input does not contain front matter separator") @@ -44,7 +43,7 @@ public class FrontMatterEnvelopeFormat( } override fun readObject(input: Input): Envelope { - var line = "" + var line: String do { line = input.readUtf8Line() //?: error("Input does not contain front matter separator") } while (!line.startsWith(SEPARATOR)) diff --git a/dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt b/dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt similarity index 94% rename from dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt rename to dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt index e63a3b3e..160683a6 100644 --- a/dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt +++ b/dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt @@ -86,16 +86,15 @@ public fun YamlMap.toMeta(): Meta = YamlMeta(this) */ @DFExperimental public class YamlMetaFormat(private val meta: Meta) : MetaFormat { - private val coder = Yaml.default override fun writeMeta(output: Output, meta: Meta, descriptor: NodeDescriptor?) { val yaml = meta.toYaml() - val string = coder.encodeToString(yaml) + val string = Yaml.encodeToString(yaml) output.writeUtf8String(string) } override fun readMeta(input: Input, descriptor: NodeDescriptor?): Meta { - val yaml = coder.decodeYamlMapFromString(input.readUtf8String()) + val yaml = Yaml.decodeYamlMapFromString(input.readUtf8String()) return yaml.toMeta() } @@ -116,7 +115,7 @@ public class YamlMetaFormat(private val meta: Meta) : MetaFormat { override fun writeMeta(output: Output, meta: Meta, descriptor: NodeDescriptor?): Unit = default.writeMeta(output, meta, descriptor) - override fun readMeta(input: kotlinx.io.Input, descriptor: NodeDescriptor?): Meta = + override fun readMeta(input: Input, descriptor: NodeDescriptor?): Meta = default.readMeta(input, descriptor) } } \ No newline at end of file diff --git a/dataforge-io/dataforge-io-yaml/src/commonTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt b/dataforge-io/dataforge-io-yaml/src/jvmTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt similarity index 100% rename from dataforge-io/dataforge-io-yaml/src/commonTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt rename to dataforge-io/dataforge-io-yaml/src/jvmTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt diff --git a/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileBinaryTest.kt b/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileBinaryTest.kt index 7ccc65e7..4971bf6c 100644 --- a/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileBinaryTest.kt +++ b/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileBinaryTest.kt @@ -54,7 +54,7 @@ class FileBinaryTest { val tmpPath = Files.createTempFile("dataforge_test", ".df") Global.io.writeEnvelopeFile(tmpPath, envelope) - val binary = Global.io.readEnvelopeFile(tmpPath)?.data!! + val binary = Global.io.readEnvelopeFile(tmpPath).data!! assertEquals(binary.size, binary.toByteArray().size) } } \ No newline at end of file diff --git a/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileEnvelopeTest.kt b/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileEnvelopeTest.kt index 8db2bf62..ab96c324 100644 --- a/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileEnvelopeTest.kt +++ b/dataforge-io/src/jvmTest/kotlin/hep/dataforge/io/FileEnvelopeTest.kt @@ -29,7 +29,7 @@ class FileEnvelopeTest { val tmpPath = Files.createTempFile("dataforge_test", ".df") writeEnvelopeFile(tmpPath, envelope) println(tmpPath.toUri()) - val restored: Envelope = readEnvelopeFile(tmpPath)!! + val restored: Envelope = readEnvelopeFile(tmpPath) assertTrue { envelope.contentEquals(restored) } } } @@ -40,7 +40,7 @@ class FileEnvelopeTest { val tmpPath = Files.createTempFile("dataforge_test_tagless", ".df") writeEnvelopeFile(tmpPath, envelope, envelopeFormat = TaglessEnvelopeFormat) println(tmpPath.toUri()) - val restored: Envelope = readEnvelopeFile(tmpPath)!! + val restored: Envelope = readEnvelopeFile(tmpPath) assertTrue { envelope.contentEquals(restored) } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 96a64daf..c97b21a8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,8 +10,8 @@ pluginManagement { maven("https://dl.bintray.com/mipt-npm/dev") } - val toolsVersion = "0.7.4" - val kotlinVersion = "1.4.30-RC" + val toolsVersion = "0.7.5" + val kotlinVersion = "1.4.30" plugins { id("ru.mipt.npm.project") version toolsVersion From 81fb064d38ff7ef0ae345eba941c2182d53c64e5 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 7 Feb 2021 12:46:15 +0300 Subject: [PATCH 2/2] Maturity declarations. --- build.gradle.kts | 6 +----- dataforge-context/build.gradle.kts | 4 ++++ dataforge-io/build.gradle.kts | 4 ++++ dataforge-io/dataforge-io-yaml/build.gradle.kts | 7 +++++-- .../hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt | 0 .../kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt | 0 .../kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt | 0 dataforge-meta/build.gradle.kts | 6 +++++- dataforge-scripting/build.gradle.kts | 4 ++++ dataforge-tables/build.gradle.kts | 4 ++++ dataforge-workspace/build.gradle.kts | 4 ++++ settings.gradle.kts | 2 +- 12 files changed, 32 insertions(+), 9 deletions(-) rename dataforge-io/dataforge-io-yaml/src/{jvmMain => commonMain}/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt (100%) rename dataforge-io/dataforge-io-yaml/src/{jvmMain => commonMain}/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt (100%) rename dataforge-io/dataforge-io-yaml/src/{jvmTest => commonTest}/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt (100%) diff --git a/build.gradle.kts b/build.gradle.kts index acdfeb81..cc74ad20 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("ru.mipt.npm.project") } -val dataforgeVersion by extra("0.3.0-dev-3") +val dataforgeVersion by extra("0.3.0") val bintrayRepo by extra("dataforge") val githubProject by extra("dataforge-core") @@ -13,10 +13,6 @@ allprojects { version = dataforgeVersion apply() - - repositories { - mavenLocal() - } } apiValidation{ diff --git a/dataforge-context/build.gradle.kts b/dataforge-context/build.gradle.kts index 01a7e3bb..84785ce8 100644 --- a/dataforge-context/build.gradle.kts +++ b/dataforge-context/build.gradle.kts @@ -28,4 +28,8 @@ kotlin { } } } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT } \ No newline at end of file diff --git a/dataforge-io/build.gradle.kts b/dataforge-io/build.gradle.kts index d2e3a41a..01f749cb 100644 --- a/dataforge-io/build.gradle.kts +++ b/dataforge-io/build.gradle.kts @@ -22,4 +22,8 @@ kotlin { } } } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE } \ No newline at end of file diff --git a/dataforge-io/dataforge-io-yaml/build.gradle.kts b/dataforge-io/dataforge-io-yaml/build.gradle.kts index d325a8c8..4ee1029a 100644 --- a/dataforge-io/dataforge-io-yaml/build.gradle.kts +++ b/dataforge-io/dataforge-io-yaml/build.gradle.kts @@ -7,16 +7,19 @@ description = "YAML meta IO" kscience { useSerialization{ - yamlKt() + yamlKt("0.9.0-dev-1") } } +repositories{ + maven("https://dl.bintray.com/mamoe/yamlkt") +} + kotlin { sourceSets { commonMain{ dependencies { api(project(":dataforge-io")) - //api("net.mamoe.yamlkt:yamlkt:${ru.mipt.npm.gradle.KScienceVersions.Serialization.yamlKtVersion}") } } } diff --git a/dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt b/dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt similarity index 100% rename from dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt rename to dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/FrontMatterEnvelopeFormat.kt diff --git a/dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt b/dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt similarity index 100% rename from dataforge-io/dataforge-io-yaml/src/jvmMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt rename to dataforge-io/dataforge-io-yaml/src/commonMain/kotlin/hep/dataforge/io/yaml/YamlMetaFormat.kt diff --git a/dataforge-io/dataforge-io-yaml/src/jvmTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt b/dataforge-io/dataforge-io-yaml/src/commonTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt similarity index 100% rename from dataforge-io/dataforge-io-yaml/src/jvmTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt rename to dataforge-io/dataforge-io-yaml/src/commonTest/kotlin/hep/dataforge/io/yaml/YamlMetaFormatTest.kt diff --git a/dataforge-meta/build.gradle.kts b/dataforge-meta/build.gradle.kts index 980924a7..45ca68f3 100644 --- a/dataforge-meta/build.gradle.kts +++ b/dataforge-meta/build.gradle.kts @@ -9,4 +9,8 @@ kscience { } } -description = "Meta definition and basic operations on meta" \ No newline at end of file +description = "Meta definition and basic operations on meta" + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT +} \ No newline at end of file diff --git a/dataforge-scripting/build.gradle.kts b/dataforge-scripting/build.gradle.kts index cb16b66e..e0c47057 100644 --- a/dataforge-scripting/build.gradle.kts +++ b/dataforge-scripting/build.gradle.kts @@ -22,4 +22,8 @@ kotlin { } } } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE } \ No newline at end of file diff --git a/dataforge-tables/build.gradle.kts b/dataforge-tables/build.gradle.kts index e88f70d1..d0f008c3 100644 --- a/dataforge-tables/build.gradle.kts +++ b/dataforge-tables/build.gradle.kts @@ -12,4 +12,8 @@ kotlin { } } } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE } \ No newline at end of file diff --git a/dataforge-workspace/build.gradle.kts b/dataforge-workspace/build.gradle.kts index 2bb03cec..ae83b062 100644 --- a/dataforge-workspace/build.gradle.kts +++ b/dataforge-workspace/build.gradle.kts @@ -13,4 +13,8 @@ kotlin { } } } +} + +readme{ + maturity = ru.mipt.npm.gradle.Maturity.EXPERIMENTAL } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index c97b21a8..defbc0e5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,7 @@ pluginManagement { maven("https://dl.bintray.com/mipt-npm/dev") } - val toolsVersion = "0.7.5" + val toolsVersion = "0.7.6" val kotlinVersion = "1.4.30" plugins {