Skip to content

Commit 8e1c075

Browse files
authored
Migrate Androidx dependencies to version catalog (#4464)
* Migrate Androidx dependencies to version catalog * fragment ktx
1 parent 38ba389 commit 8e1c075

File tree

10 files changed

+33
-36
lines changed

10 files changed

+33
-36
lines changed

buildSrc/src/main/java/Config.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,9 @@ object Config {
2424

2525
object Libs {
2626
val okHttpVersion = "4.9.2"
27-
val appCompat = "androidx.appcompat:appcompat:1.3.0"
2827
val timber = "com.jakewharton.timber:timber:4.7.1"
2928
val okhttp = "com.squareup.okhttp3:okhttp:$okHttpVersion"
3029
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.14"
31-
val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.3"
32-
33-
private val lifecycleVersion = "2.2.0"
34-
val lifecycleProcess = "androidx.lifecycle:lifecycle-process:$lifecycleVersion"
35-
val lifecycleCommonJava8 = "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
36-
val androidxSqlite = "androidx.sqlite:sqlite:2.3.1"
37-
val androidxRecylerView = "androidx.recyclerview:recyclerview:1.2.1"
38-
val androidxAnnotation = "androidx.annotation:annotation:1.9.1"
3930

4031
val slf4jApi = "org.slf4j:slf4j-api:1.7.30"
4132
val slf4jApi2 = "org.slf4j:slf4j-api:2.0.5"
@@ -71,8 +62,6 @@ object Config {
7162

7263
val coroutinesAndroid = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
7364

74-
val fragment = "androidx.fragment:fragment-ktx:1.3.5"
75-
7665
val reactorCore = "io.projectreactor:reactor-core:3.5.3"
7766
val contextPropagation = "io.micrometer:context-propagation:1.1.0"
7867

gradle/libs.versions.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[versions]
2+
androidxLifecycle = "2.2.0"
23
androidxNavigation = "2.4.2"
34
androidxTestCore = "1.6.1"
45
androidxCompose = "1.6.3"
@@ -42,17 +43,25 @@ spring-dependency-management = { id = "io.spring.dependency-management", version
4243
gretty = { id = "org.gretty", version = "4.0.0" }
4344

4445
[libraries]
46+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.3.0" }
47+
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.9.1" }
4548
androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.8.2" }
4649
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidxCompose" }
4750
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidxCompose" }
4851
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" }
4952
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidxCompose" }
5053
# Note: don't change without testing forwards compatibility
5154
androidx-compose-ui-replay = { module = "androidx.compose.ui:ui", version = "1.5.0" }
55+
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version = "2.1.3" }
5256
androidx-core = { module = "androidx.core:core", version = "1.3.2" }
5357
androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.7.0" }
58+
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version = "1.3.5" }
59+
androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidxLifecycle" }
60+
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "androidxLifecycle" }
5461
androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime", version.ref = "androidxNavigation" }
5562
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigation" }
63+
androidx-sqlite = { module = "androidx.sqlite:sqlite", version = "2.3.1" }
64+
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.2.1" }
5665
coil-compose = { module = "io.coil-kt:coil-compose", version = "2.6.0" }
5766
errorprone-core = { module = "com.google.errorprone:error_prone_core", version = "2.11.0" }
5867
jetbrains-annotations = { module = "org.jetbrains:annotations", version = "23.0.0"}

sentry-android-core/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ dependencies {
8585
compileOnly(projects.sentryCompose)
8686

8787
// lifecycle processor, session tracking
88-
implementation(Config.Libs.lifecycleProcess)
89-
implementation(Config.Libs.lifecycleCommonJava8)
88+
implementation(libs.androidx.lifecycle.common.java8)
89+
implementation(libs.androidx.lifecycle.process)
9090
implementation(libs.androidx.core)
9191

9292
errorprone(libs.errorprone.core)
@@ -111,6 +111,6 @@ dependencies {
111111
testImplementation(projects.sentryCompose)
112112
testImplementation(projects.sentryAndroidNdk)
113113
testRuntimeOnly(libs.androidx.compose.ui)
114+
testRuntimeOnly(libs.androidx.fragment.ktx)
114115
testRuntimeOnly(Config.Libs.timber)
115-
testRuntimeOnly(Config.Libs.fragment)
116116
}

sentry-android-fragment/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ kotlin {
6565
dependencies {
6666
api(projects.sentry)
6767

68-
compileOnly(Config.Libs.fragment)
68+
compileOnly(libs.androidx.fragment.ktx)
6969

7070
// tests
71-
testImplementation(Config.Libs.fragment)
71+
testImplementation(libs.androidx.fragment.ktx)
7272
testImplementation(libs.kotlin.test.junit)
7373
testImplementation(libs.mockito.kotlin)
7474
testImplementation(libs.mockito.inline)

sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ android {
8686
dependencies {
8787
implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))
8888
implementation(projects.sentryAndroid)
89-
implementation(Config.Libs.appCompat)
89+
implementation(libs.androidx.appcompat)
90+
implementation(libs.androidx.constraintlayout)
9091
implementation(libs.androidx.core)
91-
implementation(Config.Libs.androidxRecylerView)
92-
implementation(Config.Libs.constraintLayout)
92+
implementation(libs.androidx.recyclerview)
9393
implementation(libs.androidx.test.espresso.idling.resource)
9494

9595
compileOnly(libs.nopen.annotations)

sentry-android-integration-tests/sentry-uitest-android-critical/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ android {
4949

5050
dependencies {
5151
implementation(kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))
52-
implementation(libs.androidx.core)
5352
implementation(libs.androidx.activity.compose)
5453
implementation(libs.androidx.compose.foundation)
5554
implementation(libs.androidx.compose.material3)
56-
implementation(Config.Libs.constraintLayout)
55+
implementation(libs.androidx.constraintlayout)
56+
implementation(libs.androidx.core)
5757
implementation(projects.sentryAndroidCore)
5858
}
5959

sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ dependencies {
100100
} else {
101101
implementation(projects.sentryAndroidCore)
102102
}
103-
implementation(Config.Libs.appCompat)
104-
implementation(libs.androidx.core)
103+
implementation(libs.androidx.appcompat)
105104
implementation(libs.androidx.activity.compose)
106105
implementation(libs.androidx.compose.foundation)
107106
implementation(libs.androidx.compose.material3)
108-
implementation(Config.Libs.androidxRecylerView)
109-
implementation(Config.Libs.constraintLayout)
107+
implementation(libs.androidx.constraintlayout)
108+
implementation(libs.androidx.core)
109+
implementation(libs.androidx.recyclerview)
110110
implementation(libs.androidx.test.espresso.idling.resource)
111111
implementation(Config.Libs.leakCanary)
112112

sentry-android-sqlite/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ kotlin {
6767
dependencies {
6868
api(projects.sentry)
6969

70-
compileOnly(Config.Libs.androidxSqlite)
70+
compileOnly(libs.androidx.sqlite)
7171

7272
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
7373

7474
// tests
75-
testImplementation(Config.Libs.androidxSqlite)
75+
testImplementation(libs.androidx.sqlite)
7676
testImplementation(libs.kotlin.test.junit)
7777
testImplementation(libs.androidx.test.ext.junit)
7878
testImplementation(libs.mockito.kotlin)

sentry-compose/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ kotlin {
5050
api(projects.sentryAndroidNavigation)
5151

5252
compileOnly(libs.androidx.navigation.compose)
53-
implementation(Config.Libs.lifecycleCommonJava8)
53+
implementation(libs.androidx.lifecycle.common.java8)
5454
}
5555
}
5656
val androidUnitTest by getting {

sentry-samples/sentry-samples-android/build.gradle.kts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ dependencies {
145145
implementation(projects.sentryAndroidFragment)
146146
implementation(projects.sentryAndroidTimber)
147147
implementation(projects.sentryCompose)
148+
implementation(projects.sentryKotlinExtensions)
148149
implementation(projects.sentryOkhttp)
149-
implementation(Config.Libs.fragment)
150150
implementation(Config.Libs.timber)
151151

152152
// how to exclude androidx if release health feature is disabled
@@ -156,21 +156,20 @@ dependencies {
156156
// exclude(group = "androidx.core", module = "core")
157157
// }
158158

159-
implementation(Config.Libs.appCompat)
160-
implementation(Config.Libs.androidxRecylerView)
159+
implementation(Config.Libs.coroutinesAndroid)
161160
implementation(Config.Libs.retrofit2)
162161
implementation(Config.Libs.retrofit2Gson)
162+
implementation(Config.Libs.sentryNativeNdk)
163163

164164
implementation(libs.androidx.activity.compose)
165+
implementation(libs.androidx.appcompat)
166+
implementation(libs.androidx.fragment.ktx)
165167
implementation(libs.androidx.compose.foundation)
166168
implementation(libs.androidx.compose.foundation.layout)
167-
implementation(libs.androidx.navigation.compose)
168169
implementation(libs.androidx.compose.material3)
170+
implementation(libs.androidx.navigation.compose)
171+
implementation(libs.androidx.recyclerview)
169172
implementation(libs.coil.compose)
170-
implementation(Config.Libs.sentryNativeNdk)
171-
172-
implementation(projects.sentryKotlinExtensions)
173-
implementation(Config.Libs.coroutinesAndroid)
174173

175174
debugImplementation(Config.Libs.leakCanary)
176175
}

0 commit comments

Comments
 (0)