diff --git a/README.md b/README.md index 9c856c544..130bb84d4 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ The following is a list of all third-party dependencies included as part of the - License: Apache 2.0 - **kotlinx.serialization converter** - - https://github.com/JakeWharton/retrofit2-kotlinx-serialization-converter + - https://github.com/square/retrofit/tree/trunk/retrofit-converters/kotlinx-serialization - Purpose: Converter for Retrofit 2 and kotlinx.serialization. - License: Apache 2.0 @@ -159,7 +159,7 @@ The following is a list of all third-party dependencies included as part of the - **Retrofit 2** - https://github.com/square/retrofit - - Purpose: A networking layer interface used by the sample app. + - Purpose: A networking layer interface. - License: Apache 2.0 - **zxcvbn4j** diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b5b0aebd2..d09b6fa9a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -141,14 +141,15 @@ dependencies { implementation(libs.bumptech.glide) implementation(libs.google.hilt.android) ksp(libs.google.hilt.compiler) - implementation(libs.jakewharton.retrofit.kotlinx.serialization) implementation(libs.kotlinx.collections.immutable) implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.serialization) implementation(libs.nulab.zxcvbn4j) implementation(libs.square.okhttp) implementation(libs.square.okhttp.logging) + implementation(platform(libs.square.retrofit.bom)) implementation(libs.square.retrofit) + implementation(libs.square.retrofit.kotlinx.serialization) implementation(libs.zxing.zxing.core) // For now we are restricted to running Compose tests for debug builds only diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt index 84f7bfb97..3413e00d1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt @@ -1,7 +1,6 @@ package com.x8bit.bitwarden.data.platform.datasource.network.retrofit import android.util.Log -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory import com.x8bit.bitwarden.BuildConfig import com.x8bit.bitwarden.data.platform.datasource.network.authenticator.RefreshAuthenticator import com.x8bit.bitwarden.data.platform.datasource.network.core.ResultCallAdapterFactory @@ -14,6 +13,7 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory private const val MAX_LOG_MESSAGE_LENGTH: Int = 4000 diff --git a/app/src/test/java/com/x8bit/bitwarden/data/platform/base/BaseServiceTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/platform/base/BaseServiceTest.kt index cb38b6ebf..33293b3ee 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/platform/base/BaseServiceTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/platform/base/BaseServiceTest.kt @@ -1,12 +1,12 @@ package com.x8bit.bitwarden.data.platform.base -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory import com.x8bit.bitwarden.data.platform.datasource.network.core.ResultCallAdapterFactory import com.x8bit.bitwarden.data.platform.datasource.network.di.PlatformNetworkModule import okhttp3.MediaType.Companion.toMediaType import okhttp3.mockwebserver.MockWebServer import org.junit.jupiter.api.AfterEach import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory /** * Base class for service tests. Provides common mock web server and retrofit setup. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7f6c906f3..77ced17aa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -44,8 +44,7 @@ kotlinxKover = "0.7.4" ksp = "1.9.22-1.0.17" mockk = "1.13.10" okhttp = "4.12.0" -retrofit = "2.9.0" -retrofitKotlinxSerialization = "1.0.0" +retrofitBom = "2.11.0" roboelectric = "4.11.1" turbine = "1.0.0" zxcvbn4j = "1.8.0" @@ -93,7 +92,6 @@ google-firebase-crashlytics = { module = "com.google.firebase:firebase-crashlyti google-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } google-hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" } google-hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" } -jakewharton-retrofit-kotlinx-serialization = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version.ref = "retrofitKotlinxSerialization" } junit-junit5 = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit5" } junit-vintage = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit5" } kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinxCollectionsImmutable" } @@ -106,7 +104,9 @@ robolectric-robolectric = { module = "org.robolectric:robolectric", version.ref square-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } square-okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } square-okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" } -square-retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } +square-retrofit = { module = "com.squareup.retrofit2:retrofit" } +square-retrofit-bom = { module = "com.squareup.retrofit2:retrofit-bom", version.ref = "retrofitBom" } +square-retrofit-kotlinx-serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization" } square-turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" } zxing-zxing-core = { module = "com.google.zxing:core", version.ref = "zxing" }