From 8b5849f11fd1dc7f43f1eb5b1672b06ef8d73f15 Mon Sep 17 00:00:00 2001 From: Neel Doshi Date: Fri, 5 Jul 2024 12:38:27 +0530 Subject: [PATCH] Deps: Migrated `androidxLifecycle` to Version Catalog --- WordPress/build.gradle | 20 ++++++++++---------- build.gradle | 1 - gradle/libs.versions.toml | 12 ++++++++++++ libs/editor/build.gradle | 6 +++--- libs/image-editor/build.gradle | 10 +++++----- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 81ac233c94d8..3a42debcfccf 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -404,9 +404,9 @@ dependencies { implementation libs.google.gson implementation libs.androidx.core implementation libs.androidx.core.ktx - implementation "androidx.lifecycle:lifecycle-common:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-runtime:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:$androidxLifecycleVersion" + implementation libs.androidx.lifecycle.common + implementation libs.androidx.lifecycle.runtime + implementation libs.androidx.lifecycle.runtime.ktx implementation "androidx.activity:activity:$androidxActivityVersion" implementation "androidx.activity:activity-ktx:$androidxActivityVersion" implementation "androidx.activity:activity-compose:$androidxActivityVersion" @@ -424,12 +424,12 @@ dependencies { implementation "androidx.work:work-runtime:$androidxWorkManagerVersion" implementation "androidx.work:work-runtime-ktx:$androidxWorkManagerVersion" implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayoutVersion" - implementation "androidx.lifecycle:lifecycle-viewmodel:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-livedata-core:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-livedata:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-process:$androidxLifecycleVersion" + implementation libs.androidx.lifecycle.viewmodel + implementation libs.androidx.lifecycle.viewmodel.ktx + implementation libs.androidx.lifecycle.livedata.core + implementation libs.androidx.lifecycle.livedata + implementation libs.androidx.lifecycle.livedata.ktx + implementation libs.androidx.lifecycle.process implementation "com.android.volley:volley:$androidVolleyVersion" implementation "com.google.android.play:review:$googlePlayReviewVersion" implementation "com.google.android.play:review-ktx:$googlePlayReviewVersion" @@ -559,7 +559,7 @@ dependencies { implementation "androidx.compose.ui:ui-tooling-preview" implementation "androidx.compose.material:material" // - Jetpack Compose - AndroidX - implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$androidxLifecycleVersion" + implementation libs.androidx.lifecycle.viewmodel.compose implementation "androidx.constraintlayout:constraintlayout-compose:$androidxConstraintlayoutComposeVersion" // - Jetpack Compose - Other implementation "io.coil-kt:coil-compose:$coilComposeVersion" diff --git a/build.gradle b/build.gradle index d5926700ecda..e39e36dc6153 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,6 @@ ext { androidxActivityVersion = '1.8.0' androidxFragmentVersion = '1.6.2' androidxGridlayoutVersion = '1.0.0' - androidxLifecycleVersion = '2.6.2' androidxPercentlayoutVersion = '1.0.0' androidxPreferenceVersion = '1.2.0' androidxRecyclerviewVersion = '1.3.0' diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 80fe55dd67f3..151034836e98 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,6 +2,7 @@ androidxArchCore = '2.2.0' androidxComposeNavigation = '2.7.6' androidxCore = '1.10.0' +androidxLifecycle = '2.6.2' androidxWebkit = '1.11.0' automatticRest = '1.0.8' googlePlayAppUpdate = '2.1.0' @@ -21,6 +22,17 @@ androidx-webkit = {group = "androidx.webkit", name = "webkit", version.ref = "an automattic-rest = { group = "com.automattic", name = "rest", version.ref = "automatticRest" } google-gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } wordPress-persistentEditText = { group = "org.wordpress", name = "persistentedittext", version.ref = "wordPressPersistentEditText" } +androidx-lifecycle-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime", version.ref = "androidxLifecycle" } +androidx-lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common", version.ref = "androidxLifecycle" } +androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "androidxLifecycle" } +androidx-lifecycle-livedata-core = { group = "androidx.lifecycle", name = "lifecycle-livedata-core", version.ref = "androidxLifecycle" } +androidx-lifecycle-livedata = { group = "androidx.lifecycle", name = "lifecycle-livedata", version.ref = "androidxLifecycle" } +androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "androidxLifecycle" } +androidx-lifecycle-process = { group = "androidx.lifecycle", name = "lifecycle-process", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" } +androidx-lifecycle-viewmodel-savedstate = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-savedstate", version.ref = "androidxLifecycle" } [plugins] diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle index 59284cc59c73..8117249c0b31 100644 --- a/libs/editor/build.gradle +++ b/libs/editor/build.gradle @@ -96,9 +96,9 @@ dependencies { implementation "org.wordpress:utils:$wordPressUtilsVersion" - implementation "androidx.lifecycle:lifecycle-common:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-runtime:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-livedata-core:$androidxLifecycleVersion" + implementation libs.androidx.lifecycle.common + implementation libs.androidx.lifecycle.runtime + implementation libs.androidx.lifecycle.livedata.core implementation libs.androidx.core implementation "androidx.fragment:fragment:$androidxFragmentVersion" implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion" diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle index 4bb363acb45b..bbb34255976a 100644 --- a/libs/image-editor/build.gradle +++ b/libs/image-editor/build.gradle @@ -57,11 +57,11 @@ dependencies { implementation "com.google.android.material:material:$googleMaterialVersion" implementation "androidx.navigation:navigation-fragment:$gradle.ext.navigationVersion" implementation "androidx.navigation:navigation-ui:$gradle.ext.navigationVersion" - implementation "androidx.lifecycle:lifecycle-common:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-runtime:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-viewmodel:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$androidxLifecycleVersion" - implementation "androidx.lifecycle:lifecycle-livedata-core:$androidxLifecycleVersion" + implementation libs.androidx.lifecycle.common + implementation libs.androidx.lifecycle.runtime + implementation libs.androidx.lifecycle.viewmodel + implementation libs.androidx.lifecycle.viewmodel.savedstate + implementation libs.androidx.lifecycle.livedata.core implementation ("com.github.yalantis:ucrop:$uCropVersion") { exclude group: 'com.squareup.okhttp3' exclude group: 'androidx.core', module: 'core'