diff --git a/.github/workflows/gradle.yml b/.github/workflows/build.yml similarity index 68% rename from .github/workflows/gradle.yml rename to .github/workflows/build.yml index adc74adf..e780ac7e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/build.yml @@ -8,10 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 + - name: Grant execute permission for gradlew + run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build diff --git a/CHANGELOG.md b/CHANGELOG.md index 92ac8df8..0f9f236d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `Path` builders - Special ValueType for lists - `copy` method to descriptors +- Multiplatform yaml meta ### Changed - `ListValue` and `DoubleArrayValue` implement `Iterable`. diff --git a/build.gradle.kts b/build.gradle.kts index ca5e63bc..acdfeb81 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-2") +val dataforgeVersion by extra("0.3.0-dev-3") val bintrayRepo by extra("dataforge") val githubProject by extra("dataforge-core") diff --git a/dataforge-io/dataforge-io-yaml/build.gradle.kts b/dataforge-io/dataforge-io-yaml/build.gradle.kts index e5b23ce7..b8ce9caf 100644 --- a/dataforge-io/dataforge-io-yaml/build.gradle.kts +++ b/dataforge-io/dataforge-io-yaml/build.gradle.kts @@ -1,5 +1,6 @@ plugins { id("ru.mipt.npm.mpp") + id("ru.mipt.npm.native") } description = "YAML meta IO" @@ -9,15 +10,17 @@ repositories{ } kscience { - useSerialization() + useSerialization{ + yamlKt() + } } kotlin { sourceSets { - jvmMain{ + 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}") } } } 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 96% 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 index 5abcec3f..254234dd 100644 --- 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 @@ -22,7 +22,7 @@ public class FrontMatterEnvelopeFormat( var offset = 0u do { line = input.readUtf8Line() //?: error("Input does not contain front matter separator") - offset += line.toByteArray().size.toUInt() + offset += line.encodeToByteArray().size.toUInt() } while (!line.startsWith(SEPARATOR)) val readMetaFormat = @@ -34,7 +34,7 @@ public class FrontMatterEnvelopeFormat( do { line = input.readUtf8Line() writeUtf8String(line + "\r\n") - offset += line.toByteArray().size.toUInt() + offset += line.encodeToByteArray().size.toUInt() } while (!line.startsWith(SEPARATOR)) }.read { readMetaFormat.readMeta(input) 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/settings.gradle.kts b/settings.gradle.kts index f3ac6394..96a64daf 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.1" - val kotlinVersion = "1.4.21" + val toolsVersion = "0.7.4" + val kotlinVersion = "1.4.30-RC" plugins { id("ru.mipt.npm.project") version toolsVersion