Update build files to use layout v2
Test: Presubmit builds + ABTD
Bug: 2716535
Change-Id: I7de6127e0cc779011a64b239c238146a10756da3
diff --git a/buildSrc/lint.xml b/buildSrc/lint.xml
index 749708c..1eaf525 100644
--- a/buildSrc/lint.xml
+++ b/buildSrc/lint.xml
@@ -28,7 +28,8 @@
<ignore path="**/src/test/**" />
<ignore path="**/src/androidTest/**" />
<!-- Required for Kotlin multi-platform tests. -->
- <ignore path="**/src/androidAndroidTest/**" />
+ <ignore path="**/src/androidInstrumentedTest/**" />
+ <ignore path="**/src/androidUnitTest/**" />
<ignore path="**/src/jvmTest/**" />
<ignore path="**/src/commonTest/**" />
<!-- Required for AppSearch icing tests. -->
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
index 5fe690c..1051dfc 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
@@ -902,7 +902,7 @@
sourceSets
.findByName("androidTest")!!
.manifest
- .srcFile("src/androidAndroidTest/AndroidManifest.xml")
+ .srcFile("src/androidInstrumentedTest/AndroidManifest.xml")
}
/** Sets the konan distribution url to the prebuilts directory. */
@@ -1260,9 +1260,9 @@
?.findByName("androidTest")
?.let { if (it.kotlin.files.isNotEmpty()) return true }
- // check kotlin-multiplatform androidAndroidTest source set
+ // check kotlin-multiplatform androidInstrumentedTest source set
multiplatformExtension?.apply {
- sourceSets.findByName("androidAndroidTest")?.let {
+ sourceSets.findByName("androidInstrumentedTest")?.let {
if (it.kotlin.files.isNotEmpty()) return true
}
}
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt b/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
index c961f39..96da0c0 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
@@ -178,6 +178,8 @@
if (name.startsWith("androidTest")) return false
if (name.startsWith("androidAndroidTest")) return false
if (name.startsWith("androidCommonTest")) return false
+ if (name.startsWith("androidInstrumentedTest")) return false
+ if (name.startsWith("androidUnitTest")) return false
if (name.startsWith("debug")) return false
if (name.startsWith("androidDebug")) return false
if (name.startsWith("release")) return false
diff --git a/collection/collection-benchmark/build.gradle b/collection/collection-benchmark/build.gradle
index f28fbdd..2ec43e2 100644
--- a/collection/collection-benchmark/build.gradle
+++ b/collection/collection-benchmark/build.gradle
@@ -62,7 +62,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(commonTest)
dependencies {
implementation(projectOrArtifact(":benchmark:benchmark-junit4"))
diff --git a/compose/animation/animation-core/build.gradle b/compose/animation/animation-core/build.gradle
index 1af0fb2..9547fc0 100644
--- a/compose/animation/animation-core/build.gradle
+++ b/compose/animation/animation-core/build.gradle
@@ -85,13 +85,14 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.testCore)
implementation(libs.junit)
+ implementation(libs.truth)
implementation(project(":compose:animation:animation"))
implementation("androidx.compose.ui:ui-test-junit4:1.2.1")
implementation(project(":compose:test-utils"))
@@ -102,7 +103,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/animation/animation-graphics/build.gradle b/compose/animation/animation-graphics/build.gradle
index 4faa4b5..9126638 100644
--- a/compose/animation/animation-graphics/build.gradle
+++ b/compose/animation/animation-graphics/build.gradle
@@ -91,7 +91,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
@@ -108,7 +108,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/animation/animation/build.gradle b/compose/animation/animation/build.gradle
index 2fecd73..929927e 100644
--- a/compose/animation/animation/build.gradle
+++ b/compose/animation/animation/build.gradle
@@ -87,7 +87,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
@@ -105,7 +105,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/foundation/foundation-layout/build.gradle b/compose/foundation/foundation-layout/build.gradle
index 055f276..320eead 100644
--- a/compose/foundation/foundation-layout/build.gradle
+++ b/compose/foundation/foundation-layout/build.gradle
@@ -81,7 +81,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:foundation:foundation"))
@@ -100,7 +100,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/foundation/foundation/build.gradle b/compose/foundation/foundation/build.gradle
index 60bba5d..a6d0d8f 100644
--- a/compose/foundation/foundation/build.gradle
+++ b/compose/foundation/foundation/build.gradle
@@ -88,7 +88,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:test-utils"))
@@ -116,7 +116,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
@@ -124,6 +124,8 @@
implementation(libs.junit)
implementation(libs.truth)
implementation(libs.kotlinReflect)
+ implementation(libs.mockitoCore)
+ implementation(libs.mockitoKotlin)
implementation(project(":constraintlayout:constraintlayout-compose"))
}
}
diff --git a/compose/material/material-icons-core/build.gradle b/compose/material/material-icons-core/build.gradle
index fe670b2..ed5ea61 100644
--- a/compose/material/material-icons-core/build.gradle
+++ b/compose/material/material-icons-core/build.gradle
@@ -85,13 +85,13 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
}
diff --git a/compose/material/material-icons-extended/build.gradle b/compose/material/material-icons-extended/build.gradle
index e6002b6..bd59f9f 100644
--- a/compose/material/material-icons-extended/build.gradle
+++ b/compose/material/material-icons-extended/build.gradle
@@ -88,7 +88,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:foundation:foundation"))
@@ -108,7 +108,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
}
diff --git a/compose/material/material-ripple/build.gradle b/compose/material/material-ripple/build.gradle
index c2a484d..f4f8356 100644
--- a/compose/material/material-ripple/build.gradle
+++ b/compose/material/material-ripple/build.gradle
@@ -88,7 +88,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:test-utils"))
@@ -104,7 +104,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/material/material/build.gradle b/compose/material/material/build.gradle
index 8da78ab39..577c4b8 100644
--- a/compose/material/material/build.gradle
+++ b/compose/material/material/build.gradle
@@ -105,7 +105,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:material:material:material-samples"))
@@ -127,7 +127,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/material3/material3-adaptive/build.gradle b/compose/material3/material3-adaptive/build.gradle
index 5c97bb2..aeb1c75 100644
--- a/compose/material3/material3-adaptive/build.gradle
+++ b/compose/material3/material3-adaptive/build.gradle
@@ -86,7 +86,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependsOn(androidMain)
dependencies {
@@ -97,6 +97,15 @@
implementation(libs.truth)
}
}
+
+ androidUnitTest {
+ dependsOn(jvmTest)
+ dependencies {
+ implementation(libs.junit)
+ implementation(libs.testRunner)
+ implementation(libs.truth)
+ }
+ }
}
}
diff --git a/compose/material3/material3-window-size-class/build.gradle b/compose/material3/material3-window-size-class/build.gradle
index ae8d2cd..74d0693 100644
--- a/compose/material3/material3-window-size-class/build.gradle
+++ b/compose/material3/material3-window-size-class/build.gradle
@@ -93,7 +93,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:test-utils"))
@@ -105,7 +105,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.kotlinTest)
diff --git a/compose/material3/material3/build.gradle b/compose/material3/material3/build.gradle
index fe8552b..28b67ea 100644
--- a/compose/material3/material3/build.gradle
+++ b/compose/material3/material3/build.gradle
@@ -115,7 +115,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
@@ -125,7 +125,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:material3:material3:material3-samples"))
diff --git a/compose/runtime/runtime-saveable/build.gradle b/compose/runtime/runtime-saveable/build.gradle
index 7f1d7ff..ace0562 100644
--- a/compose/runtime/runtime-saveable/build.gradle
+++ b/compose/runtime/runtime-saveable/build.gradle
@@ -48,6 +48,7 @@
}
jvmMain {
+ dependsOn(commonMain)
dependencies {
}
}
@@ -72,7 +73,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation project(':compose:ui:ui')
@@ -96,7 +97,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/runtime/runtime/build.gradle b/compose/runtime/runtime/build.gradle
index 8a8b37c..9da1a17 100644
--- a/compose/runtime/runtime/build.gradle
+++ b/compose/runtime/runtime/build.gradle
@@ -93,7 +93,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testExtJunit)
@@ -103,7 +103,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependsOn(nonEmulatorJvmTest)
}
diff --git a/compose/runtime/runtime/integration-tests/build.gradle b/compose/runtime/runtime/integration-tests/build.gradle
index f62e6ba..4224740 100644
--- a/compose/runtime/runtime/integration-tests/build.gradle
+++ b/compose/runtime/runtime/integration-tests/build.gradle
@@ -73,11 +73,12 @@
}
jvmTest {
+ dependsOn(commonTest)
dependencies {
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(projectOrArtifact(":compose:ui:ui"))
@@ -92,7 +93,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
}
diff --git a/compose/test-utils/build.gradle b/compose/test-utils/build.gradle
index 4331b6f..b33c4c9 100644
--- a/compose/test-utils/build.gradle
+++ b/compose/test-utils/build.gradle
@@ -85,7 +85,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.truth)
@@ -97,7 +97,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.truth)
diff --git a/compose/ui/ui-geometry/build.gradle b/compose/ui/ui-geometry/build.gradle
index 951f1d1..13aaf88 100644
--- a/compose/ui/ui-geometry/build.gradle
+++ b/compose/ui/ui-geometry/build.gradle
@@ -76,13 +76,13 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
}
diff --git a/compose/ui/ui-graphics/build.gradle b/compose/ui/ui-graphics/build.gradle
index 3bb74e1..ab720b4 100644
--- a/compose/ui/ui-graphics/build.gradle
+++ b/compose/ui/ui-graphics/build.gradle
@@ -89,7 +89,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:ui:ui-graphics:ui-graphics-samples"))
@@ -99,6 +99,7 @@
implementation(libs.testRunner)
implementation(libs.espressoCore)
implementation(libs.junit)
+ implementation(libs.truth)
}
}
@@ -106,7 +107,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/compose/ui/ui-test-junit4/build.gradle b/compose/ui/ui-test-junit4/build.gradle
index 8bb1fb3..a65f822 100644
--- a/compose/ui/ui-test-junit4/build.gradle
+++ b/compose/ui/ui-test-junit4/build.gradle
@@ -92,7 +92,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:animation:animation"))
@@ -112,7 +112,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:animation:animation-core"))
@@ -147,7 +147,7 @@
}
dependencies {
- // Can't declare this in kotlin { sourceSets { androidTest.dependencies { .. } } } as that
+ // Can't declare this in kotlin { sourceSets { androidUnitTest.dependencies { .. } } } as that
// leaks into instrumented tests (b/214407011)
testImplementation(libs.robolectric)
}
diff --git a/compose/ui/ui-test/build.gradle b/compose/ui/ui-test/build.gradle
index fa5ac5f..56b3e50 100644
--- a/compose/ui/ui-test/build.gradle
+++ b/compose/ui/ui-test/build.gradle
@@ -96,7 +96,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependsOn(androidCommonTest)
dependencies {
@@ -114,7 +114,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependsOn(androidCommonTest)
dependencies {
@@ -144,7 +144,7 @@
}
dependencies {
- // Can't declare this in kotlin { sourceSets { androidTest.dependencies { .. } } } as that
+ // Can't declare this in kotlin { sourceSets { androidUnitTest.dependencies { .. } } } as that
// leaks into instrumented tests (b/214407011)
testImplementation(libs.robolectric)
}
diff --git a/compose/ui/ui-text/build.gradle b/compose/ui/ui-text/build.gradle
index 4486d14..d4383a4 100644
--- a/compose/ui/ui-text/build.gradle
+++ b/compose/ui/ui-text/build.gradle
@@ -96,7 +96,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:ui:ui-test-junit4"))
@@ -117,7 +117,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":internal-testutils-fonts"))
@@ -150,7 +150,7 @@
}
dependencies {
- // Can't declare this in kotlin { sourceSets { androidTest.dependencies { .. } } } as that
+ // Can't declare this in kotlin { sourceSets { androidUnitTest.dependencies { .. } } } as that
// leaks into instrumented tests (b/214407011)
testImplementation(libs.mockitoCore4)
testImplementation(libs.mockitoKotlin4)
diff --git a/compose/ui/ui-tooling-data/build.gradle b/compose/ui/ui-tooling-data/build.gradle
index 0faefb4..4b88d71 100644
--- a/compose/ui/ui-tooling-data/build.gradle
+++ b/compose/ui/ui-tooling-data/build.gradle
@@ -88,7 +88,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:ui:ui-test-junit4"))
@@ -106,7 +106,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.truth)
diff --git a/compose/ui/ui-tooling-preview/build.gradle b/compose/ui/ui-tooling-preview/build.gradle
index c32950f..d5f1884 100644
--- a/compose/ui/ui-tooling-preview/build.gradle
+++ b/compose/ui/ui-tooling-preview/build.gradle
@@ -85,13 +85,13 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.junit)
diff --git a/compose/ui/ui-tooling/build.gradle b/compose/ui/ui-tooling/build.gradle
index ac62e0d..9e399a7 100644
--- a/compose/ui/ui-tooling/build.gradle
+++ b/compose/ui/ui-tooling/build.gradle
@@ -98,7 +98,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(project(":compose:ui:ui-test-junit4"))
@@ -117,7 +117,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
}
diff --git a/compose/ui/ui-unit/build.gradle b/compose/ui/ui-unit/build.gradle
index 8bf9c195..d87b7b3 100644
--- a/compose/ui/ui-unit/build.gradle
+++ b/compose/ui/ui-unit/build.gradle
@@ -51,6 +51,7 @@
}
jvmMain {
+ dependsOn(commonMain)
dependencies {
implementation(libs.kotlinStdlib)
}
@@ -79,13 +80,14 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.testExtJunit)
implementation(libs.espressoCore)
+ implementation(libs.truth)
implementation('androidx.collection:collection-ktx:1.2.0')
}
}
@@ -94,7 +96,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.truth)
diff --git a/compose/ui/ui-util/build.gradle b/compose/ui/ui-util/build.gradle
index a041871..1f53f9b 100644
--- a/compose/ui/ui-util/build.gradle
+++ b/compose/ui/ui-util/build.gradle
@@ -70,7 +70,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
}
@@ -80,7 +80,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.truth)
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index f88d2c1..f78c397 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -116,7 +116,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation("androidx.fragment:fragment:1.3.0")
@@ -155,7 +155,7 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
@@ -163,6 +163,7 @@
implementation(libs.kotlinCoroutinesTest)
implementation(libs.junit)
implementation(libs.truth)
+ implementation(libs.kotlinTest)
implementation(project(":compose:ui:ui-test-junit4"))
implementation(project(":internal-testutils-fonts"))
implementation(project(":compose:test-utils"))
@@ -210,7 +211,7 @@
lintChecks(project(":compose:ui:ui-lint"))
lintPublish(project(":compose:ui:ui-lint"))
- // Can't declare this in kotlin { sourceSets { androidTest.dependencies { .. } } } as that
+ // Can't declare this in kotlin { sourceSets { androidUnitTest.dependencies { .. } } } as that
// leaks into instrumented tests (b/214407011)
testImplementation(libs.robolectric)
testImplementation(libs.mockitoCore4)
diff --git a/constraintlayout/constraintlayout-compose/build.gradle b/constraintlayout/constraintlayout-compose/build.gradle
index 5a3d7f55..52093a5 100644
--- a/constraintlayout/constraintlayout-compose/build.gradle
+++ b/constraintlayout/constraintlayout-compose/build.gradle
@@ -63,7 +63,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.kotlinTest)
@@ -84,9 +84,10 @@
// need to add Robolectric (which must be kept out of androidAndroidTest), use a top
// level dependencies block instead:
// `dependencies { testImplementation(libs.robolectric) }`
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
+ implementation(libs.kotlinTest)
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.junit)
diff --git a/datastore/datastore-core/build.gradle b/datastore/datastore-core/build.gradle
index f9faa96..e71978e 100644
--- a/datastore/datastore-core/build.gradle
+++ b/datastore/datastore-core/build.gradle
@@ -110,7 +110,7 @@
}
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.protobufLite)
@@ -125,8 +125,8 @@
}
}
- androidAndroidTest {
- dependsOn(androidTest)
+ androidInstrumentedTest {
+ dependsOn(androidUnitTest)
}
if (enableNative) {
diff --git a/datastore/datastore-preferences/build.gradle b/datastore/datastore-preferences/build.gradle
index 8750330..e8cbf29 100644
--- a/datastore/datastore-preferences/build.gradle
+++ b/datastore/datastore-preferences/build.gradle
@@ -64,11 +64,11 @@
androidMain {
dependsOn(jvmMain)
}
- androidTest {
+ androidUnitTest {
dependsOn(jvmTest)
}
- androidAndroidTest {
- dependsOn(androidTest)
+ androidInstrumentedTest {
+ dependsOn(androidUnitTest)
dependencies {
implementation(libs.testRunner)
implementation(libs.testCore)
diff --git a/datastore/datastore/build.gradle b/datastore/datastore/build.gradle
index 6f9b832..0eaed8a 100644
--- a/datastore/datastore/build.gradle
+++ b/datastore/datastore/build.gradle
@@ -75,7 +75,7 @@
implementation(libs.okio)
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.junit)
diff --git a/development/project-creator/compose-template/groupId/artifactId/build.gradle b/development/project-creator/compose-template/groupId/artifactId/build.gradle
index 17cf909..7c0c4a1 100644
--- a/development/project-creator/compose-template/groupId/artifactId/build.gradle
+++ b/development/project-creator/compose-template/groupId/artifactId/build.gradle
@@ -79,7 +79,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRules)
diff --git a/graphics/graphics-shapes/build.gradle b/graphics/graphics-shapes/build.gradle
index db58bca..ffc867b 100644
--- a/graphics/graphics-shapes/build.gradle
+++ b/graphics/graphics-shapes/build.gradle
@@ -53,7 +53,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(commonTest)
dependencies {
implementation(libs.testExtJunit)
diff --git a/lint-checks/src/main/java/androidx/build/lint/TestSizeAnnotationEnforcer.kt b/lint-checks/src/main/java/androidx/build/lint/TestSizeAnnotationEnforcer.kt
index 0777c76..d068661 100644
--- a/lint-checks/src/main/java/androidx/build/lint/TestSizeAnnotationEnforcer.kt
+++ b/lint-checks/src/main/java/androidx/build/lint/TestSizeAnnotationEnforcer.kt
@@ -168,7 +168,7 @@
*/
private val ANDROID_TEST_DIRS = listOf(
"androidTest",
- "androidAndroidTest",
+ "androidInstrumentedTest",
"androidDeviceTest",
"androidDeviceTestDebug",
"androidDeviceTestRelease"
diff --git a/paging/paging-common/build.gradle b/paging/paging-common/build.gradle
index ffd08fb..0e62fb1 100644
--- a/paging/paging-common/build.gradle
+++ b/paging/paging-common/build.gradle
@@ -87,7 +87,7 @@
dependsOn(commonJvmAndroidTest)
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(commonJvmAndroidTest)
dependencies {
implementation(libs.testRunner)
diff --git a/paging/paging-compose/build.gradle b/paging/paging-compose/build.gradle
index 98319a3..eb8a9ea 100644
--- a/paging/paging-compose/build.gradle
+++ b/paging/paging-compose/build.gradle
@@ -59,7 +59,7 @@
}
}
- androidAndroidTest {
+ androidInstrumentedTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testRunner)
diff --git a/paging/paging-testing/build.gradle b/paging/paging-testing/build.gradle
index f605fc4..4b85a2d 100644
--- a/paging/paging-testing/build.gradle
+++ b/paging/paging-testing/build.gradle
@@ -39,7 +39,7 @@
implementation(project(":paging:paging-common"))
}
}
- androidTest {
+ androidUnitTest {
dependencies {
implementation(libs.junit)
implementation(libs.kotlinCoroutinesTest)
diff --git a/webkit/webkit/lint.xml b/webkit/webkit/lint.xml
index dd56e16..e992b01 100644
--- a/webkit/webkit/lint.xml
+++ b/webkit/webkit/lint.xml
@@ -9,7 +9,8 @@
<ignore path="**/src/test/**" />
<ignore path="**/src/androidTest/**" />
<!-- Required for Kotlin multi-platform tests. -->
- <ignore path="**/src/androidAndroidTest/**" />
+ <ignore path="**/src/androidInstrumentedTest/**" />
+ <ignore path="**/src/androidUnitTest/**" />
<ignore path="**/src/jvmTest/**" />
<ignore path="**/src/commonTest/**" />
<!-- Required for AppSearch icing tests. -->