2023-02-16 10:39:38 +00: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/. */
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id 'com.android.test'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace 'org.mozilla.fenix.benchmark'
|
2023-06-13 19:42:00 +00:00
|
|
|
compileSdk config.compileSdkVersion
|
2023-02-16 10:39:38 +00:00
|
|
|
|
|
|
|
compileOptions {
|
2023-05-22 12:18:26 +00:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2023-02-16 10:39:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
2023-05-22 12:18:26 +00:00
|
|
|
jvmTarget = "17"
|
2023-02-16 10:39:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk 23
|
2023-06-13 19:42:00 +00:00
|
|
|
targetSdk config.targetSdkVersion
|
2023-02-16 10:39:38 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2023-08-23 11:30:11 +00:00
|
|
|
configurations.configureEach {
|
2023-02-16 10:39:38 +00:00
|
|
|
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 {
|
2023-06-21 16:19:45 +00:00
|
|
|
implementation ComponentsDependencies.androidx_test_junit
|
|
|
|
implementation ComponentsDependencies.androidx_espresso_core
|
|
|
|
implementation ComponentsDependencies.androidx_test_uiautomator
|
2023-02-16 10:39:38 +00:00
|
|
|
implementation FenixDependencies.androidx_benchmark_macro_junit4
|
|
|
|
}
|
|
|
|
|
|
|
|
androidComponents {
|
|
|
|
beforeVariants(selector().all()) {
|
|
|
|
enabled = buildType == "benchmark"
|
|
|
|
}
|
|
|
|
}
|