Bug 1881238 - Add logs to SettingsSubMenuHttpsOnlyModeRobot
[gecko.git] / mobile / android / fenix / benchmark / build.gradle
blob20825ec4ea250514c4588835af21ebb48daf1db2
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
7 plugins {
8     id 'com.android.test'
9     id 'org.jetbrains.kotlin.android'
12 android {
13     namespace 'org.mozilla.fenix.benchmark'
14     compileSdk config.compileSdkVersion
16     compileOptions {
17         sourceCompatibility = JavaVersion.VERSION_17
18         targetCompatibility = JavaVersion.VERSION_17
19     }
21     kotlinOptions {
22         jvmTarget = "17"
23     }
25     defaultConfig {
26         minSdk 23
27         targetSdk config.targetSdkVersion
28         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29     }
31     buildTypes {
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.
35         benchmark {
36             debuggable = true
37             signingConfig signingConfigs.debug
38             matchingFallbacks = ["release"]
39         }
40     }
42     targetProjectPath = ":app"
43     experimentalProperties["android.experimental.self-instrumenting"] = true
45     testOptions {
46         managedDevices {
47             devices {
48                 pixel6Api34(ManagedVirtualDevice) {
49                     device = "Pixel 6"
50                     apiLevel = 34
51                     systemImageSource = "google"
52                 }
53             }
54         }
55     }
58 /**
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.
62  */
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) {
67             select(toBeSelected)
68         }
69         because 'use GeckoView Glean instead of standalone Glean'
70     }
73 dependencies {
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
80 androidComponents {
81     beforeVariants(selector().all()) {
82         enabled = buildType == "benchmark"
83     }