2022-10-04 21:22:55 +08:00
|
|
|
plugins {
|
|
|
|
id("com.android.test")
|
|
|
|
kotlin("android")
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace = "tachiyomi.macrobenchmark"
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2023-07-30 10:48:56 +08:00
|
|
|
testInstrumentationRunnerArguments["androidx.benchmark.enabledRules"] = "BaselineProfile"
|
2022-10-04 21:22:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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/CI testing.
|
|
|
|
create("benchmark") {
|
|
|
|
isDebuggable = true
|
|
|
|
signingConfig = getByName("debug").signingConfig
|
2023-07-30 10:48:56 +08:00
|
|
|
matchingFallbacks.add("release")
|
2022-10-04 21:22:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
targetProjectPath = ":app"
|
|
|
|
experimentalProperties["android.experimental.self-instrumenting"] = true
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(androidx.test.ext)
|
|
|
|
implementation(androidx.test.espresso.core)
|
|
|
|
implementation(androidx.test.uiautomator)
|
|
|
|
implementation(androidx.benchmark.macro)
|
|
|
|
}
|
|
|
|
|
|
|
|
androidComponents {
|
|
|
|
beforeVariants(selector().all()) {
|
|
|
|
it.enable = it.buildType == "benchmark"
|
|
|
|
}
|
|
|
|
}
|