代码优化
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.test)
|
||||
alias(libs.plugins.baselineprofile)
|
||||
@@ -20,7 +18,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 28
|
||||
targetSdk = 36
|
||||
targetSdk = 37
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -31,24 +29,13 @@ android {
|
||||
productFlavors {
|
||||
create("app") { dimension = "mode" }
|
||||
}
|
||||
|
||||
// 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>("pixel6Api34") {
|
||||
device = "Pixel 6"
|
||||
apiLevel = 34
|
||||
systemImageSource = "google"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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 += "pixel6Api34"
|
||||
useConnectedDevices = false
|
||||
// managedDevices += "pixel6Api34"
|
||||
useConnectedDevices = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -59,6 +46,11 @@ dependencies {
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
beforeVariants { v ->
|
||||
if (v.buildType == "noR8" || v.buildType == "debug") {
|
||||
v.enable = false
|
||||
}
|
||||
}
|
||||
onVariants { v ->
|
||||
val artifactsLoader = v.artifacts.getBuiltArtifactsLoader()
|
||||
v.instrumentationRunnerArguments.put(
|
||||
|
||||
Reference in New Issue
Block a user