update versions

This commit is contained in:
InsanusMokrassar 2020-12-02 14:08:19 +06:00
parent 18cdf4ffbe
commit 4fcdb6f728
5 changed files with 20 additions and 23 deletions

View File

@ -2,6 +2,12 @@
## 0.6.2 ## 0.6.2
* Versions updates:
* `Kotlin`: `1.4.10` -> `1.4.20`
* `Kotlin Serialisation`: `1.0.0-RC2` -> `1.0.1`
* `Kotlin Coroutines`: `1.3.9` -> `1.4.2`
* `Klock`: `1.12.1` -> `2.0.0`
## 0.6.1 ## 0.6.1
* Versions updates: * Versions updates:

View File

@ -44,7 +44,7 @@ kotlin {
implementation kotlin('stdlib') implementation kotlin('stdlib')
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_runtime_version" api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_version"
api "com.soywiz.korlibs.klock:klock:$klock_version" api "com.soywiz.korlibs.klock:klock:$klock_version"
api "io.ktor:ktor-client-core:$ktor_version" api "io.ktor:ktor-client-core:$ktor_version"
} }
@ -55,18 +55,13 @@ kotlin {
implementation kotlin('test-annotations-common') implementation kotlin('test-annotations-common')
} }
} }
jvmMain {
dependencies {
implementation kotlin('stdlib')
}
}
jvmTest { jvmTest {
dependencies { dependencies {
implementation kotlin('test-junit') implementation kotlin('test-junit')
implementation "io.ktor:ktor-client-okhttp:$ktor_version" implementation "io.ktor:ktor-client-okhttp:$ktor_version"
} }
} }
jsMain { jsTest {
dependencies { dependencies {
implementation kotlin('test-js') implementation kotlin('test-js')
} }

View File

@ -1,8 +1,8 @@
kotlin.code.style=official kotlin.code.style=official
kotlin_version=1.4.10 kotlin_version=1.4.20
kotlin_coroutines_version=1.3.9 kotlin_coroutines_version=1.4.2
kotlin_serialisation_runtime_version=1.0.0-RC2 kotlin_serialisation_version=1.0.1
klock_version=1.12.1 klock_version=2.0.0
ktor_version=1.4.1 ktor_version=1.4.1
gradle_github_release_plugin_version=2.2.12 gradle_github_release_plugin_version=2.2.12

View File

@ -9,7 +9,6 @@ import io.ktor.http.HttpStatusCode.Companion.TooManyRequests
import io.ktor.utils.io.errors.IOException import io.ktor.utils.io.errors.IOException
internal suspend fun ClientRequestException.sauceNaoAPIException(): Exception { internal suspend fun ClientRequestException.sauceNaoAPIException(): Exception {
val response = response ?: return this
return when (response.status) { return when (response.status) {
TooManyRequests -> { TooManyRequests -> {
val answerContent = response.readText() val answerContent = response.readText()
@ -20,7 +19,7 @@ internal suspend fun ClientRequestException.sauceNaoAPIException(): Exception {
} }
else -> this else -> this
} }
} }
sealed class TooManyRequestsException(message: String, cause: Throwable? = null) : IOException(message, cause) { sealed class TooManyRequestsException(message: String, cause: Throwable? = null) : IOException(message, cause) {
abstract val answerContent: String abstract val answerContent: String

View File

@ -7,11 +7,8 @@ import kotlinx.serialization.builtins.serializer
import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.json.* import kotlinx.serialization.json.*
@Serializer(String::class) @Serializer(String::class)
object CommonMultivariantStringSerializer : KSerializer<String> by String.serializer() { object CommonMultivariantStringSerializer : KSerializer<String> by String.serializer() {
private val stringArraySerializer = ListSerializer(String.serializer())
override fun deserialize(decoder: Decoder): String { override fun deserialize(decoder: Decoder): String {
return when (val parsed = JsonElement.serializer().deserialize(decoder)) { return when (val parsed = JsonElement.serializer().deserialize(decoder)) {
is JsonPrimitive -> parsed.content is JsonPrimitive -> parsed.content