2023-11-28 09:06:47 +01:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2024-02-21 18:22:05 +01:00
|
|
|
import com.android.build.api.dsl.ManagedVirtualDevice
|
|
|
|
|
2023-11-28 09:06:47 +01:00
|
|
|
plugins {
|
|
|
|
id 'com.android.test'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace 'org.mozilla.fenix.benchmark'
|
|
|
|
compileSdk config.compileSdkVersion
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "17"
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk 23
|
|
|
|
targetSdk config.targetSdkVersion
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
// This benchmark buildType is used for benchmarking, and should function like your
|
|
|
|
// release build (for example, with minification on). It's signed with a debug key
|
|
|
|
// for easy local testing.
|
|
|
|
benchmark {
|
|
|
|
debuggable = true
|
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
matchingFallbacks = ["release"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
targetProjectPath = ":app"
|
|
|
|
experimentalProperties["android.experimental.self-instrumenting"] = true
|
2024-02-21 18:22:05 +01:00
|
|
|
|
|
|
|
testOptions {
|
|
|
|
managedDevices {
|
|
|
|
devices {
|
|
|
|
pixel6Api34(ManagedVirtualDevice) {
|
|
|
|
device = "Pixel 6"
|
|
|
|
apiLevel = 34
|
|
|
|
systemImageSource = "google"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-11-28 09:06:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This fixes the dependency resolution issue with Glean Native. The glean gradle plugin does this
|
|
|
|
* 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.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) {
|
|
|
|
select(toBeSelected)
|
|
|
|
}
|
|
|
|
because 'use GeckoView Glean instead of standalone Glean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation ComponentsDependencies.androidx_test_junit
|
|
|
|
implementation ComponentsDependencies.androidx_espresso_core
|
|
|
|
implementation ComponentsDependencies.androidx_test_uiautomator
|
|
|
|
implementation FenixDependencies.androidx_benchmark_macro_junit4
|
|
|
|
}
|
|
|
|
|
|
|
|
androidComponents {
|
|
|
|
beforeVariants(selector().all()) {
|
|
|
|
enabled = buildType == "benchmark"
|
|
|
|
}
|
|
|
|
}
|