From 403bb383b5caa23bbb14f4e59e2727ae70ed2283 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 29 Jul 2021 15:24:31 +0530 Subject: Upgrade to AGP 7.0.0 (#1474) --- buildSrc/src/main/java/SlimTests.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'buildSrc/src/main/java/SlimTests.kt') 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()?.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()?.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 } } } -- cgit v1.2.3