From b07d281a83c9bbd3731e30c0801405e3812f64d9 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 29 Sep 2021 11:08:55 +0300 Subject: [PATCH] Kotlin 1.6 --- build.gradle.kts | 6 +++--- .../kotlin/space/kscience/dataforge/data/Goal.kt | 2 -- .../space/kscience/dataforge/meta/Scheme.kt | 1 - .../space/kscience/dataforge/values/Value.kt | 4 +--- .../dataforge/meta/MetaSerializationTest.kt | 16 ++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 7 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index d49db3c4..fe2e7f58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,9 @@ plugins { allprojects { group = "space.kscience" version = "0.5.1" + repositories{ + mavenCentral() + } } subprojects { @@ -22,8 +25,5 @@ ksciencePublish { } apiValidation { - if(project.version.toString().contains("dev")) { - validationDisabled = true - } nonPublicMarkers.add("space.kscience.dataforge.misc.DFExperimental") } \ No newline at end of file diff --git a/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/data/Goal.kt b/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/data/Goal.kt index e41c124a..b7ddea96 100644 --- a/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/data/Goal.kt +++ b/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/data/Goal.kt @@ -1,7 +1,6 @@ package space.kscience.dataforge.data import kotlinx.coroutines.* -import space.kscience.dataforge.misc.DFExperimental import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext @@ -67,7 +66,6 @@ public open class LazyGoal( * If [GoalExecutionRestriction] is present in the [coroutineScope] context, the call could produce a error a warning * depending on the settings. */ - @DFExperimental override fun async(coroutineScope: CoroutineScope): Deferred { val log = coroutineScope.coroutineContext[GoalLogger] // Check if context restricts goal computation diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt index 2bc0e234..ffc29152 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Scheme.kt @@ -123,7 +123,6 @@ public open class Scheme : Described, MetaRepr, MutableMetaProvider, Configurabl TODO("Not yet implemented") } - } } diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/values/Value.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/values/Value.kt index e2a83b9c..707c86f6 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/values/Value.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/values/Value.kt @@ -166,9 +166,7 @@ public class EnumValue>(override val value: E) : Value { override fun toString(): String = value.toString() - override fun equals(other: Any?): Boolean { - return string == (other as? Value)?.string - } + override fun equals(other: Any?): Boolean = string == (other as? Value)?.string override fun hashCode(): Int = value.hashCode() } diff --git a/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt b/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt new file mode 100644 index 00000000..10e76f90 --- /dev/null +++ b/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt @@ -0,0 +1,16 @@ +package space.kscience.dataforge.meta + +import kotlinx.serialization.json.Json +import space.kscience.dataforge.values.string +import kotlin.test.Test +import kotlin.test.assertEquals + +class MetaSerializationTest { + + @Test + fun singleValueDeserialization(){ + val string = "ddd" + val meta = Json.decodeFromString(MetaSerializer, string) + assertEquals(string, meta.value?.string) + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f371643e..ffed3a25 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-7.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 6d8e56a0..26f6fcc4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,7 +5,7 @@ pluginManagement { gradlePluginPortal() } - val toolsVersion = "0.10.2" + val toolsVersion = "0.10.4" plugins { id("ru.mipt.npm.gradle.project") version toolsVersion