54 lines
1.3 KiB
Kotlin
54 lines
1.3 KiB
Kotlin
import com.android.build.api.dsl.ManagedVirtualDevice
|
|
|
|
kotlin {
|
|
jvmToolchain(21)
|
|
}
|
|
plugins {
|
|
alias(libs.plugins.android.test)
|
|
alias(libs.plugins.kotlin.android)
|
|
}
|
|
|
|
android {
|
|
namespace = "cc.n0th1ng.benchmark"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
minSdk = 24
|
|
targetSdk = 36
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
testInstrumentationRunnerArguments["androidx.compose.ui.test.tagsAsResourceId"] = "true"
|
|
}
|
|
|
|
testOptions.managedDevices.devices {
|
|
create<ManagedVirtualDevice>("pixel6Api31") {
|
|
device = "Pixel 6"
|
|
apiLevel = 31
|
|
systemImageSource = "aosp"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
create("benchmark") {
|
|
isDebuggable = true
|
|
signingConfig = getByName("debug").signingConfig
|
|
matchingFallbacks += listOf("release")
|
|
}
|
|
}
|
|
|
|
targetProjectPath = ":app"
|
|
experimentalProperties["android.experimental.self-instrumenting"] = true
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.junit)
|
|
implementation(libs.androidx.espresso.core)
|
|
implementation(libs.androidx.uiautomator)
|
|
implementation(libs.androidx.benchmark.macro.junit4)
|
|
}
|
|
|
|
androidComponents {
|
|
beforeVariants(selector().all()) {
|
|
it.enable = it.buildType == "benchmark"
|
|
}
|
|
} |