diff --git a/build.gradle b/build.gradle index 89f97a9..0cfb575 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,6 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version" } } @@ -29,7 +28,7 @@ repositories { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlin_serialisation_runtime_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_runtime_version" implementation "joda-time:joda-time:$joda_time_version" // Use JUnit test framework diff --git a/gradle.properties b/gradle.properties index f778c7d..3c4ca20 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ kotlin.code.style=official -kotlin_version=1.3.31 -kotlin_coroutines_version=1.2.1 -kotlin_serialisation_runtime_version=0.11.0 +kotlin_version=1.5.0 +kotlin_coroutines_version=1.4.3 +kotlin_serialisation_runtime_version=1.2.0 joda_time_version=2.10.1 ktor_version=1.1.4 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 19c6ad2..7156cc8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip diff --git a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/CeilInfoResolver.kt b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/CeilInfoResolver.kt index c20e2b0..2edf0c2 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/CeilInfoResolver.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/CeilInfoResolver.kt @@ -2,6 +2,7 @@ package com.github.insanusmokrassar.PsychomatrixBase.utils.CeilDescriptions import com.github.insanusmokrassar.PsychomatrixBase.utils.CeilDescriptions.models.CeilsInfosRoot import com.github.insanusmokrassar.PsychomatrixBase.utils.FilesLoader.load +import com.github.insanusmokrassar.PsychomatrixBase.utils.nonstrictJson import kotlinx.serialization.json.Json import java.io.InputStreamReader @@ -27,6 +28,6 @@ private fun findSubTranslation(language: String): String { fun resolveCeilsDescriptionsByLanguage(language: String = "en_US"): CeilsInfosRoot { return load("$characteristicsFolder/${findSubTranslation(language)}.json").let { - Json.nonstrict.parse(CeilsInfosRoot.serializer(), InputStreamReader(it).readText()) + nonstrictJson.decodeFromString(CeilsInfosRoot.serializer(), InputStreamReader(it).readText()) } } diff --git a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/models/CeilInfoConfig.kt b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/models/CeilInfoConfig.kt index ef62eb3..8fb7775 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/models/CeilInfoConfig.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/CeilDescriptions/models/CeilInfoConfig.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.PsychomatrixBase.utils.CeilDescriptions.models import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.CeilInfo -import kotlinx.serialization.Optional import kotlinx.serialization.Serializable @Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/Json.kt b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/Json.kt new file mode 100644 index 0000000..26cb5a5 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/utils/Json.kt @@ -0,0 +1,8 @@ +package com.github.insanusmokrassar.PsychomatrixBase.utils + +import kotlinx.serialization.json.Json + +val nonstrictJson = Json { + ignoreUnknownKeys = true + allowSpecialFloatingPointValues = true +}