From 1d659b0eeaf80c0679e1302bbe17e1547e120111 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Sat, 9 Nov 2024 21:31:09 +0900 Subject: [PATCH] Replace kotlin("test") to version catalog `kotlin.test`. Change-Id: Ifd7de5dda724102063a9df660cacc6d6b16699e0 --- app/build.gradle.kts | 2 +- .../src/main/kotlin/AndroidLibraryConventionPlugin.kt | 4 ++-- .../convention/src/main/kotlin/JvmLibraryConventionPlugin.kt | 3 ++- lint/build.gradle.kts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1e4361008..5434df8c2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -123,7 +123,6 @@ dependencies { testDemoImplementation(libs.roborazzi) testDemoImplementation(projects.core.screenshotTesting) - androidTestImplementation(kotlin("test")) androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.dataTest) androidTestImplementation(projects.core.datastoreTest) @@ -131,6 +130,7 @@ dependencies { androidTestImplementation(libs.androidx.navigation.testing) androidTestImplementation(libs.androidx.compose.ui.test) androidTestImplementation(libs.hilt.android.testing) + androidTestImplementation(libs.kotlin.test) baselineProfile(projects.benchmarks) } diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt index 71d818c0c..2a10901fb 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt @@ -53,8 +53,8 @@ class AndroidLibraryConventionPlugin : Plugin { disableUnnecessaryAndroidTests(target) } dependencies { - add("androidTestImplementation", kotlin("test")) - add("testImplementation", kotlin("test")) + add("androidTestImplementation", libs.findLibrary("kotlin.test").get()) + add("testImplementation", libs.findLibrary("kotlin.test").get()) add("implementation", libs.findLibrary("androidx.tracing.ktx").get()) } diff --git a/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt index 652409db6..afe47eeee 100644 --- a/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt @@ -15,6 +15,7 @@ */ import com.google.samples.apps.nowinandroid.configureKotlinJvm +import com.google.samples.apps.nowinandroid.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies @@ -29,7 +30,7 @@ class JvmLibraryConventionPlugin : Plugin { } configureKotlinJvm() dependencies { - add("testImplementation", kotlin("test")) + add("testImplementation", libs.findLibrary("kotlin.test").get()) } } } diff --git a/lint/build.gradle.kts b/lint/build.gradle.kts index cfda9d64d..19ae8e442 100644 --- a/lint/build.gradle.kts +++ b/lint/build.gradle.kts @@ -39,7 +39,7 @@ kotlin { dependencies { compileOnly(libs.kotlin.stdlib) compileOnly(libs.lint.api) + testImplementation(libs.kotlin.test) testImplementation(libs.lint.checks) testImplementation(libs.lint.tests) - testImplementation(kotlin("test")) }