From bc1dbeb444e2b93780f4a1dd64a9446ed9234e19 Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Tue, 4 May 2021 13:36:59 -0700 Subject: [PATCH] Migrate FLAN to use Gradle Version Catalogs - Ran development/versionCatalogMigrate.sh - Manually updated imports in build.gradle files Test: ./gradlew tasks Change-Id: Id8ae42ce08ee1cb847837a320eb514aedea60886 --- activity/activity-compose/build.gradle | 14 +++---- .../activity-demos/build.gradle | 6 +-- .../activity-compose/samples/build.gradle | 7 +--- activity/activity-ktx/build.gradle | 16 ++++---- activity/activity-lint/build.gradle | 16 ++++---- activity/activity/build.gradle | 18 ++++----- .../integration-tests/testapp/build.gradle | 18 ++++----- development/versionCatalogMigrate.sh | 4 +- fragment/fragment-ktx/build.gradle | 16 ++++---- fragment/fragment-lint/build.gradle | 14 +++---- fragment/fragment-testing-lint/build.gradle | 16 ++++---- fragment/fragment-testing/build.gradle | 24 ++++++------ fragment/fragment-truth/build.gradle | 18 ++++----- fragment/fragment/build.gradle | 34 ++++++++-------- .../integration-tests/testapp/build.gradle | 4 +- gradle/libs.versions.toml | 3 ++ .../incrementality/build.gradle | 8 ++-- .../kotlintestapp/build.gradle | 22 +++++------ .../integration-tests/testapp/build.gradle | 18 ++++----- lifecycle/lifecycle-common-java8/build.gradle | 6 +-- lifecycle/lifecycle-common/build.gradle | 7 +--- lifecycle/lifecycle-compiler/build.gradle | 13 +++---- lifecycle/lifecycle-extensions/build.gradle | 20 +++++----- .../build.gradle | 14 +++---- .../lifecycle-livedata-core-ktx/build.gradle | 13 +++---- .../build.gradle | 9 ++--- .../lifecycle-livedata-core/build.gradle | 8 ++-- lifecycle/lifecycle-livedata-ktx/build.gradle | 27 ++++++------- lifecycle/lifecycle-livedata/build.gradle | 8 ++-- lifecycle/lifecycle-process/build.gradle | 6 +-- .../build.gradle | 16 +++----- .../lifecycle-reactivestreams/build.gradle | 12 +++--- .../lifecycle-runtime-ktx-lint/build.gradle | 14 +++---- lifecycle/lifecycle-runtime-ktx/build.gradle | 21 +++++----- .../lifecycle-runtime-testing/build.gradle | 23 +++++------ lifecycle/lifecycle-runtime/build.gradle | 14 +++---- lifecycle/lifecycle-service/build.gradle | 8 ++-- .../lifecycle-viewmodel-compose/build.gradle | 13 +++---- .../lifecycle-viewmodel-demos/build.gradle | 6 +-- .../samples/build.gradle | 6 +-- .../lifecycle-viewmodel-ktx/build.gradle | 17 ++++---- .../build.gradle | 14 +++---- lifecycle/lifecycle-viewmodel/build.gradle | 18 ++++----- navigation/benchmark/build.gradle | 15 ++++--- .../safeargs-testapp/build.gradle | 5 +-- .../integration-tests/testapp/build.gradle | 4 +- navigation/navigation-common-ktx/build.gradle | 1 - navigation/navigation-common/build.gradle | 29 +++++++------- navigation/navigation-compose/build.gradle | 11 ++---- .../navigation-demos/build.gradle | 5 +-- .../navigation-compose/samples/build.gradle | 6 +-- .../build.gradle | 37 ++++++++---------- .../build.gradle | 39 +++++++++---------- .../navigation-fragment-ktx/build.gradle | 3 -- navigation/navigation-fragment/build.gradle | 15 +++---- .../navigation-runtime-ktx/build.gradle | 3 -- .../navigation-runtime-truth/build.gradle | 19 ++++----- navigation/navigation-runtime/build.gradle | 28 ++++++------- .../build.gradle | 16 ++++---- .../build.gradle | 8 ++-- navigation/navigation-testing/build.gradle | 16 +++----- navigation/navigation-ui-ktx/build.gradle | 3 -- navigation/navigation-ui/build.gradle | 15 +++---- 63 files changed, 359 insertions(+), 508 deletions(-) diff --git a/activity/activity-compose/build.gradle b/activity/activity-compose/build.gradle index 20451baa8cf18..5b3d1b895e95d 100644 --- a/activity/activity-compose/build.gradle +++ b/activity/activity-compose/build.gradle @@ -15,12 +15,8 @@ */ import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish import androidx.build.RunApiTasks -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -import static androidx.build.dependencies.DependenciesKt.* plugins { id("AndroidXPlugin") @@ -32,7 +28,7 @@ plugins { dependencies { kotlinPlugin projectOrArtifact(":compose:compiler:compiler") - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) api projectOrArtifact(":compose:runtime:runtime") api projectOrArtifact(":compose:runtime:runtime-saveable") api(projectOrArtifact(":activity:activity-ktx")) @@ -42,10 +38,10 @@ dependencies { androidTestImplementation projectOrArtifact(":compose:material:material") androidTestImplementation projectOrArtifact(":compose:test-utils") androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1") - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_EXT_KTX) - androidTestImplementation(JUNIT) - androidTestImplementation(TRUTH) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testExtJunitKtx) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.truth) } androidx { diff --git a/activity/activity-compose/integration-tests/activity-demos/build.gradle b/activity/activity-compose/integration-tests/activity-demos/build.gradle index 82d727e9cf2ec..2928e80b619ac 100644 --- a/activity/activity-compose/integration-tests/activity-demos/build.gradle +++ b/activity/activity-compose/integration-tests/activity-demos/build.gradle @@ -14,11 +14,7 @@ * limitations under the License. */ - import androidx.build.Publish -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -import static androidx.build.dependencies.DependenciesKt.getKOTLIN_STDLIB plugins { id("AndroidXPlugin") @@ -29,7 +25,7 @@ plugins { dependencies { kotlinPlugin projectOrArtifact(":compose:compiler:compiler") - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation projectOrArtifact(":activity:activity-compose") implementation projectOrArtifact(":activity:activity-compose:activity-compose-samples") } diff --git a/activity/activity-compose/samples/build.gradle b/activity/activity-compose/samples/build.gradle index 9c9f8ee70b54a..a02eac61ca6c0 100644 --- a/activity/activity-compose/samples/build.gradle +++ b/activity/activity-compose/samples/build.gradle @@ -14,13 +14,8 @@ * limitations under the License. */ - import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.LibraryType -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -import static androidx.build.dependencies.DependenciesKt.* plugins { id("AndroidXPlugin") @@ -31,7 +26,7 @@ plugins { 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/activity/activity-ktx/build.gradle b/activity/activity-ktx/build.gradle index 33394d1f3caa6..a42290904cf07 100644 --- a/activity/activity-ktx/build.gradle +++ b/activity/activity-ktx/build.gradle @@ -14,9 +14,7 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish plugins { @@ -37,15 +35,15 @@ dependencies { api("androidx.savedstate:savedstate-ktx:1.1.0") { because 'Mirror activity dependency graph for -ktx artifacts' } - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1") - androidTestImplementation(JUNIT) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) androidTestImplementation(project(":internal-testutils-runtime"), { exclude group: "androidx.activity", module: "activity" }) diff --git a/activity/activity-lint/build.gradle b/activity/activity-lint/build.gradle index 7e37c769b6ce2..5e007274e39f4 100644 --- a/activity/activity-lint/build.gradle +++ b/activity/activity-lint/build.gradle @@ -17,22 +17,20 @@ import androidx.build.LibraryGroups import androidx.build.LibraryType -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("kotlin") } dependencies { - compileOnly(LINT_API_MIN) - compileOnly(KOTLIN_STDLIB) + compileOnly(libs.androidLintMinApi) + compileOnly(libs.kotlinStdlib) - testImplementation(KOTLIN_STDLIB) - testImplementation(LINT_CORE) - testImplementation(LINT_TESTS) - testImplementation(JUNIT) - testImplementation(TRUTH) + testImplementation(libs.kotlinStdlib) + testImplementation(libs.androidLint) + testImplementation(libs.androidLintTests) + testImplementation(libs.junit) + testImplementation(libs.truth) } androidx { diff --git a/activity/activity/build.gradle b/activity/activity/build.gradle index fd9d2599875ef..a9d5187c56073 100644 --- a/activity/activity/build.gradle +++ b/activity/activity/build.gradle @@ -1,8 +1,6 @@ import androidx.build.LibraryGroups import androidx.build.Publish -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.library") @@ -26,14 +24,14 @@ dependencies { implementation("androidx.tracing:tracing:1.0.0") androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1") - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(LEAKCANARY) - androidTestImplementation(LEAKCANARY_INSTRUMENTATION) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(TRUTH) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.leakcanary) + androidTestImplementation(libs.leakcanaryInstrumentation) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.truth) androidTestImplementation(project(":internal-testutils-runtime"), { exclude group: "androidx.activity", module: "activity" }) diff --git a/activity/integration-tests/testapp/build.gradle b/activity/integration-tests/testapp/build.gradle index 11e5101e9f913..780dd7f16aa98 100644 --- a/activity/integration-tests/testapp/build.gradle +++ b/activity/integration-tests/testapp/build.gradle @@ -14,8 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.application") @@ -33,12 +31,12 @@ android { dependencies { implementation(project(":activity:activity-ktx")) implementation(projectOrArtifact(":lifecycle:lifecycle-runtime-ktx")) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - 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.kotlinStdlib) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + 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 } diff --git a/development/versionCatalogMigrate.sh b/development/versionCatalogMigrate.sh index 101013063b140..da5fa97a53b9d 100755 --- a/development/versionCatalogMigrate.sh +++ b/development/versionCatalogMigrate.sh @@ -3,6 +3,7 @@ find -iname build.gradle | xargs sed -i "s/AGP_LATEST/libs.androidGradlePlugin/" find -iname build.gradle | xargs sed -i "s/LINT_CORE/libs.androidLint/" find -iname build.gradle | xargs sed -i "s/LINT_API_LATEST/libs.androidLintApi/" +find -iname build.gradle | xargs sed -i "s/LINT_API_MIN/libs.androidLintMinApi/" find -iname build.gradle | xargs sed -i "s/LINT_TESTS/libs.androidLintTests/" find -iname build.gradle | xargs sed -i "s/AUTO_COMMON/libs.autoCommon/" find -iname build.gradle | xargs sed -i "s/AUTO_SERVICE_ANNOTATIONS/libs.autoServiceAnnotations/" @@ -64,9 +65,6 @@ find -iname build.gradle | xargs sed -i "s/KOTLIN_TEST_JUNIT/libs.kotlinTestJuni find -iname build.gradle | xargs sed -i "s/KOTLIN_TEST_JS/libs.kotlinTestJs/" find -iname build.gradle | xargs sed -i "s/KOTLIN_TEST/libs.kotlinTest/" find -iname build.gradle | xargs sed -i "s/KOTLIN_REFLECT/libs.kotlinReflect/" -find -iname build.gradle | xargs sed -i "s/KOTLINPOET_METADATA/libs.kotlinPoetMetadata/" -find -iname build.gradle | xargs sed -i "s/KOTLINPOET_METADATA_SPECS/libs.kotlinPoetMetadataSpecs/" -find -iname build.gradle | xargs sed -i "s/KOTLINPOET_CLASSINSPECTOR_ELEMENTS/libs.kotlinPoetClassinspector/" find -iname build.gradle | xargs sed -i "s/KOTLINPOET/libs.kotlinPoet/" find -iname build.gradle | xargs sed -i "s/LEAKCANARY_INSTRUMENTATION/libs.leakcanaryInstrumentation/" find -iname build.gradle | xargs sed -i "s/LEAKCANARY/libs.leakcanary/" diff --git a/fragment/fragment-ktx/build.gradle b/fragment/fragment-ktx/build.gradle index 2558b4542f277..2f244817f2564 100644 --- a/fragment/fragment-ktx/build.gradle +++ b/fragment/fragment-ktx/build.gradle @@ -14,9 +14,7 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish plugins { @@ -43,13 +41,13 @@ dependencies { api("androidx.savedstate:savedstate-ktx:1.1.0") { because 'Mirror fragment dependency graph for -ktx artifacts' } - api(KOTLIN_STDLIB) - androidTestImplementation(JUNIT) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) + api(libs.kotlinStdlib) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) androidTestImplementation(project(":internal-testutils-runtime"), { exclude group: "androidx.fragment", module: "fragment" }) diff --git a/fragment/fragment-lint/build.gradle b/fragment/fragment-lint/build.gradle index da2c726f24f0f..c6607409c042e 100644 --- a/fragment/fragment-lint/build.gradle +++ b/fragment/fragment-lint/build.gradle @@ -25,14 +25,14 @@ plugins { } dependencies { - compileOnly(LINT_API_MIN) - compileOnly(KOTLIN_STDLIB) + compileOnly(libs.androidLintMinApi) + compileOnly(libs.kotlinStdlib) - testImplementation(KOTLIN_STDLIB) - testImplementation(LINT_CORE) - testImplementation(LINT_TESTS) - testImplementation(JUNIT) - testImplementation(TRUTH) + testImplementation(libs.kotlinStdlib) + testImplementation(libs.androidLint) + testImplementation(libs.androidLintTests) + testImplementation(libs.junit) + testImplementation(libs.truth) } androidx { diff --git a/fragment/fragment-testing-lint/build.gradle b/fragment/fragment-testing-lint/build.gradle index 92427884c96e5..e4170a67fdd8c 100644 --- a/fragment/fragment-testing-lint/build.gradle +++ b/fragment/fragment-testing-lint/build.gradle @@ -17,22 +17,20 @@ import androidx.build.LibraryGroups import androidx.build.LibraryType -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("kotlin") } dependencies { - compileOnly(LINT_API_MIN) - compileOnly(KOTLIN_STDLIB) + compileOnly(libs.androidLintMinApi) + compileOnly(libs.kotlinStdlib) - testImplementation(KOTLIN_STDLIB) - testImplementation(LINT_CORE) - testImplementation(LINT_TESTS) - testImplementation(JUNIT) - testImplementation(TRUTH) + testImplementation(libs.kotlinStdlib) + testImplementation(libs.androidLint) + testImplementation(libs.androidLintTests) + testImplementation(libs.junit) + testImplementation(libs.truth) } androidx { diff --git a/fragment/fragment-testing/build.gradle b/fragment/fragment-testing/build.gradle index 6c9828d99e853..6d3ac1619ca34 100644 --- a/fragment/fragment-testing/build.gradle +++ b/fragment/fragment-testing/build.gradle @@ -14,9 +14,7 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish plugins { @@ -27,17 +25,17 @@ plugins { dependencies { api(project(":fragment:fragment-ktx")) - api(ANDROIDX_TEST_CORE) - api(KOTLIN_STDLIB) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(ESPRESSO_CORE) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(TRUTH) - androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it"s own MockMaker - androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it"s own MockMaker + api(libs.testCore) + api(libs.kotlinStdlib) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.espressoCore) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + 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 lintPublish(project(":fragment:fragment-testing-lint")) } diff --git a/fragment/fragment-truth/build.gradle b/fragment/fragment-truth/build.gradle index 68c38caa666d5..19a5892bc92b6 100644 --- a/fragment/fragment-truth/build.gradle +++ b/fragment/fragment-truth/build.gradle @@ -14,9 +14,7 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish plugins { @@ -27,14 +25,14 @@ plugins { dependencies { api(project(":fragment:fragment-ktx")) - api(TRUTH) - api(KOTLIN_STDLIB) - androidTestImplementation(JUNIT) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ANDROIDX_TEST_RUNNER) + api(libs.truth) + api(libs.kotlinStdlib) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.testRunner) androidTestImplementation(project(":internal-testutils-truth")) } diff --git a/fragment/fragment/build.gradle b/fragment/fragment/build.gradle index def5fb94bef8a..d672ed1e6adf0 100644 --- a/fragment/fragment/build.gradle +++ b/fragment/fragment/build.gradle @@ -1,6 +1,4 @@ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish plugins { @@ -41,27 +39,27 @@ dependencies { exclude group: "androidx.fragment", module: "fragment" exclude group: "androidx.activity", module: "activity" }) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(TRUTH) - androidTestImplementation(ESPRESSO_CORE, excludes.espresso) - androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it"s own MockMaker - androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it"s own MockMaker - androidTestImplementation(MULTIDEX) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.espressoCore, excludes.espresso) + androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it"s own MockMaker + androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it"s own MockMaker + androidTestImplementation(libs.multidex) androidTestImplementation(project(":internal-testutils-runtime"), { exclude group: "androidx.fragment", module: "fragment" }) testImplementation(project(":fragment:fragment")) - testImplementation(KOTLIN_STDLIB) - testImplementation(ANDROIDX_TEST_EXT_JUNIT) - testImplementation(ANDROIDX_TEST_CORE) - testImplementation(ANDROIDX_TEST_RULES) - testImplementation(TRUTH) - testImplementation(ROBOLECTRIC) + testImplementation(libs.kotlinStdlib) + testImplementation(libs.testExtJunit) + testImplementation(libs.testCore) + testImplementation(libs.testRules) + testImplementation(libs.truth) + testImplementation(libs.robolectric) lintPublish(project(":fragment:fragment-lint")) } diff --git a/fragment/integration-tests/testapp/build.gradle b/fragment/integration-tests/testapp/build.gradle index 9220e1fc13343..76b4948bd8e0d 100644 --- a/fragment/integration-tests/testapp/build.gradle +++ b/fragment/integration-tests/testapp/build.gradle @@ -14,8 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.application") @@ -34,7 +32,7 @@ android { } dependencies { - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation(project(":fragment:fragment-ktx")) implementation("androidx.transition:transition:1.3.0") implementation("androidx.recyclerview:recyclerview:1.1.0") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3d229938dd7f8..a9a326ac1cd25 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,7 @@ androidLint = "30.0.0-alpha15" androidStudio = "2020.3.1.15" # ----------------------------------------------------------------------------- +androidLintMin = "26.3.0" androidxTest = "1.3.0" androidxTestExt = "1.1.2" autoService = "1.0-rc6" @@ -31,7 +32,9 @@ wire = "3.6.0" [libraries] androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" } androidLint = { module = "com.android.tools.lint:lint", version.ref = "androidLint" } +androidLintMin = { module = "com.android.tools.lint:lint", version.ref = "androidLintMin" } androidLintApi = { module = "com.android.tools.lint:lint-api", version.ref = "androidLint" } +androidLintMinApi = { module = "com.android.tools.lint:lint-api", version.ref = "androidLintMin" } androidLintTests = { module = "com.android.tools.lint:lint-tests", version.ref = "androidLint" } autoCommon = { module = "com.google.auto:auto-common", version = "0.11" } autoServiceAnnotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoService" } diff --git a/lifecycle/integration-tests/incrementality/build.gradle b/lifecycle/integration-tests/incrementality/build.gradle index e802401895263..c877c03c6b22b 100644 --- a/lifecycle/integration-tests/incrementality/build.gradle +++ b/lifecycle/integration-tests/incrementality/build.gradle @@ -16,17 +16,15 @@ import androidx.build.SdkResourceGenerator -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("kotlin") id("AndroidXPlugin") } dependencies { - implementation(KOTLIN_STDLIB) - testImplementation(JUNIT) - testImplementation(TRUTH) + implementation(libs.kotlinStdlib) + testImplementation(libs.junit) + testImplementation(libs.truth) testImplementation(gradleTestKit()) } diff --git a/lifecycle/integration-tests/kotlintestapp/build.gradle b/lifecycle/integration-tests/kotlintestapp/build.gradle index 70331777880d3..bfe9cf1e33aad 100644 --- a/lifecycle/integration-tests/kotlintestapp/build.gradle +++ b/lifecycle/integration-tests/kotlintestapp/build.gradle @@ -18,8 +18,6 @@ // -Dorg.gradle.debug=true // -Dkotlin.compiler.execution.strategy="in-process" -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.application") @@ -35,19 +33,19 @@ dependencies { because "Used by :activity:activity" } - testImplementation(JUNIT) - testImplementation(TRUTH) - testImplementation(KOTLIN_COROUTINES_ANDROID) - testImplementation(KOTLIN_COROUTINES_TEST) + testImplementation(libs.junit) + testImplementation(libs.truth) + testImplementation(libs.kotlinCoroutinesAndroid) + testImplementation(libs.kotlinCoroutinesTest) testImplementation(project(":lifecycle:lifecycle-runtime-testing")) androidTestImplementation(project(":lifecycle:lifecycle-runtime-testing")) - androidTestImplementation(KOTLIN_COROUTINES_TEST) - androidTestImplementation(KOTLIN_COROUTINES_ANDROID) - androidTestImplementation(ANDROIDX_TEST_EXT_KTX) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ESPRESSO_CORE) + androidTestImplementation(libs.kotlinCoroutinesTest) + androidTestImplementation(libs.kotlinCoroutinesAndroid) + androidTestImplementation(libs.testExtJunitKtx) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.espressoCore) } android { diff --git a/lifecycle/integration-tests/testapp/build.gradle b/lifecycle/integration-tests/testapp/build.gradle index 378c58e62029a..e2edd360220ad 100644 --- a/lifecycle/integration-tests/testapp/build.gradle +++ b/lifecycle/integration-tests/testapp/build.gradle @@ -14,8 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.application") @@ -23,7 +21,7 @@ plugins { } dependencies { - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation("androidx.fragment:fragment:1.3.0") { exclude group: "androidx.lifecycle", module: "lifecycle-runtime" } @@ -34,13 +32,13 @@ dependencies { androidTestAnnotationProcessor(project(":lifecycle:lifecycle-compiler")) androidTestImplementation(project(":lifecycle:lifecycle-common")) // Added for b/155802460 - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ESPRESSO_CORE) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.espressoCore) - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) testAnnotationProcessor(project(":lifecycle:lifecycle-compiler")) } diff --git a/lifecycle/lifecycle-common-java8/build.gradle b/lifecycle/lifecycle-common-java8/build.gradle index dd3021fd4c0c9..db21aff6fb393 100644 --- a/lifecycle/lifecycle-common-java8/build.gradle +++ b/lifecycle/lifecycle-common-java8/build.gradle @@ -14,10 +14,8 @@ * 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,8 +27,8 @@ dependencies { api(project(":lifecycle:lifecycle-common")) api("androidx.annotation:annotation:1.1.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) } androidx { diff --git a/lifecycle/lifecycle-common/build.gradle b/lifecycle/lifecycle-common/build.gradle index 1beb36ebdb7f2..6392520fb1588 100644 --- a/lifecycle/lifecycle-common/build.gradle +++ b/lifecycle/lifecycle-common/build.gradle @@ -16,9 +16,6 @@ import androidx.build.LibraryGroups import androidx.build.LibraryVersions -import androidx.build.AndroidXExtension - -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.Publish plugins { @@ -29,8 +26,8 @@ plugins { dependencies { api("androidx.annotation:annotation:1.1.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) } androidx { diff --git a/lifecycle/lifecycle-compiler/build.gradle b/lifecycle/lifecycle-compiler/build.gradle index f64dfa1b6cebc..d272608095f9d 100644 --- a/lifecycle/lifecycle-compiler/build.gradle +++ b/lifecycle/lifecycle-compiler/build.gradle @@ -17,8 +17,7 @@ import androidx.build.LibraryGroups import androidx.build.LibraryType import androidx.build.LibraryVersions - -import static androidx.build.dependencies.DependenciesKt.* +import static androidx.build.dependencies.DependenciesKt.GUAVA plugins { id("AndroidXPlugin") @@ -27,11 +26,11 @@ plugins { dependencies { implementation(project(":lifecycle:lifecycle-common")) - implementation(KOTLIN_STDLIB) - implementation(AUTO_COMMON) - implementation(JAVAPOET) - testImplementation(GOOGLE_COMPILE_TESTING) - testImplementation(JSR250) + implementation(libs.kotlinStdlib) + implementation(libs.autoCommon) + implementation(libs.javapoet) + testImplementation(libs.googleCompileTesting) + testImplementation(libs.jsr250) } // The following tasks are used to regenerate src/test/test-data/lib/src/test-library.jar diff --git a/lifecycle/lifecycle-extensions/build.gradle b/lifecycle/lifecycle-extensions/build.gradle index 12f7761c6e943..fd2e93752a64f 100644 --- a/lifecycle/lifecycle-extensions/build.gradle +++ b/lifecycle/lifecycle-extensions/build.gradle @@ -14,8 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* - import androidx.build.LibraryGroups import androidx.build.LibraryVersions import androidx.build.Publish @@ -39,16 +37,16 @@ dependencies { api("androidx.lifecycle:lifecycle-viewmodel:2.2.0") testImplementation("androidx.arch.core:core-testing:2.1.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ESPRESSO_CORE) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.espressoCore) androidTestImplementation("androidx.appcompat:appcompat:1.0.0") androidTestImplementation(project(":internal-testutils-runtime")) } diff --git a/lifecycle/lifecycle-livedata-core-ktx-lint/build.gradle b/lifecycle/lifecycle-livedata-core-ktx-lint/build.gradle index 193e1c727a358..34ff6306a6cf1 100644 --- a/lifecycle/lifecycle-livedata-core-ktx-lint/build.gradle +++ b/lifecycle/lifecycle-livedata-core-ktx-lint/build.gradle @@ -26,14 +26,14 @@ plugins { } dependencies { - compileOnly(LINT_API_MIN) - compileOnly("com.android.tools.lint:lint:$lintMinVersion") - compileOnly(KOTLIN_STDLIB) + compileOnly(libs.androidLintMinApi) + compileOnly(libs.androidLintMin) + compileOnly(libs.kotlinStdlib) - testImplementation(KOTLIN_STDLIB) - testImplementation(LINT_CORE) - testImplementation(LINT_TESTS) - testImplementation(JUNIT) + testImplementation(libs.kotlinStdlib) + testImplementation(libs.androidLint) + testImplementation(libs.androidLintTests) + testImplementation(libs.junit) } androidx { diff --git a/lifecycle/lifecycle-livedata-core-ktx/build.gradle b/lifecycle/lifecycle-livedata-core-ktx/build.gradle index 040abc14539dc..ab16f089f9a95 100644 --- a/lifecycle/lifecycle-livedata-core-ktx/build.gradle +++ b/lifecycle/lifecycle-livedata-core-ktx/build.gradle @@ -14,13 +14,10 @@ * 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.Publish +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("AndroidXPlugin") @@ -30,13 +27,13 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-livedata-core")) - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) testImplementation(project(":lifecycle:lifecycle-runtime")) testImplementation("androidx.arch.core:core-testing:2.1.0") testImplementation(project(":lifecycle:lifecycle-runtime-testing")) - testImplementation(KOTLIN_COROUTINES_TEST) - testImplementation(JUNIT) - testImplementation(TRUTH) + testImplementation(libs.kotlinCoroutinesTest) + testImplementation(libs.junit) + testImplementation(libs.truth) lintPublish(project(":lifecycle:lifecycle-livedata-core-ktx-lint")) } diff --git a/lifecycle/lifecycle-livedata-core-truth/build.gradle b/lifecycle/lifecycle-livedata-core-truth/build.gradle index c1f5446ceff5e..727d7b7fb5b8e 100644 --- a/lifecycle/lifecycle-livedata-core-truth/build.gradle +++ b/lifecycle/lifecycle-livedata-core-truth/build.gradle @@ -14,7 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups import androidx.build.LibraryVersions import androidx.build.Publish @@ -27,10 +26,10 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-livedata-core-ktx")) - api(TRUTH) - api(KOTLIN_STDLIB) - testImplementation(TRUTH) - testImplementation(MOCKITO_CORE) + api(libs.truth) + api(libs.kotlinStdlib) + testImplementation(libs.truth) + testImplementation(libs.mockitoCore) testImplementation("androidx.arch.core:core-testing:2.1.0") testImplementation(project(":internal-testutils-truth")) } diff --git a/lifecycle/lifecycle-livedata-core/build.gradle b/lifecycle/lifecycle-livedata-core/build.gradle index e61b4ac3489cf..a68baa2ef01b1 100644 --- a/lifecycle/lifecycle-livedata-core/build.gradle +++ b/lifecycle/lifecycle-livedata-core/build.gradle @@ -14,10 +14,8 @@ * 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,9 +31,9 @@ dependencies { testImplementation(project(":lifecycle:lifecycle-runtime")) testImplementation("androidx.arch.core:core-testing:2.1.0") testImplementation(project(":lifecycle:lifecycle-runtime-testing")) - testImplementation(KOTLIN_COROUTINES_TEST) - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.kotlinCoroutinesTest) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) } androidx { diff --git a/lifecycle/lifecycle-livedata-ktx/build.gradle b/lifecycle/lifecycle-livedata-ktx/build.gradle index de01694f35df1..27fbedecd2169 100644 --- a/lifecycle/lifecycle-livedata-ktx/build.gradle +++ b/lifecycle/lifecycle-livedata-ktx/build.gradle @@ -14,13 +14,10 @@ * 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.Publish +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("AndroidXPlugin") @@ -38,19 +35,19 @@ tasks.withType(KotlinCompile).configureEach { dependencies { api(project(":lifecycle:lifecycle-livedata")) api(project(":lifecycle:lifecycle-livedata-core-ktx")) - api(KOTLIN_STDLIB) - api(KOTLIN_COROUTINES_CORE) + api(libs.kotlinStdlib) + api(libs.kotlinCoroutinesCore) testImplementation(project(":lifecycle:lifecycle-runtime-testing")) testImplementation("androidx.arch.core:core-testing:2.1.0") - testImplementation(JUNIT) - testImplementation(TRUTH) - testImplementation(KOTLIN_COROUTINES_TEST) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(KOTLIN_COROUTINES_TEST) - androidTestImplementation(KOTLIN_COROUTINES_ANDROID) + testImplementation(libs.junit) + testImplementation(libs.truth) + testImplementation(libs.kotlinCoroutinesTest) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.kotlinCoroutinesTest) + androidTestImplementation(libs.kotlinCoroutinesAndroid) } androidx { diff --git a/lifecycle/lifecycle-livedata/build.gradle b/lifecycle/lifecycle-livedata/build.gradle index e936c8a8d5ee0..769df0e6dc3e6 100644 --- a/lifecycle/lifecycle-livedata/build.gradle +++ b/lifecycle/lifecycle-livedata/build.gradle @@ -14,10 +14,8 @@ * 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,9 +30,9 @@ dependencies { testImplementation(project(":lifecycle:lifecycle-runtime-testing")) testImplementation("androidx.arch.core:core-testing:2.1.0") - testImplementation(KOTLIN_COROUTINES_TEST) - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.kotlinCoroutinesTest) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) } androidx { diff --git a/lifecycle/lifecycle-process/build.gradle b/lifecycle/lifecycle-process/build.gradle index 06b3c0b9f1dfb..bc8b86f36a764 100644 --- a/lifecycle/lifecycle-process/build.gradle +++ b/lifecycle/lifecycle-process/build.gradle @@ -14,10 +14,8 @@ * 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 { @@ -35,8 +33,8 @@ dependencies { api(project(":lifecycle:lifecycle-runtime")) api("androidx.startup:startup-runtime:1.0.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) } androidx { diff --git a/lifecycle/lifecycle-reactivestreams-ktx/build.gradle b/lifecycle/lifecycle-reactivestreams-ktx/build.gradle index cd16daa75b9b5..ba2bd36543d3a 100644 --- a/lifecycle/lifecycle-reactivestreams-ktx/build.gradle +++ b/lifecycle/lifecycle-reactivestreams-ktx/build.gradle @@ -14,14 +14,10 @@ * 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") @@ -31,12 +27,12 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-reactivestreams")) - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) - testImplementation(JUNIT) - testImplementation(RX_JAVA) - testImplementation(TRUTH) - testImplementation(KOTLIN_COROUTINES_TEST) + testImplementation(libs.junit) + testImplementation(libs.rxjava2) + testImplementation(libs.truth) + testImplementation(libs.kotlinCoroutinesTest) testImplementation(project(":lifecycle:lifecycle-runtime-testing")) testImplementation("androidx.arch.core:core-testing:2.1.0") } diff --git a/lifecycle/lifecycle-reactivestreams/build.gradle b/lifecycle/lifecycle-reactivestreams/build.gradle index 6572acf7d5761..c301bf7f7a1db 100644 --- a/lifecycle/lifecycle-reactivestreams/build.gradle +++ b/lifecycle/lifecycle-reactivestreams/build.gradle @@ -14,10 +14,8 @@ * 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 { @@ -31,13 +29,13 @@ dependencies { api(project(":lifecycle:lifecycle-livedata")) api(project(":lifecycle:lifecycle-runtime")) api("androidx.annotation:annotation:1.1.0") - api(REACTIVE_STREAMS) + api(libs.reactiveStreams) - annotationProcessor(NULLAWAY) + annotationProcessor(libs.nullaway) - testImplementation(JUNIT) - testImplementation(RX_JAVA) - testImplementation(KOTLIN_COROUTINES_TEST) + testImplementation(libs.junit) + testImplementation(libs.rxjava2) + testImplementation(libs.kotlinCoroutinesTest) testImplementation(project(":lifecycle:lifecycle-runtime-testing")) testImplementation("androidx.arch.core:core-testing:2.1.0") } diff --git a/lifecycle/lifecycle-runtime-ktx-lint/build.gradle b/lifecycle/lifecycle-runtime-ktx-lint/build.gradle index 6a17065557c09..524870dc859fe 100644 --- a/lifecycle/lifecycle-runtime-ktx-lint/build.gradle +++ b/lifecycle/lifecycle-runtime-ktx-lint/build.gradle @@ -18,21 +18,19 @@ import androidx.build.LibraryGroups import androidx.build.LibraryType import androidx.build.LibraryVersions -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("kotlin") } dependencies { - compileOnly(LINT_API_MIN) - compileOnly(KOTLIN_STDLIB) + compileOnly(libs.androidLintMinApi) + compileOnly(libs.kotlinStdlib) - testImplementation(KOTLIN_STDLIB) - testImplementation(LINT_CORE) - testImplementation(LINT_TESTS) - testImplementation(JUNIT) + testImplementation(libs.kotlinStdlib) + testImplementation(libs.androidLint) + testImplementation(libs.androidLintTests) + testImplementation(libs.junit) } androidx { diff --git a/lifecycle/lifecycle-runtime-ktx/build.gradle b/lifecycle/lifecycle-runtime-ktx/build.gradle index f6389068822f7..e6076bc9e5b0f 100644 --- a/lifecycle/lifecycle-runtime-ktx/build.gradle +++ b/lifecycle/lifecycle-runtime-ktx/build.gradle @@ -14,14 +14,11 @@ * limitations under the License. */ - import androidx.build.LibraryGroups import androidx.build.LibraryVersions 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,19 +27,19 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-runtime")) - api(KOTLIN_STDLIB) - api(KOTLIN_COROUTINES_ANDROID) + api(libs.kotlinStdlib) + api(libs.kotlinCoroutinesAndroid) api("androidx.annotation:annotation:1.0.0") - testImplementation(JUNIT) - testImplementation(TRUTH) + testImplementation(libs.junit) + testImplementation(libs.truth) androidTestImplementation(project(":lifecycle:lifecycle-runtime")) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(KOTLIN_COROUTINES_TEST) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.kotlinCoroutinesTest) lintPublish(project(":lifecycle:lifecycle-runtime-ktx-lint")) } diff --git a/lifecycle/lifecycle-runtime-testing/build.gradle b/lifecycle/lifecycle-runtime-testing/build.gradle index ae441d648f294..3a2a4cdadd427 100644 --- a/lifecycle/lifecycle-runtime-testing/build.gradle +++ b/lifecycle/lifecycle-runtime-testing/build.gradle @@ -14,13 +14,10 @@ * 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.Publish +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("AndroidXPlugin") @@ -30,17 +27,17 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-runtime-ktx")) - api(KOTLIN_STDLIB) - api(KOTLIN_COROUTINES_ANDROID) + api(libs.kotlinStdlib) + api(libs.kotlinCoroutinesAndroid) - testImplementation(TRUTH) - testImplementation(JUNIT) - testImplementation(KOTLIN_COROUTINES_TEST) + testImplementation(libs.truth) + testImplementation(libs.junit) + testImplementation(libs.kotlinCoroutinesTest) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) } androidx { diff --git a/lifecycle/lifecycle-runtime/build.gradle b/lifecycle/lifecycle-runtime/build.gradle index a053e6dc54f58..241d488b6797d 100644 --- a/lifecycle/lifecycle-runtime/build.gradle +++ b/lifecycle/lifecycle-runtime/build.gradle @@ -1,7 +1,5 @@ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups import androidx.build.LibraryVersions -import androidx.build.AndroidXExtension import androidx.build.Publish plugins { @@ -22,13 +20,13 @@ dependencies { api("androidx.annotation:annotation:1.1.0") implementation("androidx.arch.core:core-runtime:2.1.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) - androidTestImplementation(JUNIT) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) } androidx { diff --git a/lifecycle/lifecycle-service/build.gradle b/lifecycle/lifecycle-service/build.gradle index 2b81a01d41770..9d07cd7dd5bce 100644 --- a/lifecycle/lifecycle-service/build.gradle +++ b/lifecycle/lifecycle-service/build.gradle @@ -14,10 +14,8 @@ * 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 { @@ -28,9 +26,9 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-runtime")) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) androidTestImplementation("androidx.localbroadcastmanager:localbroadcastmanager:1.0.0") } diff --git a/lifecycle/lifecycle-viewmodel-compose/build.gradle b/lifecycle/lifecycle-viewmodel-compose/build.gradle index 2bdbb1c014752..5376e2f2f96c7 100644 --- a/lifecycle/lifecycle-viewmodel-compose/build.gradle +++ b/lifecycle/lifecycle-viewmodel-compose/build.gradle @@ -18,9 +18,6 @@ import androidx.build.LibraryGroups import androidx.build.LibraryVersions import androidx.build.Publish import androidx.build.RunApiTasks -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -import static androidx.build.dependencies.DependenciesKt.* plugins { id("AndroidXPlugin") @@ -36,14 +33,14 @@ dependencies { api projectOrArtifact(":compose:runtime:runtime") api projectOrArtifact(":compose:ui:ui") - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) androidTestImplementation projectOrArtifact(":compose:ui:ui-test-junit4") androidTestImplementation projectOrArtifact(":compose:test-utils") - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(JUNIT) - androidTestImplementation(TRUTH) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.truth) androidTestImplementation "androidx.fragment:fragment:1.3.0" androidTestImplementation "androidx.appcompat:appcompat:1.3.0-beta01" androidTestImplementation projectOrArtifact(":activity:activity-compose") diff --git a/lifecycle/lifecycle-viewmodel-compose/integration-tests/lifecycle-viewmodel-demos/build.gradle b/lifecycle/lifecycle-viewmodel-compose/integration-tests/lifecycle-viewmodel-demos/build.gradle index 8979c3cb9c5c4..c41787a5db8da 100644 --- a/lifecycle/lifecycle-viewmodel-compose/integration-tests/lifecycle-viewmodel-demos/build.gradle +++ b/lifecycle/lifecycle-viewmodel-compose/integration-tests/lifecycle-viewmodel-demos/build.gradle @@ -14,11 +14,7 @@ * limitations under the License. */ - import androidx.build.Publish -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -import static androidx.build.dependencies.DependenciesKt.getKOTLIN_STDLIB plugins { id("AndroidXPlugin") @@ -29,7 +25,7 @@ plugins { dependencies { kotlinPlugin projectOrArtifact(":compose:compiler:compiler") - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation projectOrArtifact(":lifecycle:lifecycle-viewmodel-compose") implementation projectOrArtifact( ":lifecycle:lifecycle-viewmodel-compose:lifecycle-viewmodel-compose-samples" diff --git a/lifecycle/lifecycle-viewmodel-compose/samples/build.gradle b/lifecycle/lifecycle-viewmodel-compose/samples/build.gradle index 3f1d51233c3c9..df450b17f9e43 100644 --- a/lifecycle/lifecycle-viewmodel-compose/samples/build.gradle +++ b/lifecycle/lifecycle-viewmodel-compose/samples/build.gradle @@ -14,13 +14,9 @@ * limitations under the License. */ - import androidx.build.LibraryGroups import androidx.build.LibraryVersions import androidx.build.LibraryType -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -import static androidx.build.dependencies.DependenciesKt.* plugins { id("AndroidXPlugin") @@ -31,7 +27,7 @@ plugins { dependencies { kotlinPlugin projectOrArtifact(":compose:compiler:compiler") - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation projectOrArtifact(":lifecycle:lifecycle-viewmodel-compose") } diff --git a/lifecycle/lifecycle-viewmodel-ktx/build.gradle b/lifecycle/lifecycle-viewmodel-ktx/build.gradle index 854918a1a54dc..43af991e9aa5c 100644 --- a/lifecycle/lifecycle-viewmodel-ktx/build.gradle +++ b/lifecycle/lifecycle-viewmodel-ktx/build.gradle @@ -14,7 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups import androidx.build.LibraryVersions import androidx.build.Publish @@ -27,16 +26,16 @@ plugins { dependencies { api(project(":lifecycle:lifecycle-viewmodel")) - api(KOTLIN_STDLIB) - api(KOTLIN_COROUTINES_ANDROID) + api(libs.kotlinStdlib) + api(libs.kotlinCoroutinesAndroid) - testImplementation(JUNIT) - testImplementation(TRUTH) + testImplementation(libs.junit) + testImplementation(libs.truth) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) } androidx { diff --git a/lifecycle/lifecycle-viewmodel-savedstate/build.gradle b/lifecycle/lifecycle-viewmodel-savedstate/build.gradle index b6496aaa17553..d62865327d9f1 100644 --- a/lifecycle/lifecycle-viewmodel-savedstate/build.gradle +++ b/lifecycle/lifecycle-viewmodel-savedstate/build.gradle @@ -14,10 +14,8 @@ * 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 { @@ -52,12 +50,12 @@ dependencies { exclude group: "androidx.lifecycle", module: "lifecycle-viewmodel-savedstate" exclude group: "androidx.lifecycle", module: "lifecycle-viewmodel" } - androidTestImplementation(TRUTH) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) } //used by testImplementation safe-args-generator diff --git a/lifecycle/lifecycle-viewmodel/build.gradle b/lifecycle/lifecycle-viewmodel/build.gradle index fb1af37276250..50abd68c518f1 100644 --- a/lifecycle/lifecycle-viewmodel/build.gradle +++ b/lifecycle/lifecycle-viewmodel/build.gradle @@ -14,10 +14,8 @@ * 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 { @@ -35,15 +33,15 @@ android { dependencies { api("androidx.annotation:annotation:1.1.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) - androidTestImplementation(TRUTH) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(JUNIT) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) } androidx { diff --git a/navigation/benchmark/build.gradle b/navigation/benchmark/build.gradle index 1bf4bf51792ab..deaa318e0a66b 100644 --- a/navigation/benchmark/build.gradle +++ b/navigation/benchmark/build.gradle @@ -13,9 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* + import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish plugins { @@ -29,12 +28,12 @@ dependencies { androidTestImplementation(projectOrArtifact(":benchmark:benchmark-junit4")) androidTestImplementation(project(":navigation:navigation-runtime")) androidTestImplementation(project(":internal-testutils-navigation")) - androidTestImplementation(JUNIT) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(KOTLIN_STDLIB) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.kotlinStdlib) } androidx { diff --git a/navigation/integration-tests/safeargs-testapp/build.gradle b/navigation/integration-tests/safeargs-testapp/build.gradle index ac8cc3344f622..d522f1c640b26 100644 --- a/navigation/integration-tests/safeargs-testapp/build.gradle +++ b/navigation/integration-tests/safeargs-testapp/build.gradle @@ -14,7 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups import androidx.build.LibraryVersions @@ -66,6 +65,6 @@ android { dependencies { implementation "${LibraryGroups.NAVIGATION}:navigation-runtime:${LibraryVersions.NAVIGATION}" - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) } diff --git a/navigation/integration-tests/testapp/build.gradle b/navigation/integration-tests/testapp/build.gradle index 190bedfe9fcc1..4703da6e7783d 100644 --- a/navigation/integration-tests/testapp/build.gradle +++ b/navigation/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 @@ -30,7 +28,7 @@ plugins { } dependencies { - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation("androidx.appcompat:appcompat:1.1.0") implementation(project(":navigation:navigation-fragment-ktx")) implementation(project(":navigation:navigation-ui-ktx")) diff --git a/navigation/navigation-common-ktx/build.gradle b/navigation/navigation-common-ktx/build.gradle index 2e6b8bbd1d166..e7791a0a0fde6 100644 --- a/navigation/navigation-common-ktx/build.gradle +++ b/navigation/navigation-common-ktx/build.gradle @@ -14,7 +14,6 @@ * limitations under the License. */ -import static androidx.build.dependencies.DependenciesKt.* import androidx.build.LibraryGroups import androidx.build.Publish import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode diff --git a/navigation/navigation-common/build.gradle b/navigation/navigation-common/build.gradle index fe1af8a29b7af..0a541e1e6f010 100644 --- a/navigation/navigation-common/build.gradle +++ b/navigation/navigation-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 { @@ -35,22 +32,22 @@ dependencies { implementation("androidx.core:core-ktx:1.1.0") implementation("androidx.collection:collection-ktx:1.1.0") - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) testImplementation(project(":navigation:navigation-testing")) testImplementation("androidx.arch.core:core-testing:2.1.0") - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) - testImplementation(TRUTH) - testImplementation(KOTLIN_STDLIB) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) + testImplementation(libs.truth) + testImplementation(libs.kotlinStdlib) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ESPRESSO_CORE) - androidTestImplementation(TRUTH) - androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) - androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) - androidTestImplementation(KOTLIN_STDLIB) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.espressoCore) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) + androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) + androidTestImplementation(libs.kotlinStdlib) } //used by testImplementation safe-args-generator diff --git a/navigation/navigation-compose/build.gradle b/navigation/navigation-compose/build.gradle index 11e4895218c12..7966a17a0dcba 100644 --- a/navigation/navigation-compose/build.gradle +++ b/navigation/navigation-compose/build.gradle @@ -15,12 +15,9 @@ */ import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish import androidx.build.RunApiTasks -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.library") @@ -31,7 +28,7 @@ plugins { dependencies { kotlinPlugin(projectOrArtifact(":compose:compiler:compiler")) - implementation(KOTLIN_STDLIB) + implementation(libs.kotlinStdlib) implementation(projectOrArtifact(":compose:foundation:foundation-layout")) api(projectOrArtifact(":activity:activity-compose")) api(projectOrArtifact(":compose:runtime:runtime")) @@ -47,9 +44,9 @@ dependencies { exclude group: "androidx.navigation", module: "navigation-common" }) androidTestImplementation(projectOrArtifact(":compose:ui:ui-test-junit4")) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(JUNIT) - androidTestImplementation(TRUTH) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.junit) + androidTestImplementation(libs.truth) } androidx { diff --git a/navigation/navigation-compose/integration-tests/navigation-demos/build.gradle b/navigation/navigation-compose/integration-tests/navigation-demos/build.gradle index cf1461dcce697..fb50bcbe6fe60 100644 --- a/navigation/navigation-compose/integration-tests/navigation-demos/build.gradle +++ b/navigation/navigation-compose/integration-tests/navigation-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") @@ -28,7 +25,7 @@ plugins { 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/navigation/navigation-compose/samples/build.gradle b/navigation/navigation-compose/samples/build.gradle index 778a74f4ce853..7dc352f096ec7 100644 --- a/navigation/navigation-compose/samples/build.gradle +++ b/navigation/navigation-compose/samples/build.gradle @@ -14,13 +14,9 @@ * limitations under the License. */ - import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.LibraryType -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.library") @@ -30,7 +26,7 @@ plugins { 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/navigation/navigation-dynamic-features-fragment/build.gradle b/navigation/navigation-dynamic-features-fragment/build.gradle index 708a89b72ebcb..60cf4908b98ed 100644 --- a/navigation/navigation-dynamic-features-fragment/build.gradle +++ b/navigation/navigation-dynamic-features-fragment/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 { @@ -35,28 +32,28 @@ android { dependencies { api(project(":navigation:navigation-dynamic-features-runtime")) api(project(":navigation:navigation-fragment")) - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) - testImplementation(ANDROIDX_TEST_CORE) - testImplementation(ANDROIDX_TEST_EXT_JUNIT) - testImplementation(ANDROIDX_TEST_RUNNER) - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) - testImplementation(TRUTH) + testImplementation(libs.testCore) + testImplementation(libs.testExtJunit) + testImplementation(libs.testRunner) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) + testImplementation(libs.truth) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) - androidTestImplementation(ESPRESSO_CORE) - androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) - androidTestImplementation(TRUTH) - androidTestImplementation(MULTIDEX) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) + androidTestImplementation(libs.espressoCore) + androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.multidex) androidTestImplementation(project(":internal-testutils-runtime"), { exclude group: "androidx.fragment", module: "fragment" }) - androidTestImplementation(MULTIDEX) + androidTestImplementation(libs.multidex) } android { diff --git a/navigation/navigation-dynamic-features-runtime/build.gradle b/navigation/navigation-dynamic-features-runtime/build.gradle index 098124008f076..bc5ae9a2c570a 100644 --- a/navigation/navigation-dynamic-features-runtime/build.gradle +++ b/navigation/navigation-dynamic-features-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 { @@ -34,28 +31,28 @@ android { dependencies { api(project(":navigation:navigation-runtime")) - api(PLAY_CORE) - api(KOTLIN_STDLIB) + api(libs.playCore) + api(libs.kotlinStdlib) testImplementation(project(":navigation:navigation-testing")) testImplementation("androidx.arch.core:core-testing:2.1.0") - testImplementation(ANDROIDX_TEST_CORE) - testImplementation(ANDROIDX_TEST_EXT_JUNIT) - testImplementation(ANDROIDX_TEST_RUNNER) - testImplementation(JUNIT) - testImplementation(MOCKITO_CORE) - testImplementation(ROBOLECTRIC) - testImplementation(TRUTH) + testImplementation(libs.testCore) + testImplementation(libs.testExtJunit) + testImplementation(libs.testRunner) + testImplementation(libs.junit) + testImplementation(libs.mockitoCore) + testImplementation(libs.robolectric) + testImplementation(libs.truth) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) - androidTestImplementation(ESPRESSO_CORE) - androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) - androidTestImplementation(TRUTH) - androidTestImplementation(MULTIDEX) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) + androidTestImplementation(libs.espressoCore) + androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.multidex) } androidx { diff --git a/navigation/navigation-fragment-ktx/build.gradle b/navigation/navigation-fragment-ktx/build.gradle index b73a493ab1d81..ea68cc81763ac 100644 --- a/navigation/navigation-fragment-ktx/build.gradle +++ b/navigation/navigation-fragment-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/navigation/navigation-fragment/build.gradle b/navigation/navigation-fragment/build.gradle index 5837d97396408..72e3ba0007d3d 100644 --- a/navigation/navigation-fragment/build.gradle +++ b/navigation/navigation-fragment/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 { @@ -30,14 +27,14 @@ dependencies { api(projectOrArtifact(":fragment:fragment-ktx")) api(project(":navigation:navigation-runtime")) - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) androidTestImplementation(project(":navigation:navigation-testing")) androidTestImplementation(projectOrArtifact(":fragment:fragment-testing")) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(TRUTH) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.truth) androidTestImplementation(project(":internal-testutils-runtime"), { exclude group: "androidx.fragment", module: "fragment" }) diff --git a/navigation/navigation-runtime-ktx/build.gradle b/navigation/navigation-runtime-ktx/build.gradle index ddb869e3cee88..5beadd463886f 100644 --- a/navigation/navigation-runtime-ktx/build.gradle +++ b/navigation/navigation-runtime-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/navigation/navigation-runtime-truth/build.gradle b/navigation/navigation-runtime-truth/build.gradle index dca17f9a69b09..683040f2388f8 100644 --- a/navigation/navigation-runtime-truth/build.gradle +++ b/navigation/navigation-runtime-truth/build.gradle @@ -14,14 +14,9 @@ * limitations under the License. */ - -import androidx.build.AndroidXExtension import androidx.build.LibraryGroups -import androidx.build.LibraryVersions import androidx.build.Publish -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.library") @@ -30,17 +25,17 @@ plugins { dependencies { api(project(":navigation:navigation-runtime")) - api(TRUTH) - api(KOTLIN_STDLIB) + api(libs.truth) + api(libs.kotlinStdlib) androidTestImplementation(project(":internal-testutils-truth")) androidTestImplementation(project(":internal-testutils-navigation"), { exclude group: "androidx.navigation", module: "navigation-common" }) - androidTestImplementation(TRUTH) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) } androidx { diff --git a/navigation/navigation-runtime/build.gradle b/navigation/navigation-runtime/build.gradle index d39567306ca86..1ba297ed5109a 100644 --- a/navigation/navigation-runtime/build.gradle +++ b/navigation/navigation-runtime/build.gradle @@ -14,13 +14,9 @@ * limitations under the License. */ - -import androidx.build.AndroidXExtension import androidx.build.LibraryGroups import androidx.build.Publish -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.library") @@ -33,20 +29,20 @@ dependencies { api("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1") api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1") - api(KOTLIN_STDLIB) + api(libs.kotlinStdlib) androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1") androidTestImplementation(project(":internal-testutils-navigation")) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_EXT_TRUTH) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(ESPRESSO_CORE) - androidTestImplementation(ESPRESSO_INTENTS) - androidTestImplementation(TRUTH) - androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) - androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) - androidTestImplementation(KOTLIN_STDLIB) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testExtTruth) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.espressoCore) + androidTestImplementation(libs.espressoIntents) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) + androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) + androidTestImplementation(libs.kotlinStdlib) } androidx { diff --git a/navigation/navigation-safe-args-generator/build.gradle b/navigation/navigation-safe-args-generator/build.gradle index 22d143a17ccff..68d7bf3d6bd01 100644 --- a/navigation/navigation-safe-args-generator/build.gradle +++ b/navigation/navigation-safe-args-generator/build.gradle @@ -19,23 +19,21 @@ import androidx.build.LibraryType import androidx.build.SdkHelperKt import androidx.build.SupportConfig -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("kotlin") } dependencies { - implementation(XPP3) - implementation(XMLPULL) - implementation(KOTLIN_STDLIB) + implementation(libs.xpp3) + implementation(libs.xmlpull) + implementation(libs.kotlinStdlib) - implementation(JAVAPOET) - implementation(KOTLINPOET) + implementation(libs.javapoet) + implementation(libs.kotlinPoet) - testImplementation(JUNIT) - testImplementation(GOOGLE_COMPILE_TESTING) + testImplementation(libs.junit) + testImplementation(libs.googleCompileTesting) testImplementation(fileTree( dir: "${SdkHelperKt.getSdkPath(project)}/platforms/$SupportConfig.COMPILE_SDK_VERSION/", include : "android.jar" diff --git a/navigation/navigation-safe-args-gradle-plugin/build.gradle b/navigation/navigation-safe-args-gradle-plugin/build.gradle index c327f2ceff17c..49cfde0315d0a 100644 --- a/navigation/navigation-safe-args-gradle-plugin/build.gradle +++ b/navigation/navigation-safe-args-gradle-plugin/build.gradle @@ -18,8 +18,6 @@ import androidx.build.LibraryGroups import androidx.build.LibraryType import androidx.build.SdkResourceGenerator -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("kotlin") @@ -28,13 +26,13 @@ plugins { dependencies { implementation("com.android.tools.build:gradle:4.0.1") - implementation(KOTLIN_GRADLE_PLUGIN) + implementation(libs.kotlinGradlePlugin) api(project(":navigation:navigation-safe-args-generator")) api(gradleApi()) - implementation(GSON) + implementation(libs.gson) testImplementation(gradleTestKit()) testImplementation(project(":internal-testutils-gradle-plugin")) - testImplementation(JUNIT) + testImplementation(libs.junit) } SdkResourceGenerator.generateForHostTest(project) diff --git a/navigation/navigation-testing/build.gradle b/navigation/navigation-testing/build.gradle index 139c664d37487..6404f629b4f72 100644 --- a/navigation/navigation-testing/build.gradle +++ b/navigation/navigation-testing/build.gradle @@ -14,13 +14,9 @@ * limitations under the License. */ - -import androidx.build.AndroidXExtension import androidx.build.LibraryGroups import androidx.build.Publish -import static androidx.build.dependencies.DependenciesKt.* - plugins { id("AndroidXPlugin") id("com.android.library") @@ -34,12 +30,12 @@ dependencies { androidTestImplementation(project(":internal-testutils-navigation"), { exclude group: "androidx.navigation", module: "navigation-common" }) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_EXT_TRUTH) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(ANDROIDX_TEST_RULES) - androidTestImplementation(TRUTH) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testExtTruth) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.testRules) + androidTestImplementation(libs.truth) } androidx { diff --git a/navigation/navigation-ui-ktx/build.gradle b/navigation/navigation-ui-ktx/build.gradle index f2b89649a23ff..a45c3cfa49df5 100644 --- a/navigation/navigation-ui-ktx/build.gradle +++ b/navigation/navigation-ui-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/navigation/navigation-ui/build.gradle b/navigation/navigation-ui/build.gradle index e0fa19fab407e..60c9b7a2c8a7d 100644 --- a/navigation/navigation-ui/build.gradle +++ b/navigation/navigation-ui/build.gradle @@ -16,10 +16,7 @@ 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 plugins { @@ -48,12 +45,12 @@ dependencies { androidTestImplementation(project(":internal-testutils-navigation"), { exclude group: "androidx.navigation", module: "navigation-common" }) - androidTestImplementation(KOTLIN_STDLIB) - androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) - androidTestImplementation(ANDROIDX_TEST_CORE) - androidTestImplementation(ANDROIDX_TEST_RUNNER) - androidTestImplementation(TRUTH) - androidTestImplementation(MULTIDEX) + androidTestImplementation(libs.kotlinStdlib) + androidTestImplementation(libs.testExtJunit) + androidTestImplementation(libs.testCore) + androidTestImplementation(libs.testRunner) + androidTestImplementation(libs.truth) + androidTestImplementation(libs.multidex) } androidx {