From 6ff20d61062b7a225fcb7cb6f14d02d15a91a9a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 23:16:07 +0000 Subject: [PATCH 1/6] Update actions/cache action to v3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0be4e7cc..d7c14baf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: java-version: 17 - name: Cache Gradle and wrapper - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.gradle/caches From 7064bcb378f68d26a2f285baac93a8e49361cc5e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 23:16:11 +0000 Subject: [PATCH 2/6] Update actions/checkout action to v4 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0be4e7cc..e6a08a28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: runs-on: macos-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v1 with: @@ -28,7 +28,7 @@ jobs: runs-on: macos-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v1 with: @@ -40,7 +40,7 @@ jobs: build: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: set up JDK uses: actions/setup-java@v1 From 249b6cec563a614d46032b684a6509176be593da Mon Sep 17 00:00:00 2001 From: Yechan Park Date: Mon, 13 Nov 2023 16:51:36 +0900 Subject: [PATCH 3/6] Change Ktor's request to be executed within a try-catch block --- .../sandwich/ktor/HttpClientExtension.kt | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/sandwich-ktor/src/commonMain/kotlin/com/skydoves/sandwich/ktor/HttpClientExtension.kt b/sandwich-ktor/src/commonMain/kotlin/com/skydoves/sandwich/ktor/HttpClientExtension.kt index 6f36a0c3..8a306521 100644 --- a/sandwich-ktor/src/commonMain/kotlin/com/skydoves/sandwich/ktor/HttpClientExtension.kt +++ b/sandwich-ktor/src/commonMain/kotlin/com/skydoves/sandwich/ktor/HttpClientExtension.kt @@ -32,8 +32,7 @@ import io.ktor.http.Url public suspend inline fun HttpClient.requestApiResponse( builder: HttpRequestBuilder = HttpRequestBuilder(), ): ApiResponse { - val response = HttpStatement(builder, this).execute() - return apiResponseOf { response } + return apiResponseOf { HttpStatement(builder, this).execute() } } /** @@ -42,10 +41,9 @@ public suspend inline fun HttpClient.requestApiResponse( * @return [ApiResponse] */ public suspend inline fun HttpClient.requestApiResponse( - block: HttpRequestBuilder.() -> Unit, + crossinline block: HttpRequestBuilder.() -> Unit, ): ApiResponse { - val response = request(HttpRequestBuilder().apply(block)) - return apiResponseOf { response } + return apiResponseOf { request(HttpRequestBuilder().apply(block)) } } /** @@ -55,13 +53,14 @@ public suspend inline fun HttpClient.requestApiResponse( */ public suspend inline fun HttpClient.requestApiResponse( urlString: String, - block: HttpRequestBuilder.() -> Unit = {}, + crossinline block: HttpRequestBuilder.() -> Unit = {}, ): ApiResponse { - val response = request { - url(urlString) - block() + return apiResponseOf { + request { + url(urlString) + block() + } } - return apiResponseOf { response } } /** @@ -71,13 +70,14 @@ public suspend inline fun HttpClient.requestApiResponse( */ public suspend inline fun HttpClient.requestApiResponse( url: Url, - block: HttpRequestBuilder.() -> Unit = {}, + crossinline block: HttpRequestBuilder.() -> Unit = {}, ): ApiResponse { - val response = request { - url(url) - block() + return apiResponseOf { + request { + url(url) + block() + } } - return apiResponseOf { response } } /** @@ -89,8 +89,7 @@ public suspend inline fun HttpClient.getApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Get - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** @@ -102,8 +101,7 @@ public suspend inline fun HttpClient.postApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Post - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** @@ -115,8 +113,7 @@ public suspend inline fun HttpClient.putApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Put - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** @@ -128,8 +125,7 @@ public suspend inline fun HttpClient.deleteApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Delete - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** @@ -141,8 +137,7 @@ public suspend inline fun HttpClient.optionsApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Options - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** @@ -154,8 +149,7 @@ public suspend inline fun HttpClient.patchApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Patch - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** @@ -167,8 +161,7 @@ public suspend inline fun HttpClient.headApiResponse( builder: HttpRequestBuilder, ): ApiResponse { builder.method = HttpMethod.Head - val response = request(builder) - return apiResponseOf { response } + return apiResponseOf { request(builder) } } /** From a6817494366f31ce5878a0ae20bd26ecfabf5c02 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:59:46 +0000 Subject: [PATCH 4/6] Update androidxMacroBenchmark to v1.2.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 48346fd9..e42b443b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ ksp = "1.9.20-1.0.14" moshi = "1.15.0" glide = "4.16.0" androidxLifecycle = "2.6.2" -androidxMacroBenchmark = "1.2.0" +androidxMacroBenchmark = "1.2.1" androidxProfileinstaller = "1.3.1" androidxUiAutomator = "2.3.0-alpha05" junit = "4.13.2" From 2e0f17915a140d762afecb523645d6c4c38fc8ba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:47:37 +0000 Subject: [PATCH 5/6] Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.6.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e42b443b..fa3a359a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ okhttp = "4.12.0" ktor = "2.3.6" ktorfit = "1.10.0" coroutines = "1.7.3" -kotlinSerialization = "1.6.0" +kotlinSerialization = "1.6.1" ksp = "1.9.20-1.0.14" moshi = "1.15.0" glide = "4.16.0" From 3bb9a8160ed27a3e0dcb9c60ce15eb2413d6b6a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 00:07:43 +0000 Subject: [PATCH 6/6] Update ktorfit to v1.10.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fa3a359a..e6096d87 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ retrofit = "2.9.0" okio = "3.6.0" okhttp = "4.12.0" ktor = "2.3.6" -ktorfit = "1.10.0" +ktorfit = "1.10.1" coroutines = "1.7.3" kotlinSerialization = "1.6.1" ksp = "1.9.20-1.0.14"