From d3b934041628746e9d4153065a448215626a1b0e Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 19 Mar 2024 08:10:42 +0100 Subject: [PATCH] build(Gradle): Switch to the official KxS converter for Retrofit See [1]. [1]: https://github.com/square/retrofit/releases/tag/2.10.0 Signed-off-by: Sebastian Schuberth --- .../clearly-defined/src/main/kotlin/ClearlyDefinedService.kt | 3 +-- clients/nexus-iq/src/main/kotlin/NexusIqService.kt | 3 +-- clients/oss-index/src/main/kotlin/OssIndexService.kt | 3 +-- clients/osv/src/main/kotlin/OsvApiClient.kt | 3 +-- clients/scanoss/src/main/kotlin/ScanOssService.kt | 3 +-- .../vulnerable-code/src/main/kotlin/VulnerableCodeService.kt | 3 +-- gradle/libs.versions.toml | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt b/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt index d5df665742aa0..f09cd2f5fa91d 100644 --- a/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt +++ b/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt @@ -19,8 +19,6 @@ package org.ossreviewtoolkit.clients.clearlydefined -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory - import java.io.IOException import kotlinx.coroutines.Dispatchers @@ -37,6 +35,7 @@ import okhttp3.ResponseBody import retrofit2.HttpException import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import retrofit2.converter.scalars.ScalarsConverterFactory import retrofit2.http.Body import retrofit2.http.GET diff --git a/clients/nexus-iq/src/main/kotlin/NexusIqService.kt b/clients/nexus-iq/src/main/kotlin/NexusIqService.kt index fa34ceac271a0..415b90a3fd3c8 100644 --- a/clients/nexus-iq/src/main/kotlin/NexusIqService.kt +++ b/clients/nexus-iq/src/main/kotlin/NexusIqService.kt @@ -19,8 +19,6 @@ package org.ossreviewtoolkit.clients.nexusiq -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory - import io.ks3.java.typealiases.UriAsString import java.util.UUID @@ -33,6 +31,7 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST diff --git a/clients/oss-index/src/main/kotlin/OssIndexService.kt b/clients/oss-index/src/main/kotlin/OssIndexService.kt index 0332702ae47b8..f91f48fe91ecf 100644 --- a/clients/oss-index/src/main/kotlin/OssIndexService.kt +++ b/clients/oss-index/src/main/kotlin/OssIndexService.kt @@ -19,8 +19,6 @@ package org.ossreviewtoolkit.clients.ossindex -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory - import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json @@ -29,6 +27,7 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import retrofit2.http.Body import retrofit2.http.POST diff --git a/clients/osv/src/main/kotlin/OsvApiClient.kt b/clients/osv/src/main/kotlin/OsvApiClient.kt index cec43779e8f47..b9a7d585a0023 100644 --- a/clients/osv/src/main/kotlin/OsvApiClient.kt +++ b/clients/osv/src/main/kotlin/OsvApiClient.kt @@ -19,8 +19,6 @@ package org.ossreviewtoolkit.clients.osv -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory - import io.ks3.java.typealiases.InstantAsString import java.util.concurrent.Executors @@ -36,6 +34,7 @@ import okhttp3.OkHttpClient import retrofit2.Call import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST diff --git a/clients/scanoss/src/main/kotlin/ScanOssService.kt b/clients/scanoss/src/main/kotlin/ScanOssService.kt index 17f5fb9efe3fc..270c0b913bbf6 100644 --- a/clients/scanoss/src/main/kotlin/ScanOssService.kt +++ b/clients/scanoss/src/main/kotlin/ScanOssService.kt @@ -19,8 +19,6 @@ package org.ossreviewtoolkit.clients.scanoss -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory - import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonNamingStrategy @@ -31,6 +29,7 @@ import okhttp3.OkHttpClient import org.ossreviewtoolkit.clients.scanoss.model.ScanResponse import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import retrofit2.http.Multipart import retrofit2.http.POST import retrofit2.http.Part diff --git a/clients/vulnerable-code/src/main/kotlin/VulnerableCodeService.kt b/clients/vulnerable-code/src/main/kotlin/VulnerableCodeService.kt index bed8a05f1da70..32bc02e51e015 100644 --- a/clients/vulnerable-code/src/main/kotlin/VulnerableCodeService.kt +++ b/clients/vulnerable-code/src/main/kotlin/VulnerableCodeService.kt @@ -19,8 +19,6 @@ package org.ossreviewtoolkit.clients.vulnerablecode -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory - import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonNames @@ -30,6 +28,7 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import retrofit2.http.Body import retrofit2.http.POST diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 23aedc32e9057..fb95fb3d29aae 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -51,7 +51,6 @@ postgres = "42.7.3" postgresEmbedded = "1.0.2" reflections = "0.10.2" retrofit = "2.10.0" -retrofitConverterKotlinxSerialization = "1.0.0" s3 = "2.25.0" saxonHe = "12.4" scanoss = "1.1.6" @@ -156,7 +155,7 @@ postgresEmbedded = { module = "com.opentable.components:otj-pg-embedded", versio reflections = { module = "org.reflections:reflections", version.ref = "reflections" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit-converter-jackson = { module = "com.squareup.retrofit2:converter-jackson", version.ref = "retrofit" } -retrofit-converter-kotlinxSerialization = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version.ref = "retrofitConverterKotlinxSerialization" } +retrofit-converter-kotlinxSerialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "retrofit" } retrofit-converter-scalars = { module = "com.squareup.retrofit2:converter-scalars", version.ref = "retrofit" } saxonHe = { module = "net.sf.saxon:Saxon-HE", version.ref = "saxonHe" } scanoss = { module = "com.scanoss:scanner", version.ref = "scanoss" }