From 1b7c3f5631e45255f88408c8beaf7f8ac2f32097 Mon Sep 17 00:00:00 2001 From: mcarare <48995920+mcarare@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:30:11 +0300 Subject: [PATCH] Bug 1849833 - Replace all with configureEach. This avoids unnecessary configuration. --- app/build.gradle | 6 +++--- benchmark/build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b63e310f4..9a59bf57d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -254,7 +254,7 @@ android { namespace 'org.mozilla.fenix' } -android.applicationVariants.all { variant -> +android.applicationVariants.configureEach { variant -> // ------------------------------------------------------------------------------------------------- // Generate version codes for builds @@ -709,7 +709,7 @@ if (project.hasProperty("coverage")) { toolVersion = Versions.jacoco } - android.applicationVariants.all { variant -> + android.applicationVariants.configureEach { variant -> tasks.register("jacoco${variant.name.capitalize()}TestReport", JacocoReport) { dependsOn "test${variant.name.capitalize()}UnitTest" @@ -847,7 +847,7 @@ if (gradle.hasProperty('localProperties.autoPublish.glean.dir')) { apply from: "../${gleanSrcDir}/build-scripts/substitute-local-glean.gradle" } -android.applicationVariants.all { variant -> +android.applicationVariants.configureEach { variant -> tasks.register("apkSize${variant.name.capitalize()}", ApkSizeTask) { variantName = variant.name apks = variant.outputs.collect { output -> output.outputFile.name } diff --git a/benchmark/build.gradle b/benchmark/build.gradle index 509794ab6..e917c0bdd 100644 --- a/benchmark/build.gradle +++ b/benchmark/build.gradle @@ -46,7 +46,7 @@ android { * and that's applied to the app module. Since there are no other uses of the glean plugin in the * benchmark module, we do this manually here. */ -configurations.all { +configurations.configureEach { resolutionStrategy.capabilitiesResolution.withCapability("org.mozilla.telemetry:glean-native") { def toBeSelected = candidates.find { it.id instanceof ModuleComponentIdentifier && it.id.module.contains('geckoview') } if (toBeSelected != null) {