1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 import com.android.build.api.dsl.ManagedVirtualDevice
9 id 'org.jetbrains.kotlin.android'
13 namespace 'org.mozilla.fenix.benchmark'
14 compileSdk config.compileSdkVersion
17 sourceCompatibility = JavaVersion.VERSION_17
18 targetCompatibility = JavaVersion.VERSION_17
27 targetSdk config.targetSdkVersion
28 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
32 // This benchmark buildType is used for benchmarking, and should function like your
33 // release build (for example, with minification on). It's signed with a debug key
34 // for easy local testing.
37 signingConfig signingConfigs.debug
38 matchingFallbacks = ["release"]
42 targetProjectPath = ":app"
43 experimentalProperties["android.experimental.self-instrumenting"] = true
48 pixel6Api34(ManagedVirtualDevice) {
51 systemImageSource = "google"
59 * This fixes the dependency resolution issue with Glean Native. The glean gradle plugin does this
60 * and that's applied to the app module. Since there are no other uses of the glean plugin in the
61 * benchmark module, we do this manually here.
63 configurations.configureEach {
64 resolutionStrategy.capabilitiesResolution.withCapability("org.mozilla.telemetry:glean-native") {
65 def toBeSelected = candidates.find { it.id instanceof ModuleComponentIdentifier && it.id.module.contains('geckoview') }
66 if (toBeSelected != null) {
69 because 'use GeckoView Glean instead of standalone Glean'
74 implementation ComponentsDependencies.androidx_test_junit
75 implementation ComponentsDependencies.androidx_espresso_core
76 implementation ComponentsDependencies.androidx_test_uiautomator
77 implementation FenixDependencies.androidx_benchmark_macro_junit4
81 beforeVariants(selector().all()) {
82 enabled = buildType == "benchmark"