migration onto newer version of kotlin

This commit is contained in:
InsanusMokrassar 2021-05-18 10:10:37 +06:00
parent 185c0a87af
commit ae0ea72f55
6 changed files with 15 additions and 8 deletions

View File

@ -11,7 +11,6 @@ buildscript {
dependencies { dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$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 { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_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" implementation "joda-time:joda-time:$joda_time_version"
// Use JUnit test framework // Use JUnit test framework

View File

@ -1,7 +1,7 @@
kotlin.code.style=official kotlin.code.style=official
kotlin_version=1.3.31 kotlin_version=1.5.0
kotlin_coroutines_version=1.2.1 kotlin_coroutines_version=1.4.3
kotlin_serialisation_runtime_version=0.11.0 kotlin_serialisation_runtime_version=1.2.0
joda_time_version=2.10.1 joda_time_version=2.10.1
ktor_version=1.1.4 ktor_version=1.1.4

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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

View File

@ -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.CeilDescriptions.models.CeilsInfosRoot
import com.github.insanusmokrassar.PsychomatrixBase.utils.FilesLoader.load import com.github.insanusmokrassar.PsychomatrixBase.utils.FilesLoader.load
import com.github.insanusmokrassar.PsychomatrixBase.utils.nonstrictJson
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import java.io.InputStreamReader import java.io.InputStreamReader
@ -27,6 +28,6 @@ private fun findSubTranslation(language: String): String {
fun resolveCeilsDescriptionsByLanguage(language: String = "en_US"): CeilsInfosRoot { fun resolveCeilsDescriptionsByLanguage(language: String = "en_US"): CeilsInfosRoot {
return load("$characteristicsFolder/${findSubTranslation(language)}.json").let { return load("$characteristicsFolder/${findSubTranslation(language)}.json").let {
Json.nonstrict.parse(CeilsInfosRoot.serializer(), InputStreamReader(it).readText()) nonstrictJson.decodeFromString(CeilsInfosRoot.serializer(), InputStreamReader(it).readText())
} }
} }

View File

@ -1,7 +1,6 @@
package com.github.insanusmokrassar.PsychomatrixBase.utils.CeilDescriptions.models package com.github.insanusmokrassar.PsychomatrixBase.utils.CeilDescriptions.models
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.CeilInfo import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.CeilInfo
import kotlinx.serialization.Optional
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@Serializable @Serializable

View File

@ -0,0 +1,8 @@
package com.github.insanusmokrassar.PsychomatrixBase.utils
import kotlinx.serialization.json.Json
val nonstrictJson = Json {
ignoreUnknownKeys = true
allowSpecialFloatingPointValues = true
}