Migrate paging to use Gradle Version Catalogs
- Ran development/versionCatalogMigrate.sh
- Manually updated imports in build.gradle files
Test: ./gradlew tasks
Change-Id: Ic8f205f723e4f01b1e103590904a89f76d1f8c10
diff --git a/development/versionCatalogMigrate.sh b/development/versionCatalogMigrate.sh
index 39526cc..f7079fd 100755
--- a/development/versionCatalogMigrate.sh
+++ b/development/versionCatalogMigrate.sh
@@ -39,7 +39,6 @@
find -iname build.gradle | xargs sed -i "s/GSON/libs.gson/"
find -iname build.gradle | xargs sed -i "s/GUAVA_ANDROID/libs.guavaAndroid/"
find -iname build.gradle | xargs sed -i "s/GUAVA_LISTENABLE_FUTURE/libs.guavaListenableFuture/"
-find -iname build.gradle | xargs sed -i "s/GUAVA/libs.guava/"
find -iname build.gradle | xargs sed -i "s/GRADLE_INCAP_HELPER_PROCESSOR/libs.gradleIncapHelperProcessor/"
find -iname build.gradle | xargs sed -i "s/GRADLE_INCAP_HELPER/libs.gradleIncapHelper/"
find -iname build.gradle | xargs sed -i "s/KOTLIN_ANNOTATION_PROCESSING_EMBEDDABLE/libs.kotlinAnnotationProcessingEmbeddable/"
@@ -105,3 +104,4 @@
find -iname build.gradle | xargs sed -i "s/XPP3/libs.xpp3/"
find -iname build.gradle | xargs sed -i "s/XMLPULL/libs.xmlpull/"
find -iname build.gradle | xargs sed -i "s/JUNIT/libs.junit/"
+find -iname build.gradle | xargs sed -i "s/GUAVA/libs.guava/"
diff --git a/paging/common/build.gradle b/paging/common/build.gradle
index 4d61a3f..ae0f19b 100644
--- a/paging/common/build.gradle
+++ b/paging/common/build.gradle
@@ -14,14 +14,10 @@
* limitations under the License.
*/
-
-import androidx.build.AndroidXExtension
import androidx.build.LibraryGroups
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("kotlin")
@@ -30,20 +26,20 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
api("androidx.arch.core:core-common:2.1.0")
- api(KOTLIN_STDLIB)
- api(KOTLIN_COROUTINES_CORE)
+ api(libs.kotlinStdlib)
+ api(libs.kotlinCoroutinesCore)
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
- testImplementation(MOCKITO_KOTLIN, {
+ testImplementation(libs.junit)
+ testImplementation(libs.mockitoCore)
+ testImplementation(libs.mockitoKotlin, {
exclude group: "org.mockito" // to keep control on the mockito version
})
testImplementation(project(":internal-testutils-common"))
testImplementation(project(":internal-testutils-ktx"))
testImplementation(project(":internal-testutils-paging"))
- testImplementation(KOTLIN_TEST)
- testImplementation(KOTLIN_COROUTINES_TEST)
- testImplementation(TRUTH)
+ testImplementation(libs.kotlinTest)
+ testImplementation(libs.kotlinCoroutinesTest)
+ testImplementation(libs.truth)
}
androidx {
diff --git a/paging/common/ktx/build.gradle b/paging/common/ktx/build.gradle
index 36a2f66..f1c6ca8 100644
--- a/paging/common/ktx/build.gradle
+++ b/paging/common/ktx/build.gradle
@@ -14,10 +14,7 @@
* limitations under the License.
*/
-import static androidx.build.dependencies.DependenciesKt.*
import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-import androidx.build.AndroidXExtension
import androidx.build.Publish
plugins {
diff --git a/paging/guava/build.gradle b/paging/guava/build.gradle
index 9c323c6..0b21de1 100644
--- a/paging/guava/build.gradle
+++ b/paging/guava/build.gradle
@@ -14,14 +14,10 @@
* limitations under the License.
*/
-
-import androidx.build.AndroidXExtension
import androidx.build.LibraryGroups
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -30,15 +26,15 @@
dependencies {
api(project(":paging:paging-common"))
- api(KOTLIN_STDLIB)
- api(GUAVA_ANDROID)
- implementation(KOTLIN_COROUTINES_GUAVA)
+ api(libs.kotlinStdlib)
+ api(libs.guavaAndroid)
+ implementation(libs.kotlinCoroutinesGuava)
testImplementation(project(":internal-testutils-common"))
testImplementation(project(":internal-testutils-paging"))
- testImplementation(JUNIT)
- testImplementation(KOTLIN_TEST)
- testImplementation(KOTLIN_COROUTINES_TEST)
+ testImplementation(libs.junit)
+ testImplementation(libs.kotlinTest)
+ testImplementation(libs.kotlinCoroutinesTest)
}
androidx {
diff --git a/paging/integration-tests/testapp/build.gradle b/paging/integration-tests/testapp/build.gradle
index 16c5130..4b067c3 100644
--- a/paging/integration-tests/testapp/build.gradle
+++ b/paging/integration-tests/testapp/build.gradle
@@ -14,12 +14,8 @@
* limitations under the License.
*/
-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.MULTIDEX
-import static androidx.build.dependencies.DependenciesKt.getKOTLIN_STDLIB
-
plugins {
id("AndroidXPlugin")
id("com.android.application")
@@ -38,11 +34,11 @@
kapt(projectOrArtifact(":room:room-compiler"))
- implementation(MULTIDEX)
+ implementation(libs.multidex)
implementation(projectOrArtifact(":recyclerview:recyclerview"))
implementation("androidx.fragment:fragment-ktx:1.3.0")
implementation("androidx.appcompat:appcompat:1.1.0")
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
}
kapt {
diff --git a/paging/paging-compose/build.gradle b/paging/paging-compose/build.gradle
index b08498c..a481bd4 100644
--- a/paging/paging-compose/build.gradle
+++ b/paging/paging-compose/build.gradle
@@ -19,8 +19,6 @@
import androidx.build.Publish
import androidx.build.RunApiTasks
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -32,16 +30,16 @@
dependencies {
kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
api(projectOrArtifact(":compose:foundation:foundation"))
api(projectOrArtifact(":paging:paging-common"))
androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4"))
androidTestImplementation(project(":compose:test-utils"))
androidTestImplementation(projectOrArtifact(":internal-testutils-paging"))
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(JUNIT)
- androidTestImplementation(TRUTH)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.junit)
+ androidTestImplementation(libs.truth)
}
androidx {
diff --git a/paging/paging-compose/integration-tests/paging-demos/build.gradle b/paging/paging-compose/integration-tests/paging-demos/build.gradle
index fe7986fb..ef6e14d 100644
--- a/paging/paging-compose/integration-tests/paging-demos/build.gradle
+++ b/paging/paging-compose/integration-tests/paging-demos/build.gradle
@@ -14,11 +14,8 @@
* limitations under the License.
*/
-
import androidx.build.Publish
-import static androidx.build.dependencies.DependenciesKt.getKOTLIN_STDLIB
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -29,7 +26,7 @@
dependencies {
kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
implementation(projectOrArtifact(":compose:integration-tests:demos:common"))
implementation(projectOrArtifact(":compose:foundation:foundation"))
diff --git a/paging/paging-compose/samples/build.gradle b/paging/paging-compose/samples/build.gradle
index 3ae394a..cdf0963 100644
--- a/paging/paging-compose/samples/build.gradle
+++ b/paging/paging-compose/samples/build.gradle
@@ -18,8 +18,6 @@
import androidx.build.LibraryVersions
import androidx.build.LibraryType
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -29,7 +27,7 @@
dependencies {
kotlinPlugin(projectOrArtifact(":compose:compiler:compiler"))
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
compileOnly(projectOrArtifact(":annotation:annotation-sampled"))
implementation(projectOrArtifact(":compose:foundation:foundation"))
diff --git a/paging/runtime/build.gradle b/paging/runtime/build.gradle
index 1a8574a..32d8093 100644
--- a/paging/runtime/build.gradle
+++ b/paging/runtime/build.gradle
@@ -18,8 +18,6 @@
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -41,23 +39,23 @@
api("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0")
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0")
api("androidx.recyclerview:recyclerview:1.2.0-rc01")
- api(KOTLIN_STDLIB)
- api(KOTLIN_COROUTINES_ANDROID)
+ api(libs.kotlinStdlib)
+ api(libs.kotlinCoroutinesAndroid)
implementation("androidx.core:core-ktx:1.2.0")
androidTestImplementation(project(":internal-testutils-common"))
androidTestImplementation(project(":internal-testutils-ktx"))
androidTestImplementation(project(":internal-testutils-paging"))
androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-runtime-testing"))
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testRunner)
androidTestImplementation("androidx.arch.core:core-testing:2.1.0")
- androidTestImplementation(TRUTH)
- androidTestImplementation(KOTLIN_TEST)
- androidTestImplementation(KOTLIN_COROUTINES_TEST)
- androidTestImplementation(JUNIT)
- androidTestImplementation(MULTIDEX)
+ androidTestImplementation(libs.truth)
+ androidTestImplementation(libs.kotlinTest)
+ androidTestImplementation(libs.kotlinCoroutinesTest)
+ androidTestImplementation(libs.junit)
+ androidTestImplementation(libs.multidex)
}
androidx {
diff --git a/paging/rxjava2/build.gradle b/paging/rxjava2/build.gradle
index 4868a77..d7a7de6 100644
--- a/paging/rxjava2/build.gradle
+++ b/paging/rxjava2/build.gradle
@@ -14,14 +14,10 @@
* limitations under the License.
*/
-
-import androidx.build.AndroidXExtension
import androidx.build.LibraryGroups
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -31,19 +27,19 @@
dependencies {
api(project(":paging:paging-common"))
api("androidx.arch.core:core-runtime:2.1.0")
- api(RX_JAVA)
- implementation(KOTLIN_STDLIB)
- implementation(KOTLIN_COROUTINES_RX2)
+ api(libs.rxjava2)
+ implementation(libs.kotlinStdlib)
+ implementation(libs.kotlinCoroutinesRx2)
testImplementation(project(":internal-testutils-common"))
testImplementation(project(":internal-testutils-paging"))
- testImplementation(JUNIT)
- testImplementation(KOTLIN_TEST)
- testImplementation(KOTLIN_COROUTINES_TEST)
+ testImplementation(libs.junit)
+ testImplementation(libs.kotlinTest)
+ testImplementation(libs.kotlinCoroutinesTest)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
androidTestImplementation("androidx.arch.core:core-testing:2.1.0")
}
diff --git a/paging/rxjava2/ktx/build.gradle b/paging/rxjava2/ktx/build.gradle
index 1d5a68a..84384a3 100644
--- a/paging/rxjava2/ktx/build.gradle
+++ b/paging/rxjava2/ktx/build.gradle
@@ -30,13 +30,13 @@
api(project(":paging:paging-rxjava2"))
// Ensure that the -ktx dependency graph mirrors the Java dependency graph
api(project(":paging:paging-common-ktx"))
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
androidTestImplementation("androidx.arch.core:core-testing:2.0.1")
- androidTestImplementation(ESPRESSO_CORE)
+ androidTestImplementation(libs.espressoCore)
}
androidx {
diff --git a/paging/rxjava3/build.gradle b/paging/rxjava3/build.gradle
index 63b1a15..5b5bf91 100644
--- a/paging/rxjava3/build.gradle
+++ b/paging/rxjava3/build.gradle
@@ -14,14 +14,10 @@
* limitations under the License.
*/
-
-import androidx.build.AndroidXExtension
import androidx.build.LibraryGroups
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -31,19 +27,19 @@
dependencies {
api(project(":paging:paging-common"))
api("androidx.arch.core:core-runtime:2.1.0")
- api(RX_JAVA3)
- implementation(KOTLIN_STDLIB)
- implementation(KOTLIN_COROUTINES_RX3)
+ api(libs.rxjava3)
+ implementation(libs.kotlinStdlib)
+ implementation(libs.kotlinCoroutinesRx3)
testImplementation(project(":internal-testutils-common"))
testImplementation(project(":internal-testutils-paging"))
- testImplementation(JUNIT)
- testImplementation(KOTLIN_TEST)
- testImplementation(KOTLIN_COROUTINES_TEST)
+ testImplementation(libs.junit)
+ testImplementation(libs.kotlinTest)
+ testImplementation(libs.kotlinCoroutinesTest)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
androidTestImplementation("androidx.arch.core:core-testing:2.1.0")
}
diff --git a/paging/samples/build.gradle b/paging/samples/build.gradle
index 1ec84e5..ec0cb24 100644
--- a/paging/samples/build.gradle
+++ b/paging/samples/build.gradle
@@ -16,11 +16,8 @@
import androidx.build.LibraryGroups
import androidx.build.LibraryType
-import androidx.build.LibraryVersions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.library")
@@ -49,9 +46,9 @@
implementation(project(":paging:paging-runtime"))
implementation(project(":paging:paging-rxjava2"))
- implementation(GUAVA_ANDROID)
- implementation(MULTIDEX)
- implementation(RETROFIT)
+ implementation(libs.guavaAndroid)
+ implementation(libs.multidex)
+ implementation(libs.retrofit)
}
androidx {