2022-12-09 17:13:34 +00:00
|
|
|
import com.android.build.api.dsl.ManagedVirtualDevice
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id 'com.android.test'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace 'com.dolphin.benchmark'
|
|
|
|
compileSdk 33
|
|
|
|
|
|
|
|
compileOptions {
|
2023-01-14 23:35:32 +00:00
|
|
|
sourceCompatibility = "11"
|
|
|
|
targetCompatibility = "11"
|
2022-12-09 17:13:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
2023-01-14 23:35:32 +00:00
|
|
|
jvmTarget = "11"
|
2022-12-09 17:13:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk 23
|
|
|
|
targetSdk 33
|
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
|
|
|
testOptions {
|
|
|
|
managedDevices {
|
|
|
|
devices {
|
2023-01-06 23:33:51 +00:00
|
|
|
pixel6Api31 (ManagedVirtualDevice) {
|
|
|
|
device = "Pixel 6"
|
2022-12-09 17:13:34 +00:00
|
|
|
apiLevel = 31
|
|
|
|
systemImageSource = "aosp"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
|
|
|
benchmark {
|
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
matchingFallbacks = ['release']
|
|
|
|
debuggable true
|
|
|
|
applicationIdSuffix ".benchmark"
|
|
|
|
versionNameSuffix '-benchmark'
|
|
|
|
proguardFiles getDefaultProguardFile(
|
|
|
|
'proguard-android-optimize.txt'),
|
|
|
|
'proguard-rules.pro'
|
|
|
|
minifyEnabled true
|
|
|
|
shrinkResources true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
targetProjectPath = ":app"
|
|
|
|
experimentalProperties["android.experimental.self-instrumenting"] = true
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-01-14 23:41:18 +00:00
|
|
|
implementation 'androidx.test.ext:junit:1.1.5'
|
|
|
|
implementation 'androidx.test.espresso:espresso-core:3.5.1'
|
2022-12-09 17:13:34 +00:00
|
|
|
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
|
|
|
implementation 'androidx.benchmark:benchmark-macro-junit4:1.1.1'
|
|
|
|
}
|
|
|
|
|
|
|
|
androidComponents {
|
|
|
|
beforeVariants(selector().all()) {
|
|
|
|
enabled = buildType == "benchmark"
|
|
|
|
}
|
|
|
|
}
|