mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
refactor(build): migrate to Baseline Profile Gradle Plugin
This commit is contained in:
parent
d9ab751dbd
commit
3bb5dfffbe
12 changed files with 19655 additions and 25322 deletions
|
@ -10,13 +10,14 @@ import com.android.build.api.dsl.ManagedVirtualDevice
|
|||
|
||||
plugins {
|
||||
alias(libs.plugins.android.test)
|
||||
id("dev.msfjarvis.claw.android-common")
|
||||
id("dev.msfjarvis.claw.kotlin-android")
|
||||
alias(libs.plugins.baselineprofile)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "dev.msfjarvis.claw.benchmark"
|
||||
|
||||
compileSdk = 34
|
||||
defaultConfig {
|
||||
minSdk = 28
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
@ -30,23 +31,23 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
testOptions {
|
||||
managedDevices {
|
||||
devices {
|
||||
create<ManagedVirtualDevice>("api31") {
|
||||
device = "Pixel 6"
|
||||
apiLevel = 31
|
||||
systemImageSource = "aosp"
|
||||
}
|
||||
}
|
||||
testOptions.managedDevices.devices {
|
||||
create<ManagedVirtualDevice>("api31") {
|
||||
device = "Pixel 6"
|
||||
apiLevel = 31
|
||||
systemImageSource = "aosp"
|
||||
}
|
||||
}
|
||||
|
||||
targetProjectPath = ":android"
|
||||
experimentalProperties["android.experimental.self-instrumenting"] = true
|
||||
experimentalProperties["android.experimental.r8.dex-startup-optimization"] = true
|
||||
}
|
||||
|
||||
androidComponents { beforeVariants(selector().all()) { it.enable = it.buildType == "benchmark" } }
|
||||
baselineProfile {
|
||||
managedDevices += "api31"
|
||||
useConnectedDevices = false
|
||||
enableEmulatorDisplay = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.benchmark.macro.junit4)
|
||||
|
|
|
@ -28,6 +28,7 @@ class BaselineProfileGenerator {
|
|||
baselineProfileRule.collect(
|
||||
packageName = PACKAGE_NAME,
|
||||
maxIterations = 8,
|
||||
includeInStartupProfile = true,
|
||||
) {
|
||||
device.executeShellCommand("pm clear $PACKAGE_NAME")
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import androidx.test.uiautomator.UiDevice
|
|||
import androidx.test.uiautomator.UiObject2
|
||||
import androidx.test.uiautomator.Until
|
||||
|
||||
const val PACKAGE_NAME = "dev.msfjarvis.claw.android.benchmark"
|
||||
const val PACKAGE_NAME = "dev.msfjarvis.claw.android"
|
||||
private const val AWAIT_TIMEOUT = 10_000L
|
||||
private const val SAVE_BUTTON_ID = "save_button"
|
||||
private const val NAV_ID_HOTTEST = "HOTTEST"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue