diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 8f81a5dd..502361e8 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -37,8 +37,6 @@ "gradle" ], "packagePatterns": [ - // We want to stay in sync with Retrofit - "^com.squareup.okhttp3", // Renovate refuses to stop resolving this from the snapshots repo "^app.cash.sqldelight", ], diff --git a/android/build.gradle.kts b/android/build.gradle.kts index a95bb29a..285a270f 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -45,6 +45,7 @@ android { dependencies { kapt(libs.dagger.compiler) implementation(platform(libs.androidx.compose.bom)) + implementation(platform(libs.okhttp.bom)) implementation(libs.dagger) implementation(projects.api) implementation(projects.common) diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt index f5971feb..3d74af16 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt @@ -22,13 +22,7 @@ class DependencyUpdatesPlugin : Plugin { project.pluginManager.apply(VersionsPlugin::class) project.pluginManager.apply(VersionCatalogUpdatePlugin::class) project.tasks.withType().configureEach { - rejectVersionIf { - when (candidate.group) { - "com.squareup.okhttp3", - "org.jetbrains.kotlin" -> true - else -> isNonStable(candidate.version) && !isNonStable(currentVersion) - } - } + rejectVersionIf { isNonStable(candidate.version) && !isNonStable(currentVersion) } checkConstraints = true checkBuildEnvironmentConstraints = true checkForGradleUpdate = true diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 942c2461..c52ee2ee 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -18,6 +18,7 @@ anvil { generateDaggerFactories.set(true) } android { namespace = "dev.msfjarvis.claw.core" } dependencies { + implementation(platform(libs.okhttp.bom)) api(libs.kotlinx.serialization.json) api(libs.okhttp.loggingInterceptor) implementation(libs.dagger) diff --git a/core/src/main/kotlin/dev/msfjarvis/claw/core/injection/RetrofitModule.kt b/core/src/main/kotlin/dev/msfjarvis/claw/core/injection/RetrofitModule.kt index ea7b61ac..d51fcc7b 100644 --- a/core/src/main/kotlin/dev/msfjarvis/claw/core/injection/RetrofitModule.kt +++ b/core/src/main/kotlin/dev/msfjarvis/claw/core/injection/RetrofitModule.kt @@ -15,7 +15,7 @@ import dagger.multibindings.IntoSet import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonNamingStrategy -import okhttp3.MediaType +import okhttp3.MediaType.Companion.toMediaType import retrofit2.Converter @Module @@ -26,7 +26,7 @@ object RetrofitModule { @Provides @IntoSet fun provideJsonConverterFactory(json: Json): Converter.Factory { - val contentType = MediaType.get("application/json") + val contentType = "application/json".toMediaType() return json.asConverterFactory(contentType) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e83a0b74..98009889 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,8 +9,7 @@ coroutines = "1.6.4" dagger = "2.45" kotest = "5.5.5" kotlin = "1.8.10" -# @pin Needs to be aligned with Retrofit -okhttp = "3.14.9" +okhttp = "4.10.0" retrofit = "2.9.0" richtext = "0.16.0" sentry-sdk = "6.15.0" @@ -75,8 +74,9 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } napier = "io.github.aakira:napier:2.6.1" -okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } -okhttp-loggingInterceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } +okhttp-bom = "com.squareup.okhttp3:okhttp-bom:4.10.0" +okhttp-core = { module = "com.squareup.okhttp3:okhttp" } +okhttp-loggingInterceptor = { module = "com.squareup.okhttp3:logging-interceptor" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit-kotlinxSerializationConverter = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0" sentry-bom = { module = "io.sentry:sentry-bom", version.ref = "sentry-sdk" } diff --git a/metadata-extractor/build.gradle.kts b/metadata-extractor/build.gradle.kts index cd5df25b..ac8402d8 100644 --- a/metadata-extractor/build.gradle.kts +++ b/metadata-extractor/build.gradle.kts @@ -10,6 +10,7 @@ plugins { id("dev.msfjarvis.claw.kotlin-jvm") } dependencies { api(libs.crux) + implementation(platform(libs.okhttp.bom)) implementation(projects.model) implementation(libs.javax.inject) implementation(libs.jsoup)