build.gradle.kts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. plugins {
  2. id("com.android.test")
  3. kotlin("android")
  4. }
  5. android {
  6. namespace = "tachiyomi.macrobenchmark"
  7. compileSdk = AndroidConfig.compileSdk
  8. compileOptions {
  9. sourceCompatibility = JavaVersion.VERSION_1_8
  10. targetCompatibility = JavaVersion.VERSION_1_8
  11. }
  12. kotlinOptions {
  13. jvmTarget = JavaVersion.VERSION_1_8.toString()
  14. }
  15. defaultConfig {
  16. minSdk = AndroidConfig.minSdk
  17. targetSdk = AndroidConfig.targetSdk
  18. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  19. }
  20. buildTypes {
  21. // This benchmark buildType is used for benchmarking, and should function like your
  22. // release build (for example, with minification on). It's signed with a debug key
  23. // for easy local/CI testing.
  24. create("benchmark") {
  25. isDebuggable = true
  26. signingConfig = getByName("debug").signingConfig
  27. matchingFallbacks += listOf("release")
  28. }
  29. }
  30. targetProjectPath = ":app"
  31. experimentalProperties["android.experimental.self-instrumenting"] = true
  32. }
  33. dependencies {
  34. implementation(androidx.test.ext)
  35. implementation(androidx.test.espresso.core)
  36. implementation(androidx.test.uiautomator)
  37. implementation(androidx.benchmark.macro)
  38. }
  39. androidComponents {
  40. beforeVariants(selector().all()) {
  41. it.enable = it.buildType == "benchmark"
  42. }
  43. }