From cc26c065585ba21ad0e271b456001840f9862262 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Tue, 20 May 2025 19:45:49 -0700 Subject: [PATCH 1/4] Move compose deps to version catalog --- buildSrc/src/main/java/Config.kt | 14 -------------- gradle/libs.versions.toml | 10 ++++++++++ sentry-android-core/build.gradle.kts | 2 +- .../build.gradle.kts | 6 +++--- .../sentry-uitest-android/build.gradle.kts | 6 +++--- sentry-android-navigation/build.gradle.kts | 4 ++-- sentry-android-replay/build.gradle.kts | 14 +++++++------- sentry-compose/build.gradle.kts | 4 ++-- .../sentry-samples-android/build.gradle.kts | 12 ++++++------ 9 files changed, 34 insertions(+), 38 deletions(-) diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index b508a0fb1be..3fd7f7efef1 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -129,20 +129,6 @@ object Config { val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect" val kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib" - private val navigationVersion = "2.4.2" - val navigationRuntime = "androidx.navigation:navigation-runtime:$navigationVersion" - - // compose deps - val composeNavigation = "androidx.navigation:navigation-compose:$navigationVersion" - val composeActivity = "androidx.activity:activity-compose:1.8.2" - val composeFoundation = "androidx.compose.foundation:foundation:1.6.3" - val composeUi = "androidx.compose.ui:ui:1.6.3" - val composeFoundationLayout = "androidx.compose.foundation:foundation-layout:1.6.3" - val composeMaterial = "androidx.compose.material3:material3:1.2.1" - - val composeUiReplay = "androidx.compose.ui:ui:1.5.0" // Note: don't change without testing forwards compatibility - val composeCoil = "io.coil-kt:coil-compose:2.6.0" - val apolloKotlin = "com.apollographql.apollo3:apollo-runtime:3.8.2" val apolloKotlin4 = "com.apollographql.apollo:apollo-runtime:4.1.1" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2ec54da2624..265517508e4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,4 +1,5 @@ [versions] +androidxNavigation = "2.4.2" androidxTestCore = "1.6.1" composeVersion = "1.6.11" espresso = "3.5.0" @@ -29,8 +30,17 @@ spring-boot-three = { id = "org.springframework.boot", version.ref = "springThre spring-dependency-management = { id = "io.spring.dependency-management", version = "1.0.11.RELEASE" } [libraries] +androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.6.3" } +androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version = "1.6.3" } +androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version = "1.6.3" } +androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" } +androidx-compose-ui = { module = "androidx.compose.ui:ui", version = "1.6.3" } +androidx-compose-ui-replay = { module = "androidx.compose.ui:ui", version = "1.5.0" } androidx-core = { module = "androidx.core:core", version = "1.3.2"} androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.7.0" } +androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "androidxNavigation" } +androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigation" } +coil-compose = { module = "io.coil-kt:coil-compose", version = "2.6.0" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } # test libraries diff --git a/sentry-android-core/build.gradle.kts b/sentry-android-core/build.gradle.kts index ac5f384d29c..8444659a2df 100644 --- a/sentry-android-core/build.gradle.kts +++ b/sentry-android-core/build.gradle.kts @@ -110,7 +110,7 @@ dependencies { testImplementation(projects.sentryAndroidReplay) testImplementation(projects.sentryCompose) testImplementation(projects.sentryAndroidNdk) - testRuntimeOnly(Config.Libs.composeUi) + testRuntimeOnly(libs.androidx.compose.ui) testRuntimeOnly(Config.Libs.timber) testRuntimeOnly(Config.Libs.fragment) } diff --git a/sentry-android-integration-tests/sentry-uitest-android-critical/build.gradle.kts b/sentry-android-integration-tests/sentry-uitest-android-critical/build.gradle.kts index f0c8a9f476f..706cec461c0 100644 --- a/sentry-android-integration-tests/sentry-uitest-android-critical/build.gradle.kts +++ b/sentry-android-integration-tests/sentry-uitest-android-critical/build.gradle.kts @@ -50,9 +50,9 @@ android { dependencies { implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)) implementation(libs.androidx.core) - implementation(Config.Libs.composeActivity) - implementation(Config.Libs.composeFoundation) - implementation(Config.Libs.composeMaterial) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material3) implementation(Config.Libs.constraintLayout) implementation(projects.sentryAndroidCore) } diff --git a/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts b/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts index 9f44232c758..c1844b46e7c 100644 --- a/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts +++ b/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts @@ -102,9 +102,9 @@ dependencies { } implementation(Config.Libs.appCompat) implementation(libs.androidx.core) - implementation(Config.Libs.composeActivity) - implementation(Config.Libs.composeFoundation) - implementation(Config.Libs.composeMaterial) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material3) implementation(Config.Libs.androidxRecylerView) implementation(Config.Libs.constraintLayout) implementation(libs.androidx.test.espresso.idling.resource) diff --git a/sentry-android-navigation/build.gradle.kts b/sentry-android-navigation/build.gradle.kts index 0513116e4f9..c83871525e2 100644 --- a/sentry-android-navigation/build.gradle.kts +++ b/sentry-android-navigation/build.gradle.kts @@ -66,10 +66,10 @@ kotlin { dependencies { api(projects.sentry) - compileOnly(Config.Libs.navigationRuntime) + compileOnly(libs.androidx.navigation.runtime) // tests - testImplementation(Config.Libs.navigationRuntime) + testImplementation(libs.androidx.navigation.runtime) testImplementation(libs.kotlin.test.junit) testImplementation(libs.mockito.kotlin) diff --git a/sentry-android-replay/build.gradle.kts b/sentry-android-replay/build.gradle.kts index 2d2371c9f15..667a6ba32b4 100644 --- a/sentry-android-replay/build.gradle.kts +++ b/sentry-android-replay/build.gradle.kts @@ -80,7 +80,7 @@ kotlin { dependencies { api(projects.sentry) - compileOnly(Config.Libs.composeUiReplay) + compileOnly(libs.androidx.compose.ui.replay) implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION)) // tests @@ -88,17 +88,17 @@ dependencies { testImplementation(projects.sentryAndroidCore) testImplementation(libs.roboelectric) testImplementation(libs.kotlin.test.junit) + testImplementation(libs.androidx.activity.compose) testImplementation(libs.androidx.test.ext.junit) testImplementation(libs.androidx.test.runner) testImplementation(libs.mockito.kotlin) testImplementation(libs.mockito.inline) testImplementation(Config.TestLibs.awaitility) - testImplementation(Config.Libs.composeActivity) - testImplementation(Config.Libs.composeUi) - testImplementation(Config.Libs.composeCoil) - testImplementation(Config.Libs.composeFoundation) - testImplementation(Config.Libs.composeFoundationLayout) - testImplementation(Config.Libs.composeMaterial) + testImplementation(libs.androidx.compose.ui) + testImplementation(libs.androidx.compose.foundation) + testImplementation(libs.androidx.compose.foundation.layout) + testImplementation(libs.androidx.compose.material3) + testImplementation(libs.coil.compose) } tasks.withType().configureEach { diff --git a/sentry-compose/build.gradle.kts b/sentry-compose/build.gradle.kts index a4b65eba586..cbe7096f5ff 100644 --- a/sentry-compose/build.gradle.kts +++ b/sentry-compose/build.gradle.kts @@ -49,7 +49,7 @@ kotlin { api(projects.sentry) api(projects.sentryAndroidNavigation) - compileOnly(Config.Libs.composeNavigation) + compileOnly(libs.androidx.navigation.compose) implementation(Config.Libs.lifecycleCommonJava8) } } @@ -58,7 +58,7 @@ kotlin { implementation(libs.kotlin.test.junit) implementation(libs.mockito.kotlin) implementation(libs.mockito.inline) - implementation(Config.Libs.composeNavigation) + implementation(libs.androidx.navigation.compose) implementation(libs.roboelectric) implementation(libs.androidx.test.rules) implementation(libs.androidx.test.runner) diff --git a/sentry-samples/sentry-samples-android/build.gradle.kts b/sentry-samples/sentry-samples-android/build.gradle.kts index 1a26a7b60a3..4c79cb97d53 100644 --- a/sentry-samples/sentry-samples-android/build.gradle.kts +++ b/sentry-samples/sentry-samples-android/build.gradle.kts @@ -161,12 +161,12 @@ dependencies { implementation(Config.Libs.retrofit2) implementation(Config.Libs.retrofit2Gson) - implementation(Config.Libs.composeActivity) - implementation(Config.Libs.composeFoundation) - implementation(Config.Libs.composeFoundationLayout) - implementation(Config.Libs.composeNavigation) - implementation(Config.Libs.composeMaterial) - implementation(Config.Libs.composeCoil) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.foundation.layout) + implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.compose.material3) + implementation(libs.coil.compose) implementation(Config.Libs.sentryNativeNdk) implementation(projects.sentryKotlinExtensions) From 9bdb0118bacdf07df4c61e9abae309108b549bb9 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Wed, 21 May 2025 11:08:58 -0700 Subject: [PATCH 2/4] Toml changes --- gradle/libs.versions.toml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 265517508e4..8fbd1b98538 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,8 @@ [versions] androidxNavigation = "2.4.2" androidxTestCore = "1.6.1" -composeVersion = "1.6.11" +androidxComposeVersion = "1.6.3" +jetbrainsComposeVersion = "1.6.11" espresso = "3.5.0" kotlin = "1.9.24" # see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility @@ -17,7 +18,7 @@ buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.6.5" } dokka = { id = "org.jetbrains.dokka", version = "2.0.0" } dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version = "2.0.0" } binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.0" } -compose-compiler = { id = "org.jetbrains.compose", version.ref = "composeVersion" } +compose-compiler = { id = "org.jetbrains.compose", version.ref = "jetbrainsComposeVersion" } errorprone = { id = "net.ltgt.errorprone", version = "3.0.1" } gradle-versions = { id = "com.github.ben-manes.versions", version = "0.42.0" } spotless = { id = "com.diffplug.spotless", version = "6.11.0" } @@ -30,11 +31,12 @@ spring-boot-three = { id = "org.springframework.boot", version.ref = "springThre spring-dependency-management = { id = "io.spring.dependency-management", version = "1.0.11.RELEASE" } [libraries] -androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.6.3" } -androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version = "1.6.3" } -androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version = "1.6.3" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxComposeVersion" } +androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxComposeVersion" } +androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxComposeVersion" } androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" } -androidx-compose-ui = { module = "androidx.compose.ui:ui", version = "1.6.3" } +androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidxComposeVersion" } +# Note: don't change without testing forwards compatibility androidx-compose-ui-replay = { module = "androidx.compose.ui:ui", version = "1.5.0" } androidx-core = { module = "androidx.core:core", version = "1.3.2"} androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.7.0" } From cbcf88d5d537d836a92d12d5c1dcdf97ac402c6f Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Wed, 21 May 2025 19:52:51 -0700 Subject: [PATCH 3/4] Fix compose --- 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 8fbd1b98538..6541c468e2f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ spring-boot-three = { id = "org.springframework.boot", version.ref = "springThre spring-dependency-management = { id = "io.spring.dependency-management", version = "1.0.11.RELEASE" } [libraries] -androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxComposeVersion" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "1.8.2" } androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxComposeVersion" } androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxComposeVersion" } androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" } From fadff4b96a614a21540ee51a0286de2e4ebc25ba Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Wed, 21 May 2025 19:52:58 -0700 Subject: [PATCH 4/4] Fix activity --- 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 6541c468e2f..19a6626a323 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ spring-boot-three = { id = "org.springframework.boot", version.ref = "springThre spring-dependency-management = { id = "io.spring.dependency-management", version = "1.0.11.RELEASE" } [libraries] -androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "1.8.2" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.8.2" } androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxComposeVersion" } androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxComposeVersion" } androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" }