Migrate room to use Gradle Version Catalogs
- Ran development/versionCatalogMigrate.sh in room/
- Manually updated imports in build.gradle files
Test: ./gradlew tasks
Change-Id: Ia70bd32a5f1167efcf1f5c1a6844b5f92572c098
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
index 4082b17..763d853 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
@@ -43,15 +43,9 @@
const val AUTO_SERVICE_PROCESSOR = "com.google.auto.service:auto-service:1.0-rc6"
const val AUTO_VALUE = "com.google.auto.value:auto-value:1.6.3"
const val AUTO_VALUE_ANNOTATIONS = "com.google.auto.value:auto-value-annotations:1.6.3"
-const val AUTO_VALUE_PARCEL = "com.ryanharter.auto.value:auto-value-parcel:0.2.6"
-const val ANTLR = "org.antlr:antlr4:4.7.1"
-const val APACHE_COMMONS_CODEC = "commons-codec:commons-codec:1.10"
-const val ASSERTJ = "org.assertj:assertj-core:3.11.1"
-const val CHECKER_FRAMEWORK = "org.checkerframework:checker-qual:2.5.3"
const val CONSTRAINT_LAYOUT = "androidx.constraintlayout:constraintlayout:2.0.1@aar"
const val CONSTRAINT_LAYOUT_CORE = "androidx.constraintlayout:constraintlayout-core:1.0.0-alpha1"
const val DAGGER = "com.google.dagger:dagger:2.35"
-const val DAGGER_COMPILER = "com.google.dagger:dagger-compiler:2.35"
const val DEXMAKER_MOCKITO = "com.linkedin.dexmaker:dexmaker-mockito:2.25.0"
const val DEXMAKER_MOCKITO_INLINE = "com.linkedin.dexmaker:dexmaker-mockito-inline:2.25.0"
const val ESPRESSO_CONTRIB = "androidx.test.espresso:espresso-contrib:3.3.0"
@@ -60,11 +54,7 @@
const val ESPRESSO_IDLING_NET = "androidx.test.espresso.idling:idling-net:3.3.0"
const val ESPRESSO_IDLING_RESOURCE = "androidx.test.espresso:espresso-idling-resource:3.3.0"
const val ESPRESSO_WEB = "androidx.test.espresso:espresso-web:3.3.0"
-const val FINDBUGS = "com.google.code.findbugs:jsr305:3.0.2"
-const val FIREBASE_APPINDEXING = "com.google.firebase:firebase-appindexing:19.2.0"
-const val GCM_NETWORK_MANAGER = "com.google.android.gms:play-services-gcm:17.0.0"
const val GOOGLE_COMPILE_TESTING = "com.google.testing.compile:compile-testing:0.18"
-const val GSON = "com.google.code.gson:gson:2.8.0"
const val GUAVA_VERSION = "29.0-jre"
const val GUAVA = "com.google.guava:guava:$GUAVA_VERSION"
const val GUAVA_ANDROID_VERSION = "29.0-android"
@@ -74,12 +64,10 @@
const val GRADLE_INCAP_HELPER_PROCESSOR = "net.ltgt.gradle.incap:incap-processor:0.2"
const val INTELLIJ_ANNOTATIONS = "com.intellij:annotations:12.0"
const val JAVAPOET = "com.squareup:javapoet:1.13.0"
-const val JSQLPARSER = "com.github.jsqlparser:jsqlparser:3.1"
const val JSR250 = "javax.annotation:javax.annotation-api:1.2"
const val JUNIT = "junit:junit:4.12"
const val KOTLINPOET = "com.squareup:kotlinpoet:1.8.0"
const val KOTLIN_COMPILE_TESTING = "com.github.tschuchortdev:kotlin-compile-testing:1.4.1"
-const val KOTLIN_COMPILE_TESTING_KSP = "com.github.tschuchortdev:kotlin-compile-testing-ksp:1.4.1"
/**
* KSP is used both as a plugin and runtime dependency, hence its version is declared in the
@@ -100,9 +88,6 @@
const val MOCKITO_KOTLIN = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
const val MULTIDEX = "androidx.multidex:multidex:2.0.1"
const val NULLAWAY = "com.uber.nullaway:nullaway:0.3.7"
-const val PLAY_CORE = "com.google.android.play:core:1.9.1"
-const val PLAY_SERVICES_BASEMENT = "com.google.android.gms:play-services-basement:17.0.0"
-const val REACTIVE_STREAMS = "org.reactivestreams:reactive-streams:1.0.0"
const val RX_JAVA = "io.reactivex.rxjava2:rxjava:2.2.9"
const val RX_JAVA3 = "io.reactivex.rxjava3:rxjava:3.0.0"
val SKIKO_VERSION = System.getenv("SKIKO_VERSION") ?: "0.3.1"
@@ -125,12 +110,9 @@
}
const val TRUTH = "com.google.truth:truth:1.0.1"
const val VIEW_BINDING = "androidx.databinding:viewbinding:4.1.2"
-const val XERIAL = "org.xerial:sqlite-jdbc:3.25.2"
const val XPP3 = "xpp3:xpp3:1.1.4c"
const val XMLPULL = "xmlpull:xmlpull:1.1.3.1"
-const val RETROFIT = "com.squareup.retrofit2:retrofit:2.7.2"
-const val OKHTTP_MOCKWEBSERVER = "com.squareup.okhttp3:mockwebserver:3.14.7"
const val SQLDELIGHT_ANDROID = "com.squareup.sqldelight:android-driver:1.3.0"
const val SQLDELIGHT_COROUTINES_EXT = "com.squareup.sqldelight:coroutines-extensions:1.3.0"
@@ -140,8 +122,6 @@
const val PROTOBUF_COMPILER = "com.google.protobuf:protoc:3.10.0"
const val PROTOBUF_LITE = "com.google.protobuf:protobuf-javalite:3.10.0"
-const val WIRE_RUNTIME = "com.squareup.wire:wire-runtime:3.6.0"
-
// The following versions change depending on whether we are in the main or ui project - the
// specific versions are configured in build_dependencies.gradle as they are needed during
// buildSrc configuration. They are then set here in AndroidXPlugin when configuring the root
@@ -160,12 +140,6 @@
val KOTLIN_TEST_JUNIT get() = "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
val KOTLIN_TEST_JS get() = "org.jetbrains.kotlin:kotlin-test-js:$kotlinVersion"
val KOTLIN_REFLECT get() = "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
-val KOTLIN_COMPILER_EMBEDDABLE
- get() = "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion"
-val KOTLIN_COMPILER_DAEMON_EMBEDDABLE
- get() = "org.jetbrains.kotlin:kotlin-daemon-embeddable:$kotlinVersion"
-val KOTLIN_ANNOTATION_PROCESSING_EMBEDDABLE
- get() = "org.jetbrains.kotlin:kotlin-annotation-processing-embeddable:$kotlinVersion"
internal lateinit var kotlinCoroutinesVersion: String
@@ -186,7 +160,6 @@
internal lateinit var agpVersion: String
-const val AGP_STABLE = "com.android.tools.build:gradle:3.5.2"
val AGP_LATEST get() = "com.android.tools.build:gradle:$agpVersion"
internal lateinit var lintVersion: String
diff --git a/development/versionCatalogMigrate.sh b/development/versionCatalogMigrate.sh
index da5fa97..0e36b76 100755
--- a/development/versionCatalogMigrate.sh
+++ b/development/versionCatalogMigrate.sh
@@ -99,7 +99,7 @@
find -iname build.gradle | xargs sed -i "s/TRUTH/libs.truth/"
find -iname build.gradle | xargs sed -i "s/VIEW_BINDING/libs.viewBinding/"
find -iname build.gradle | xargs sed -i "s/WIRE_RUNTIME/libs.wireRuntime/"
-find -iname build.gradle | xargs sed -i "s/XERIAL/libs.xerial/"
+find -iname build.gradle | xargs sed -i "s/XERIAL/libs.sqliteJdbc/"
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/"
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c1eaf7b..893a5df 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -89,7 +89,7 @@
kotlinCoroutinesRx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinCoroutines" }
kotlinCoroutinesRx3 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3", version.ref = "kotlinCoroutines" }
kotlinDaemonEmbeddable = { module = "org.jetbrains.kotlin:kotlin-daemon-embeddable", version.ref = "kotlin" }
-kotlinMetadataJvm = { module = "org.jetbrains.kotlinx:kotlinx-metadata-jvm", version = "0.2.0" }
+kotlinMetadataJvm = { module = "org.jetbrains.kotlinx:kotlinx-metadata-jvm", version = "0.3.0" }
kotlinStdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinStdlibCommon = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" }
kotlinStdlibJdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
@@ -130,6 +130,7 @@
shadow = { module = "com.github.jengelman.gradle.plugins:shadow", version = "6.1.0" }
sqldelightAndroid = { module = "com.squareup.sqldelight:android-driver", version.ref = "sqldelight" }
sqldelightCoroutinesExt = { module = "com.squareup.sqldelight:coroutines-extensions", version.ref = "sqldelight" }
+sqliteJdbc = { module = "org.xerial:sqlite-jdbc", version = "3.25.2" }
testCore = { module = "androidx.test:core", version.ref = "androidxTest" }
testExtJunit = { module = "androidx.test.ext:junit", version.ref = "androidxTestExt" }
testExtJunitKtx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" }
@@ -142,6 +143,5 @@
viewBinding = { module = "androidx.databinding:viewbinding", version = "4.1.2" }
wireGradlePlugin = { module = "com.squareup.wire:wire-gradle-plugin", version.ref = "wire" }
wireRuntime = { module = "com.squareup.wire:wire-runtime", version.ref = "wire" }
-xerial = { module = "org.xerial:sqlite-jdbc", version = "3.25.2" }
xpp3 = { module = "xpp3:xpp3", version = "1.1.4c" }
xmlpull = { module = "xmlpull:xmlpull", version = "1.1.3.1" }
diff --git a/room/benchmark/build.gradle b/room/benchmark/build.gradle
index 2aa19d3..b985390 100644
--- a/room/benchmark/build.gradle
+++ b/room/benchmark/build.gradle
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import static androidx.build.dependencies.DependenciesKt.*
plugins {
id("AndroidXPlugin")
@@ -31,11 +30,11 @@
androidTestImplementation(project(":room:room-rxjava2"))
androidTestImplementation("androidx.arch.core:core-runtime:2.0.1")
androidTestImplementation(projectOrArtifact(":benchmark:benchmark-junit4"))
- androidTestImplementation(RX_JAVA)
- androidTestImplementation(JUNIT)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(ANDROIDX_TEST_RULES)
- androidTestImplementation(KOTLIN_STDLIB)
+ androidTestImplementation(libs.rxjava2)
+ androidTestImplementation(libs.junit)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.testRules)
+ androidTestImplementation(libs.kotlinStdlib)
}
diff --git a/room/common/build.gradle b/room/common/build.gradle
index 0be0326..dee88d6 100644
--- a/room/common/build.gradle
+++ b/room/common/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 {
@@ -27,10 +24,10 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
- testImplementation(KOTLIN_STDLIB)
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
- testImplementation(GUAVA)
+ testImplementation(libs.kotlinStdlib)
+ testImplementation(libs.junit)
+ testImplementation(libs.mockitoCore)
+ testImplementation(libs.guava)
}
androidx {
diff --git a/room/compiler-processing-testing/build.gradle b/room/compiler-processing-testing/build.gradle
index f36bac4..a82aae8 100644
--- a/room/compiler-processing-testing/build.gradle
+++ b/room/compiler-processing-testing/build.gradle
@@ -16,7 +16,6 @@
import androidx.build.LibraryGroups
import androidx.build.LibraryType
-import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import static androidx.build.dependencies.DependenciesKt.*
@@ -29,17 +28,17 @@
dependencies {
implementation("androidx.annotation:annotation:1.1.0")
api(project(":room:room-compiler-processing"))
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
implementation(libs.kspApi)
- implementation(KOTLIN_STDLIB_JDK8) // KSP defines older version as dependency, force update.
+ implementation(libs.kotlinStdlibJdk8) // KSP defines older version as dependency, force update.
implementation(libs.ksp)
- implementation(GOOGLE_COMPILE_TESTING)
- implementation(KOTLIN_COMPILE_TESTING_KSP)
+ implementation(libs.googleCompileTesting)
+ implementation(libs.kotlinCompileTestingKsp)
// specify these to match the kotlin compiler version in AndroidX rather than what KSP or KCT
// uses
- implementation(KOTLIN_COMPILER_EMBEDDABLE)
- implementation(KOTLIN_COMPILER_DAEMON_EMBEDDABLE)
- implementation(KOTLIN_ANNOTATION_PROCESSING_EMBEDDABLE)
+ implementation(libs.kotlinCompilerEmbeddable)
+ implementation(libs.kotlinDaemonEmbeddable)
+ implementation(libs.kotlinAnnotationProcessingEmbeddable)
}
/**
diff --git a/room/compiler-processing/build.gradle b/room/compiler-processing/build.gradle
index 6d02085..97868a4 100644
--- a/room/compiler-processing/build.gradle
+++ b/room/compiler-processing/build.gradle
@@ -18,31 +18,29 @@
import androidx.build.LibraryType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("kotlin")
}
dependencies {
- api(KOTLIN_STDLIB)
- api(JAVAPOET)
- api(KOTLINPOET)
+ api(libs.kotlinStdlib)
+ api(libs.javapoet)
+ api(libs.kotlinPoet)
implementation("androidx.annotation:annotation:1.1.0")
- implementation(GUAVA)
- implementation(AUTO_COMMON)
- implementation(AUTO_VALUE_ANNOTATIONS)
+ implementation(libs.guava)
+ implementation(libs.autoCommon)
+ implementation(libs.autoValueAnnotations)
- implementation(KOTLIN_METADATA_JVM)
- implementation(INTELLIJ_ANNOTATIONS)
+ implementation(libs.kotlinMetadataJvm)
+ implementation(libs.intellijAnnotations)
implementation(libs.kspApi)
- implementation(KOTLIN_STDLIB_JDK8) // KSP defines older version as dependency, force update.
+ implementation(libs.kotlinStdlibJdk8) // KSP defines older version as dependency, force update.
- testImplementation(GOOGLE_COMPILE_TESTING)
- testImplementation(JUNIT)
- testImplementation(JSR250)
- testImplementation(KOTLIN_COMPILE_TESTING_KSP)
+ testImplementation(libs.googleCompileTesting)
+ testImplementation(libs.junit)
+ testImplementation(libs.jsr250)
+ testImplementation(libs.kotlinCompileTestingKsp)
testImplementation(libs.ksp)
testImplementation(project(":room:room-compiler-processing-testing"))
}
diff --git a/room/compiler/build.gradle b/room/compiler/build.gradle
index 84fc56d..364f385 100644
--- a/room/compiler/build.gradle
+++ b/room/compiler/build.gradle
@@ -96,24 +96,24 @@
implementation(project(":room:room-common"))
implementation(project(":room:room-migration"))
implementation(project(":room:room-compiler-processing"))
- implementation(KOTLIN_STDLIB)
- implementation(AUTO_COMMON)
- implementation(AUTO_VALUE_ANNOTATIONS)
- implementation(JAVAPOET)
+ implementation(libs.kotlinStdlib)
+ implementation(libs.autoCommon)
+ implementation(libs.autoValueAnnotations)
+ implementation(libs.javapoet)
implementation(libs.kspApi)
- shadowed(ANTLR)
- implementation(XERIAL)
- implementation(KOTLIN_METADATA_JVM)
- implementation(APACHE_COMMONS_CODEC)
- implementation(INTELLIJ_ANNOTATIONS)
- testImplementation(TRUTH)
- testImplementation(AUTO_VALUE) // to access the processor in tests
+ shadowed(libs.antlr4)
+ implementation(libs.sqliteJdbc)
+ implementation(libs.kotlinMetadataJvm)
+ implementation(libs.apacheCommonsCodec)
+ implementation(libs.intellijAnnotations)
+ testImplementation(libs.truth)
+ testImplementation(libs.autoValue) // to access the processor in tests
testImplementation(projectOrArtifact(":paging:paging-common"))
testImplementation(project(":room:room-compiler-processing-testing"))
- testImplementation(JUNIT)
- testImplementation(JSR250)
- testImplementation(MOCKITO_CORE)
- testImplementation(ANTLR)
+ testImplementation(libs.junit)
+ testImplementation(libs.jsr250)
+ testImplementation(libs.mockitoCore)
+ testImplementation(libs.antlr4)
testImplementation(fileTree(
dir: "${SdkHelperKt.getSdkPath(project)}/platforms/$SupportConfig.COMPILE_SDK_VERSION/",
include : "android.jar"
diff --git a/room/guava/build.gradle b/room/guava/build.gradle
index d34babf..3309a44 100644
--- a/room/guava/build.gradle
+++ b/room/guava/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 {
@@ -33,8 +30,8 @@
implementation("androidx.arch.core:core-runtime:2.0.1")
api("androidx.annotation:annotation:1.0.0")
implementation("androidx.concurrent:concurrent-futures:1.0.0")
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(TRUTH)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.truth)
}
androidx {
diff --git a/room/integration-tests/autovaluetestapp/build.gradle b/room/integration-tests/autovaluetestapp/build.gradle
index 01ee90f..252ca03 100644
--- a/room/integration-tests/autovaluetestapp/build.gradle
+++ b/room/integration-tests/autovaluetestapp/build.gradle
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-import static androidx.build.dependencies.DependenciesKt.*
-
buildscript {
// TODO: Remove this when this test app no longer depends on 1.0.0 of vectordrawable-animated.
// vectordrawable and vectordrawable-animated were accidentally using the same package name
@@ -36,19 +34,19 @@
// depend on the shadowed version so that it tests with the shipped artifact
androidTestAnnotationProcessor project(path: ":room:room-compiler",
configuration: "shadowAndImplementation")
- androidTestAnnotationProcessor(AUTO_VALUE)
- androidTestAnnotationProcessor(AUTO_VALUE_PARCEL)
+ androidTestAnnotationProcessor(libs.autoValue)
+ androidTestAnnotationProcessor(libs.autoValueParcel)
androidTestImplementation(projectOrArtifact(":arch:core:core-runtime")) // Added for b/155802460
androidTestImplementation(project(":room:room-testing"))
androidTestImplementation("androidx.arch.core:core-testing:2.0.1")
- androidTestImplementation(AUTO_VALUE_ANNOTATIONS)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(ESPRESSO_CORE)
- androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it's own MockMaker
- androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it's own MockMaker
+ androidTestImplementation(libs.autoValueAnnotations)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.espressoCore)
+ androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it's own MockMaker
+ androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it's own MockMaker
- testImplementation(JUNIT)
+ testImplementation(libs.junit)
}
diff --git a/room/integration-tests/incremental-annotation-processing/build.gradle b/room/integration-tests/incremental-annotation-processing/build.gradle
index 8aeae46..5a725b5 100644
--- a/room/integration-tests/incremental-annotation-processing/build.gradle
+++ b/room/integration-tests/incremental-annotation-processing/build.gradle
@@ -16,19 +16,17 @@
import androidx.build.SdkResourceGenerator
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("kotlin")
}
dependencies {
- implementation(KOTLIN_STDLIB)
+ implementation(libs.kotlinStdlib)
testImplementation(project(":internal-testutils-gradle-plugin"))
- testImplementation(JUNIT)
- testImplementation(TRUTH)
+ testImplementation(libs.junit)
+ testImplementation(libs.truth)
testImplementation(gradleTestKit())
}
diff --git a/room/integration-tests/kotlintestapp/build.gradle b/room/integration-tests/kotlintestapp/build.gradle
index ecaa20a..462ad43 100644
--- a/room/integration-tests/kotlintestapp/build.gradle
+++ b/room/integration-tests/kotlintestapp/build.gradle
@@ -20,8 +20,6 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.application")
@@ -93,9 +91,9 @@
implementation(projectOrArtifact(":arch:core:core-runtime"))
implementation(projectOrArtifact(":lifecycle:lifecycle-livedata"))
implementation(projectOrArtifact(":lifecycle:lifecycle-livedata-ktx"))
- implementation(KOTLIN_STDLIB)
- implementation(KOTLIN_COROUTINES_ANDROID)
- implementation(MULTIDEX)
+ implementation(libs.kotlinStdlib)
+ implementation(libs.kotlinCoroutinesAndroid)
+ implementation(libs.multidex)
// depend on the shadowed version so that it tests with the shipped artifact
// this is a temporary attribute until KSP and AndroidX plugin supports variants.
if (useKsp) {
@@ -109,17 +107,17 @@
}
androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-livedata-ktx"))
androidTestImplementation(projectOrArtifact(":arch:core:core-runtime")) // Added for b/155802460
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER) {
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner) {
exclude module: "support-annotations"
exclude module: "hamcrest-core"
}
- androidTestImplementation(ESPRESSO_CORE, {
+ androidTestImplementation(libs.espressoCore, {
exclude group: "com.android.support", module: "support-annotations"
exclude module: "hamcrest-core"
})
- androidTestImplementation(TRUTH)
+ androidTestImplementation(libs.truth)
androidTestImplementation(project(":room:room-guava"))
androidTestImplementation(project(":room:room-testing"))
androidTestImplementation(project(":room:room-rxjava2"))
@@ -127,9 +125,9 @@
androidTestImplementation(project(":room:room-ktx"))
androidTestImplementation("androidx.arch.core:core-testing:2.0.1")
androidTestImplementation(projectOrArtifact(":paging:paging-runtime"))
- androidTestImplementation(GUAVA_ANDROID)
- androidTestImplementation(RX_JAVA)
- testImplementation(MOCKITO_CORE)
+ androidTestImplementation(libs.guavaAndroid)
+ androidTestImplementation(libs.rxjava2)
+ testImplementation(libs.mockitoCore)
}
if (useKsp) {
diff --git a/room/integration-tests/noappcompattestapp/build.gradle b/room/integration-tests/noappcompattestapp/build.gradle
index a594cb2..80b7a1e 100644
--- a/room/integration-tests/noappcompattestapp/build.gradle
+++ b/room/integration-tests/noappcompattestapp/build.gradle
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-import static androidx.build.dependencies.DependenciesKt.*
-
plugins {
id("AndroidXPlugin")
id("com.android.application")
@@ -28,9 +26,9 @@
configuration: "shadowAndImplementation")
androidTestAnnotationProcessor project(path: ":room:room-compiler",
configuration: "shadowAndImplementation")
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(ESPRESSO_CORE)
- testImplementation(JUNIT)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.espressoCore)
+ testImplementation(libs.junit)
}
diff --git a/room/integration-tests/testapp/build.gradle b/room/integration-tests/testapp/build.gradle
index f89faf2..34e790d 100644
--- a/room/integration-tests/testapp/build.gradle
+++ b/room/integration-tests/testapp/build.gradle
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-import static androidx.build.dependencies.DependenciesKt.*
-
buildscript {
// TODO: Remove this when this test app no longer depends on 1.0.0 of vectordrawable-animated.
// vectordrawable and vectordrawable-animated were accidentally using the same package name
@@ -80,10 +78,10 @@
implementation(projectOrArtifact(":arch:core:core-runtime"))
implementation(projectOrArtifact(":lifecycle:lifecycle-livedata"))
implementation(projectOrArtifact(":lifecycle:lifecycle-runtime"))
- implementation(MULTIDEX)
+ implementation(libs.multidex)
- // FINDBUGS dependency resolves an app/testapp version conflict.
- implementation(FINDBUGS)
+ // libs.findbugs dependency resolves an app/testapp version conflict.
+ implementation(libs.findbugs)
implementation("androidx.recyclerview:recyclerview:1.0.0")
implementation("androidx.appcompat:appcompat:1.0.0")
// use the shadowed dependency in tests so that if the shadowing does not work properly,
@@ -103,21 +101,21 @@
androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-runtime-testing"))
androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-livedata"))
- // FINDBUGS dependency resolves an app/testapp version conflict.
- androidTestImplementation(FINDBUGS)
- androidTestImplementation(GUAVA_ANDROID)
- androidTestImplementation(RX_JAVA)
- androidTestImplementation(RX_JAVA3)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(ANDROIDX_TEST_RULES)
- androidTestImplementation(ESPRESSO_CORE)
- androidTestImplementation(TRUTH)
- androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it's own MockMaker
- androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it's own MockMaker
+ // libs.findbugs dependency resolves an app/testapp version conflict.
+ androidTestImplementation(libs.findbugs)
+ androidTestImplementation(libs.guavaAndroid)
+ androidTestImplementation(libs.rxjava2)
+ androidTestImplementation(libs.rxjava3)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.testRules)
+ androidTestImplementation(libs.espressoCore)
+ androidTestImplementation(libs.truth)
+ androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it's own MockMaker
+ androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it's own MockMaker
androidTestImplementation(project(":internal-testutils-truth"))
- testImplementation(JUNIT)
+ testImplementation(libs.junit)
}
diff --git a/room/ktx/build.gradle b/room/ktx/build.gradle
index 92e897e..36718fc 100644
--- a/room/ktx/build.gradle
+++ b/room/ktx/build.gradle
@@ -14,14 +14,9 @@
* limitations under the License.
*/
-
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-
-import static androidx.build.dependencies.DependenciesKt.*
import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-import androidx.build.AndroidXExtension
import androidx.build.Publish
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
@@ -32,18 +27,18 @@
dependencies {
api(project(":room:room-common"))
api(project(":room:room-runtime"))
- api(KOTLIN_STDLIB)
- api(KOTLIN_COROUTINES_ANDROID)
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
- testImplementation(TRUTH)
+ api(libs.kotlinStdlib)
+ api(libs.kotlinCoroutinesAndroid)
+ testImplementation(libs.junit)
+ testImplementation(libs.mockitoCore)
+ testImplementation(libs.truth)
testImplementation("androidx.lifecycle:lifecycle-livedata-core:2.0.0")
- testImplementation(ANDROIDX_TEST_RUNNER)
- testImplementation(KOTLIN_COROUTINES_TEST)
+ testImplementation(libs.testRunner)
+ testImplementation(libs.kotlinCoroutinesTest)
- androidTestImplementation(TRUTH)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(KOTLIN_COROUTINES_TEST)
+ androidTestImplementation(libs.truth)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.kotlinCoroutinesTest)
}
androidx {
diff --git a/room/migration/build.gradle b/room/migration/build.gradle
index d3e717f..c19662e 100644
--- a/room/migration/build.gradle
+++ b/room/migration/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 {
@@ -27,11 +24,11 @@
dependencies {
implementation(project(":room:room-common"))
- implementation(KOTLIN_STDLIB)
- implementation(GSON)
- testImplementation(JUNIT)
- testImplementation(INTELLIJ_ANNOTATIONS)
- testImplementation(MOCKITO_CORE)
+ implementation(libs.kotlinStdlib)
+ implementation(libs.gson)
+ testImplementation(libs.junit)
+ testImplementation(libs.intellijAnnotations)
+ testImplementation(libs.mockitoCore)
}
androidx {
diff --git a/room/runtime/build.gradle b/room/runtime/build.gradle
index 1740d3c..2b63351 100644
--- a/room/runtime/build.gradle
+++ b/room/runtime/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 {
@@ -43,24 +40,24 @@
compileOnly("androidx.paging:paging-common:2.0.0")
compileOnly("androidx.lifecycle:lifecycle-livedata-core:2.0.0")
implementation("androidx.annotation:annotation-experimental:1.1.0-rc01")
- compileOnly KOTLIN_STDLIB // Due to :annotation-experimental
+ compileOnly libs.kotlinStdlib // Due to :annotation-experimental
testImplementation("androidx.arch.core:core-testing:2.0.1")
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
+ testImplementation(libs.junit)
+ testImplementation(libs.mockitoCore)
testImplementation("androidx.lifecycle:lifecycle-livedata-core:2.0.0")
- testImplementation(KOTLIN_STDLIB)
- testImplementation(TRUTH)
- testImplementation(ANDROIDX_TEST_RUNNER) // Needed for @FlakyTest and @Ignore
+ testImplementation(libs.kotlinStdlib)
+ testImplementation(libs.truth)
+ testImplementation(libs.testRunner) // Needed for @FlakyTest and @Ignore
- androidTestImplementation(JUNIT)
- androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
- androidTestImplementation(ANDROIDX_TEST_CORE)
- androidTestImplementation(ANDROIDX_TEST_RUNNER)
- androidTestImplementation(ESPRESSO_CORE)
- androidTestImplementation(KOTLIN_STDLIB)
- androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it"s own MockMaker
- androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it"s own MockMaker
+ androidTestImplementation(libs.junit)
+ androidTestImplementation(libs.testExtJunit)
+ androidTestImplementation(libs.testCore)
+ androidTestImplementation(libs.testRunner)
+ androidTestImplementation(libs.espressoCore)
+ androidTestImplementation(libs.kotlinStdlib)
+ androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it"s own MockMaker
+ androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(project(":internal-testutils-truth")) // for assertThrows
androidTestImplementation("androidx.arch.core:core-testing:2.0.1")
diff --git a/room/rxjava2/build.gradle b/room/rxjava2/build.gradle
index 2a9be6c..1594929 100644
--- a/room/rxjava2/build.gradle
+++ b/room/rxjava2/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 {
@@ -29,10 +26,10 @@
api(project(":room:room-common"))
api(project(":room:room-runtime"))
implementation("androidx.arch.core:core-runtime:2.0.1")
- api(RX_JAVA)
+ api(libs.rxjava2)
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
+ testImplementation(libs.junit)
+ testImplementation(libs.mockitoCore)
testImplementation("androidx.arch.core:core-testing:2.0.1")
testImplementation("androidx.lifecycle:lifecycle-livedata:2.0.0") // for mocking invalidation tracker
}
diff --git a/room/rxjava3/build.gradle b/room/rxjava3/build.gradle
index bdb53b3..943fcb9 100644
--- a/room/rxjava3/build.gradle
+++ b/room/rxjava3/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 {
@@ -29,10 +26,10 @@
api(project(":room:room-common"))
api(project(":room:room-runtime"))
implementation("androidx.arch.core:core-runtime:2.0.1")
- api(RX_JAVA3)
+ api(libs.rxjava3)
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
+ testImplementation(libs.junit)
+ testImplementation(libs.mockitoCore)
testImplementation("androidx.arch.core:core-testing:2.0.1")
testImplementation("androidx.lifecycle:lifecycle-livedata:2.0.0") // for mocking invalidation tracker
}
diff --git a/room/testing/build.gradle b/room/testing/build.gradle
index 71765ac..89bbeeb7 100644
--- a/room/testing/build.gradle
+++ b/room/testing/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 {
@@ -32,7 +29,7 @@
api("androidx.sqlite:sqlite-framework:2.0.1")
api(project(":room:room-migration"))
implementation("androidx.arch.core:core-runtime:2.0.1")
- api(JUNIT)
+ api(libs.junit)
}
androidx {