Cleanup dependencies

This is a followup cleanup of #1163 that was partially addressed by #1140.

- Remove unused `projects.core.testing` dependencies (or replace with direct dependencies).
- Introduce `androidx.compose.ui.test` bundle.
- Remove `NiaTestRunner` from the default config, forcing consumers to depend on it, even when not used.
pull/1315/head
Simon Marquis 9 months ago
parent bd89507f10
commit 930e061611

@ -112,7 +112,6 @@ dependencies {
kspTest(libs.hilt.compiler) kspTest(libs.hilt.compiler)
testImplementation(projects.core.dataTest) testImplementation(projects.core.dataTest)
testImplementation(projects.core.testing)
testImplementation(libs.accompanist.testharness) testImplementation(libs.accompanist.testharness)
testImplementation(libs.hilt.android.testing) testImplementation(libs.hilt.android.testing)
testImplementation(libs.work.testing) testImplementation(libs.work.testing)
@ -121,12 +120,14 @@ dependencies {
testDemoImplementation(libs.roborazzi) testDemoImplementation(libs.roborazzi)
testDemoImplementation(projects.core.screenshotTesting) testDemoImplementation(projects.core.screenshotTesting)
androidTestImplementation(kotlin("test"))
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
androidTestImplementation(projects.core.dataTest) androidTestImplementation(projects.core.dataTest)
androidTestImplementation(projects.core.datastoreTest) androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.navigation.testing) androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.accompanist.testharness) androidTestImplementation(libs.accompanist.testharness)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(libs.hilt.android.testing) androidTestImplementation(libs.hilt.android.testing)
baselineProfile(projects.benchmarks) baselineProfile(projects.benchmarks)

@ -30,10 +30,6 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
apply("nowinandroid.android.hilt") apply("nowinandroid.android.hilt")
} }
extensions.configure<LibraryExtension> { extensions.configure<LibraryExtension> {
defaultConfig {
testInstrumentationRunner =
"com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner"
}
testOptions.animationsDisabled = true testOptions.animationsDisabled = true
configureGradleManagedDevices(this) configureGradleManagedDevices(this)
} }

@ -40,6 +40,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
extensions.configure<LibraryExtension> { extensions.configure<LibraryExtension> {
configureKotlinAndroid(this) configureKotlinAndroid(this)
defaultConfig.targetSdk = 34 defaultConfig.targetSdk = 34
defaultConfig.testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testOptions.animationsDisabled = true testOptions.animationsDisabled = true
configureFlavors(this) configureFlavors(this)
configureGradleManagedDevices(this) configureGradleManagedDevices(this)
@ -52,6 +53,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
disableUnnecessaryAndroidTests(target) disableUnnecessaryAndroidTests(target)
} }
dependencies { dependencies {
add("androidTestImplementation", kotlin("test"))
add("testImplementation", kotlin("test")) add("testImplementation", kotlin("test"))
add("implementation", libs.findLibrary("androidx.tracing.ktx").get()) add("implementation", libs.findLibrary("androidx.tracing.ktx").get())

@ -22,10 +22,6 @@ plugins {
} }
android { android {
defaultConfig {
testInstrumentationRunner =
"com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner"
}
namespace = "com.google.samples.apps.nowinandroid.core.database" namespace = "com.google.samples.apps.nowinandroid.core.database"
} }
@ -34,5 +30,7 @@ dependencies {
implementation(libs.kotlinx.datetime) implementation(libs.kotlinx.datetime)
androidTestImplementation(projects.core.testing) androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.kotlinx.coroutines.test)
} }

@ -43,10 +43,7 @@ dependencies {
testImplementation(libs.accompanist.testharness) testImplementation(libs.accompanist.testharness)
testImplementation(libs.hilt.android.testing) testImplementation(libs.hilt.android.testing)
testImplementation(libs.robolectric) testImplementation(libs.robolectric)
testImplementation(libs.roborazzi)
testImplementation(projects.core.screenshotTesting) testImplementation(projects.core.screenshotTesting)
testImplementation(projects.core.testing)
androidTestImplementation(libs.androidx.compose.ui.test) androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing)
} }

@ -24,11 +24,10 @@ android {
} }
dependencies { dependencies {
api(libs.androidx.activity.compose)
api(libs.roborazzi) api(libs.roborazzi)
api(libs.robolectric)
api(libs.bundles.androidx.compose.ui.test)
implementation(libs.accompanist.testharness) implementation(libs.accompanist.testharness)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.ui.test)
implementation(libs.robolectric)
implementation(projects.core.common)
implementation(projects.core.designsystem) implementation(projects.core.designsystem)
} }

@ -15,7 +15,6 @@
*/ */
plugins { plugins {
alias(libs.plugins.nowinandroid.android.library) alias(libs.plugins.nowinandroid.android.library)
alias(libs.plugins.nowinandroid.android.library.compose)
alias(libs.plugins.nowinandroid.android.hilt) alias(libs.plugins.nowinandroid.android.hilt)
} }
@ -24,19 +23,15 @@ android {
} }
dependencies { dependencies {
api(kotlin("test")) api(libs.kotlinx.coroutines.test)
api(libs.androidx.compose.ui.test)
api(projects.core.analytics) api(projects.core.analytics)
api(projects.core.common)
api(projects.core.data) api(projects.core.data)
api(projects.core.model) api(projects.core.model)
api(projects.core.notifications) api(projects.core.notifications)
debugApi(libs.androidx.compose.ui.testManifest)
implementation(libs.androidx.test.rules) implementation(libs.androidx.test.rules)
implementation(libs.hilt.android.testing) implementation(libs.hilt.android.testing)
implementation(libs.kotlinx.coroutines.test)
implementation(libs.kotlinx.datetime) implementation(libs.kotlinx.datetime)
implementation(projects.core.common)
implementation(projects.core.designsystem)
} }

@ -20,9 +20,6 @@ plugins {
} }
android { android {
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
namespace = "com.google.samples.apps.nowinandroid.core.ui" namespace = "com.google.samples.apps.nowinandroid.core.ui"
} }
@ -36,5 +33,6 @@ dependencies {
implementation(libs.coil.kt) implementation(libs.coil.kt)
implementation(libs.coil.kt.compose) implementation(libs.coil.kt.compose)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
} }

@ -29,5 +29,6 @@ dependencies {
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
} }

@ -33,8 +33,8 @@ dependencies {
testImplementation(libs.hilt.android.testing) testImplementation(libs.hilt.android.testing)
testImplementation(libs.robolectric) testImplementation(libs.robolectric)
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
testImplementation(projects.core.screenshotTesting) testDemoImplementation(projects.core.screenshotTesting)
testDemoImplementation(libs.roborazzi)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
} }

@ -29,5 +29,6 @@ dependencies {
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
} }

@ -31,6 +31,7 @@ dependencies {
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
} }

@ -31,5 +31,5 @@ dependencies {
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
androidTestImplementation(projects.core.testing) androidTestImplementation(libs.bundles.androidx.compose.ui.test)
} }

@ -29,5 +29,6 @@ dependencies {
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
} }

@ -59,6 +59,9 @@ secrets = "2.0.1"
truth = "1.4.2" truth = "1.4.2"
turbine = "1.0.0" turbine = "1.0.0"
[bundles]
androidx-compose-ui-test = ["androidx-compose-ui-test", "androidx-compose-ui-testManifest"]
[libraries] [libraries]
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist" } accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist" }
accompanist-testharness = { group = "com.google.accompanist", name = "accompanist-testharness", version.ref = "accompanist" } accompanist-testharness = { group = "com.google.accompanist", name = "accompanist-testharness", version.ref = "accompanist" }

Loading…
Cancel
Save