From 2d222864bcd5ab27139f1bc0a0a747e076f33545 Mon Sep 17 00:00:00 2001 From: "konstantin.tskhovrebov" Date: Thu, 30 Dec 2021 16:07:08 +0100 Subject: [PATCH] Update dependencies. --- build.gradle.kts | 1 + .../com/github/jetbrains/rssreader/sharedui/ActualUI.kt | 3 ++- gradle/libs.versions.toml | 6 +++--- .../github/jetbrains/rssreader/core/AndroidHttpClient.kt | 2 +- .../rssreader/core/datasource/network/FeedLoader.kt | 2 +- .../com/github/jetbrains/rssreader/core/IosHttpClient.kt | 6 +++--- .../com/github/jetbrains/rssreader/core/JsHttpClient.kt | 2 +- .../com/github/jetbrains/rssreader/core/JvmHttpClient.kt | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 92e5592..295a255 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,5 +17,6 @@ allprojects { maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } + // ./gradlew dependencyUpdates apply(plugin = "com.github.ben-manes.versions") } \ No newline at end of file diff --git a/composeApp/src/jvmMain/kotlin/com/github/jetbrains/rssreader/sharedui/ActualUI.kt b/composeApp/src/jvmMain/kotlin/com/github/jetbrains/rssreader/sharedui/ActualUI.kt index 2bfec4c..256280f 100644 --- a/composeApp/src/jvmMain/kotlin/com/github/jetbrains/rssreader/sharedui/ActualUI.kt +++ b/composeApp/src/jvmMain/kotlin/com/github/jetbrains/rssreader/sharedui/ActualUI.kt @@ -16,6 +16,7 @@ import androidx.compose.ui.unit.dp import io.ktor.client.* import io.ktor.client.engine.okhttp.* import io.ktor.client.request.* +import io.ktor.client.statement.* import org.jetbrains.skia.Image internal actual fun Modifier.systemStatusBarsHeight(additional: Dp): Modifier = this @@ -30,7 +31,7 @@ internal actual fun _str(resName: String) = resName private val httpClient = HttpClient(OkHttp) private suspend fun loadImageBitmap(url: String): Result { return try { - val image = httpClient.get(url) + val image = httpClient.get(url).readBytes() Result.success(Image.makeFromEncoded(image).toComposeImageBitmap()) } catch (e: Exception) { Result.failure(e) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8e3d1ca..a2d0b89 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,13 +6,13 @@ plugin-gver = "0.39.0" kotlinx-serialization = "1.3.2" kotlinx-coroutines = "1.6.0-native-mt" -ktor = "1.6.7" +ktor = "2.0.0-beta-1" napier = "2.3.0" multiplatform-settings = "0.8.1" voyager = "1.0.0-beta14" koin = "3.1.4" -accompanist = "0.20.0" -coil = "1.4.0" +accompanist = "0.22.0-rc" +coil = "2.0.0-alpha06" activity-compose = "1.4.0" work-runtime-ktx = "2.7.1" desugar-jdk-libs = "1.1.5" diff --git a/shared/src/androidMain/kotlin/com/github/jetbrains/rssreader/core/AndroidHttpClient.kt b/shared/src/androidMain/kotlin/com/github/jetbrains/rssreader/core/AndroidHttpClient.kt index 0fe2fcd..0e2ed38 100644 --- a/shared/src/androidMain/kotlin/com/github/jetbrains/rssreader/core/AndroidHttpClient.kt +++ b/shared/src/androidMain/kotlin/com/github/jetbrains/rssreader/core/AndroidHttpClient.kt @@ -3,7 +3,7 @@ package com.github.jetbrains.rssreader.core import io.github.aakira.napier.Napier import io.ktor.client.* import io.ktor.client.engine.okhttp.* -import io.ktor.client.features.logging.* +import io.ktor.client.plugins.logging.* import java.util.concurrent.TimeUnit internal fun AndroidHttpClient(withLog: Boolean) = HttpClient(OkHttp) { diff --git a/shared/src/commonMain/kotlin/com/github/jetbrains/rssreader/core/datasource/network/FeedLoader.kt b/shared/src/commonMain/kotlin/com/github/jetbrains/rssreader/core/datasource/network/FeedLoader.kt index feb7f7e..46a46c9 100644 --- a/shared/src/commonMain/kotlin/com/github/jetbrains/rssreader/core/datasource/network/FeedLoader.kt +++ b/shared/src/commonMain/kotlin/com/github/jetbrains/rssreader/core/datasource/network/FeedLoader.kt @@ -10,7 +10,7 @@ internal class FeedLoader( private val parser: FeedParser ) { suspend fun getFeed(url: String, isDefault: Boolean): Feed { - val xml = httpClient.get(url).readText() + val xml = httpClient.get(url).bodyAsText() return parser.parse(url, xml, isDefault) } } \ No newline at end of file diff --git a/shared/src/iosMain/kotlin/com/github/jetbrains/rssreader/core/IosHttpClient.kt b/shared/src/iosMain/kotlin/com/github/jetbrains/rssreader/core/IosHttpClient.kt index 6ba3d28..12229d6 100644 --- a/shared/src/iosMain/kotlin/com/github/jetbrains/rssreader/core/IosHttpClient.kt +++ b/shared/src/iosMain/kotlin/com/github/jetbrains/rssreader/core/IosHttpClient.kt @@ -2,10 +2,10 @@ package com.github.jetbrains.rssreader.core import io.github.aakira.napier.Napier import io.ktor.client.* -import io.ktor.client.engine.ios.* -import io.ktor.client.features.logging.* +import io.ktor.client.engine.darwin.* +import io.ktor.client.plugins.logging.* -internal fun IosHttpClient(withLog: Boolean) = HttpClient(Ios) { +internal fun IosHttpClient(withLog: Boolean) = HttpClient(Darwin) { engine { configureRequest { setAllowsCellularAccess(true) diff --git a/shared/src/jsMain/kotlin/com/github/jetbrains/rssreader/core/JsHttpClient.kt b/shared/src/jsMain/kotlin/com/github/jetbrains/rssreader/core/JsHttpClient.kt index 0105c9c..375ce02 100644 --- a/shared/src/jsMain/kotlin/com/github/jetbrains/rssreader/core/JsHttpClient.kt +++ b/shared/src/jsMain/kotlin/com/github/jetbrains/rssreader/core/JsHttpClient.kt @@ -3,7 +3,7 @@ package com.github.jetbrains.rssreader.core import io.github.aakira.napier.Napier import io.ktor.client.* import io.ktor.client.engine.js.* -import io.ktor.client.features.logging.* +import io.ktor.client.plugins.logging.* internal fun jsHttpClient(withLog: Boolean) = HttpClient(Js) { if (withLog) install(Logging) { diff --git a/shared/src/jvmMain/kotlin/com/github/jetbrains/rssreader/core/JvmHttpClient.kt b/shared/src/jvmMain/kotlin/com/github/jetbrains/rssreader/core/JvmHttpClient.kt index 4012c87..d835fce 100644 --- a/shared/src/jvmMain/kotlin/com/github/jetbrains/rssreader/core/JvmHttpClient.kt +++ b/shared/src/jvmMain/kotlin/com/github/jetbrains/rssreader/core/JvmHttpClient.kt @@ -3,7 +3,7 @@ package com.github.jetbrains.rssreader.core import io.github.aakira.napier.Napier import io.ktor.client.* import io.ktor.client.engine.okhttp.* -import io.ktor.client.features.logging.* +import io.ktor.client.plugins.logging.* import java.util.concurrent.TimeUnit internal fun JvmHttpClient(withLog: Boolean) = HttpClient(OkHttp) {