diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2021-11-29 02:38:06 +0530 |
|---|---|---|
| committer | Harsh Shandilya <me@msfjarvis.dev> | 2021-12-03 12:59:58 +0530 |
| commit | 81e9926b723e6f1214bae43cf0d177e81b4e821e (patch) | |
| tree | 4c54972fe1688ff8853f70537fe6c98fac1d545d /buildSrc/src/main/java/SlimTests.kt | |
| parent | a80020477f4717f04d39593dd0c558182ec369a4 (diff) | |
| download | HardenedPass-81e9926b723e6f1214bae43cf0d177e81b4e821e.tar.gz HardenedPass-81e9926b723e6f1214bae43cf0d177e81b4e821e.zip | |
buildSrc: remove
Diffstat (limited to 'buildSrc/src/main/java/SlimTests.kt')
| -rw-r--r-- | buildSrc/src/main/java/SlimTests.kt | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/buildSrc/src/main/java/SlimTests.kt b/buildSrc/src/main/java/SlimTests.kt deleted file mode 100644 index 4057032b..00000000 --- a/buildSrc/src/main/java/SlimTests.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -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 - -/** - * When the "slimTests" project property is provided, disable the unit test tasks on `release` build - * type and `nonFree` product flavor to avoid running the same tests repeatedly in different build - * variants. - * - * Examples: `./gradlew test -PslimTests` will run unit tests for `nonFreeDebug` and `debug` build - * variants in Android App and Library projects, and all tests in JVM projects. - */ -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 { - beforeVariants(selector().withBuildType(BuildType.RELEASE.name)) { - it.enableUnitTest = false - it.enableAndroidTest = false - } - } - - // disable unit test tasks on the release build type and free flavor for Android Application - // projects. - extensions.findByType<ApplicationAndroidComponentsExtension>()?.run { - beforeVariants(selector().withBuildType(BuildType.RELEASE.name)) { it.enableUnitTest = false } - beforeVariants(selector().withFlavor(FlavorDimensions.FREE to ProductFlavors.NON_FREE)) { - it.enableUnitTest = false - it.enableAndroidTest = false - } - } - } -} - -private const val SLIM_TESTS_PROPERTY = "slimTests" |
