forked from LemmyNet/jerboa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
83 lines (70 loc) · 2.46 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
83 lines (70 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import com.android.build.api.dsl.ManagedVirtualDevice
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id("com.android.test")
id("androidx.baselineprofile")
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.fromTarget("17")
jvmDefault.set(JvmDefaultMode.ENABLE)
}
}
android {
namespace = "com.jerboa.benchmarks"
compileSdk = 36
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
defaultConfig {
testInstrumentationRunnerArguments += mapOf("suppressErrors" to "EMULATOR")
minSdk = 28
targetSdk = 36
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// The :app module declares a "version" flavor dimension (fdroid/gplay).
// The test module must pick one so Gradle can resolve the :app variant.
missingDimensionStrategy("version", "fdroid")
}
targetProjectPath = ":app"
// This code creates the gradle managed device used to generate baseline profiles.
// To use GMD please invoke generation through the command line:
// ./gradlew :app:generateBaselineProfile
testOptions.managedDevices.allDevices {
create<ManagedVirtualDevice>("pixel6Api36") {
device = "Pixel 6"
apiLevel = 36
systemImageSource = "google"
}
}
buildTypes {
register("benchmark") {
isDebuggable = false
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
}
}
}
// This is the configuration block for the Baseline Profile plugin.
// You can specify to run the generators on a managed devices or connected devices.
baselineProfile {
managedDevices += "pixel6Api36"
enableEmulatorDisplay = true
useConnectedDevices = false
}
dependencies {
implementation("androidx.test.ext:junit:1.3.0")
implementation("androidx.test.espresso:espresso-core:3.7.0")
implementation("androidx.test.uiautomator:uiautomator:2.4.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.4.1")
}
androidComponents {
onVariants { v ->
val artifactsLoader = v.artifacts.getBuiltArtifactsLoader()
v.instrumentationRunnerArguments.put(
"targetAppId",
v.testedApks.map { artifactsLoader.load(it)?.applicationId ?: "com.jerboa" }
)
}
}