diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2022-06-04 15:24:46 +0530 |
|---|---|---|
| committer | Harsh Shandilya <me@msfjarvis.dev> | 2022-06-05 03:58:15 +0530 |
| commit | 504c8b466c44b4a8591976ed5d8662f7c83f67fc (patch) | |
| tree | 3ff0a7d13736da9a9103617a196e4562287705ea /build-logic/android-plugins/src/main/kotlin/flavors | |
| parent | fee75104962548404ed2ffc4f6ef9c397b86683f (diff) | |
| download | HardenedPass-504c8b466c44b4a8591976ed5d8662f7c83f67fc.tar.gz HardenedPass-504c8b466c44b4a8591976ed5d8662f7c83f67fc.zip | |
android-plugins: convert to full plugins
Diffstat (limited to 'build-logic/android-plugins/src/main/kotlin/flavors')
| -rw-r--r-- | build-logic/android-plugins/src/main/kotlin/flavors/ProductFlavors.kt | 15 | ||||
| -rw-r--r-- | build-logic/android-plugins/src/main/kotlin/flavors/SlimTests.kt | 44 |
2 files changed, 0 insertions, 59 deletions
diff --git a/build-logic/android-plugins/src/main/kotlin/flavors/ProductFlavors.kt b/build-logic/android-plugins/src/main/kotlin/flavors/ProductFlavors.kt deleted file mode 100644 index a3185f65..00000000 --- a/build-logic/android-plugins/src/main/kotlin/flavors/ProductFlavors.kt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -package flavors - -object FlavorDimensions { - const val FREE = "free" -} - -object ProductFlavors { - const val FREE = "free" - const val NON_FREE = "nonFree" -} diff --git a/build-logic/android-plugins/src/main/kotlin/flavors/SlimTests.kt b/build-logic/android-plugins/src/main/kotlin/flavors/SlimTests.kt deleted file mode 100644 index 2b0cb8eb..00000000 --- a/build-logic/android-plugins/src/main/kotlin/flavors/SlimTests.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -package flavors - -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).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" |
