aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/java/SlimTests.kt
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-07-29 15:24:31 +0530
committerGitHub <noreply@github.com>2021-07-29 09:54:31 +0000
commit403bb383b5caa23bbb14f4e59e2727ae70ed2283 (patch)
tree889bff20fed7f8c3dbaab2d00cd7e8186cb27058 /buildSrc/src/main/java/SlimTests.kt
parent1172c3734fe68fed9d16c93175a5b1940f103b69 (diff)
Upgrade to AGP 7.0.0 (#1474)
Diffstat (limited to 'buildSrc/src/main/java/SlimTests.kt')
-rw-r--r--buildSrc/src/main/java/SlimTests.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/buildSrc/src/main/java/SlimTests.kt b/buildSrc/src/main/java/SlimTests.kt
index 65e9c618..e06c7c8c 100644
--- a/buildSrc/src/main/java/SlimTests.kt
+++ b/buildSrc/src/main/java/SlimTests.kt
@@ -3,8 +3,8 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
-import com.android.build.api.extension.ApplicationAndroidComponentsExtension
-import com.android.build.api.extension.LibraryAndroidComponentsExtension
+import com.android.build.api.variant.ApplicationAndroidComponentsExtension
+import com.android.build.api.variant.LibraryAndroidComponentsExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.findByType
import org.gradle.language.nativeplatform.internal.BuildType
@@ -21,15 +21,15 @@ internal fun Project.configureSlimTests() {
if (providers.gradleProperty(SLIM_TESTS_PROPERTY).forUseAtConfigurationTime().isPresent) {
// disable unit test tasks on the release build type for Android Library projects
extensions.findByType<LibraryAndroidComponentsExtension>()?.run {
- beforeUnitTests(selector().withBuildType(BuildType.RELEASE.name)) { it.enabled = false }
+ beforeVariants(selector().withBuildType(BuildType.RELEASE.name)) { it.enableUnitTest = false }
}
// disable unit test tasks on the release build type and free flavor for Android Application
// projects.
extensions.findByType<ApplicationAndroidComponentsExtension>()?.run {
- beforeUnitTests(selector().withBuildType(BuildType.RELEASE.name)) { it.enabled = false }
- beforeUnitTests(selector().withFlavor(FlavorDimensions.FREE to ProductFlavors.NON_FREE)) {
- it.enabled = false
+ beforeVariants(selector().withBuildType(BuildType.RELEASE.name)) { it.enableUnitTest = false }
+ beforeVariants(selector().withFlavor(FlavorDimensions.FREE to ProductFlavors.NON_FREE)) {
+ it.enableUnitTest = false
}
}
}