From a5d0b47d3a6fec4036f642a792bf58bd038842f7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 25 Mar 2024 09:54:52 +0100 Subject: [PATCH] Use new retrofit bom and change Maven coordinates of `kotlinx-serialization` --- features/login/impl/build.gradle.kts | 1 + gradle/libs.versions.toml | 5 +++-- libraries/network/build.gradle.kts | 1 + .../io/element/android/libraries/network/RetrofitFactory.kt | 2 +- libraries/push/impl/build.gradle.kts | 1 + libraries/pushproviders/unifiedpush/build.gradle.kts | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/features/login/impl/build.gradle.kts b/features/login/impl/build.gradle.kts index 227c512043..47ddd893fa 100644 --- a/features/login/impl/build.gradle.kts +++ b/features/login/impl/build.gradle.kts @@ -50,6 +50,7 @@ dependencies { implementation(projects.libraries.testtags) implementation(projects.libraries.uiStrings) implementation(libs.androidx.browser) + implementation(platform(libs.network.retrofit.bom)) implementation(libs.network.retrofit) implementation(libs.serialization.json) api(projects.features.login.api) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c01b624305..4809c8d0c9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -120,8 +120,9 @@ network_okhttp_logging = { module = "com.squareup.okhttp3:logging-interceptor" } network_okhttp_okhttp = { module = "com.squareup.okhttp3:okhttp" } network_okhttp = { module = "com.squareup.okhttp3:okhttp" } network_mockwebserver = { module = "com.squareup.okhttp3:mockwebserver" } -network_retrofit = "com.squareup.retrofit2:retrofit:2.10.0" -network_retrofit_converter_serialization = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0" +network_retrofit_bom = "com.squareup.retrofit2:retrofit-bom:2.10.0" +network_retrofit = { module = "com.squareup.retrofit2:retrofit" } +network_retrofit_converter_serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization" } # Test test_core = { module = "androidx.test:core", version.ref = "test_core" } diff --git a/libraries/network/build.gradle.kts b/libraries/network/build.gradle.kts index 521823b23d..2b18f1e37a 100644 --- a/libraries/network/build.gradle.kts +++ b/libraries/network/build.gradle.kts @@ -41,6 +41,7 @@ dependencies { implementation(platform(libs.network.okhttp.bom)) implementation(libs.network.okhttp) implementation(libs.network.okhttp.logging) + implementation(platform(libs.network.retrofit.bom)) implementation(libs.network.retrofit) implementation(libs.network.retrofit.converter.serialization) implementation(libs.serialization.json) diff --git a/libraries/network/src/main/kotlin/io/element/android/libraries/network/RetrofitFactory.kt b/libraries/network/src/main/kotlin/io/element/android/libraries/network/RetrofitFactory.kt index dc8b664764..fcd3d0930d 100644 --- a/libraries/network/src/main/kotlin/io/element/android/libraries/network/RetrofitFactory.kt +++ b/libraries/network/src/main/kotlin/io/element/android/libraries/network/RetrofitFactory.kt @@ -16,12 +16,12 @@ package io.element.android.libraries.network -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory import io.element.android.libraries.core.uri.ensureTrailingSlash import kotlinx.serialization.json.Json import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import retrofit2.Retrofit +import retrofit2.converter.kotlinx.serialization.asConverterFactory import javax.inject.Inject import javax.inject.Provider diff --git a/libraries/push/impl/build.gradle.kts b/libraries/push/impl/build.gradle.kts index f72a0886a0..7df972c3c3 100644 --- a/libraries/push/impl/build.gradle.kts +++ b/libraries/push/impl/build.gradle.kts @@ -38,6 +38,7 @@ dependencies { implementation(libs.androidx.corektx) implementation(libs.androidx.datastore.preferences) implementation(libs.androidx.security.crypto) + implementation(platform(libs.network.retrofit.bom)) implementation(libs.network.retrofit) implementation(libs.serialization.json) implementation(libs.coil) diff --git a/libraries/pushproviders/unifiedpush/build.gradle.kts b/libraries/pushproviders/unifiedpush/build.gradle.kts index 733309e00d..a3968f4ecc 100644 --- a/libraries/pushproviders/unifiedpush/build.gradle.kts +++ b/libraries/pushproviders/unifiedpush/build.gradle.kts @@ -42,6 +42,7 @@ dependencies { implementation(projects.libraries.network) implementation(platform(libs.network.okhttp.bom)) implementation(libs.network.okhttp.okhttp) + implementation(platform(libs.network.retrofit.bom)) implementation(libs.network.retrofit) implementation(libs.serialization.json)