Skip to content

Commit b7e5376

Browse files
committed
Build: Use gradle managed device via firebase test lab to generate bp
For more info see: https://firebase.google.com/docs/test-lab/android/ android-studio#gmd-testlab-plugin
1 parent 9367c2a commit b7e5376

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

baselineprofile/build.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
alias(libs.plugins.android.test)
55
alias(libs.plugins.kotlin.android)
66
alias(libs.plugins.androidx.baselineprofile)
7+
alias(libs.plugins.firebase.testlab)
78
}
89

910
android {
@@ -41,10 +42,28 @@ android {
4142
}
4243
}
4344

45+
def directory = "/storage/emulated/0/Android/media/${android.namespace}"
46+
firebaseTestLab {
47+
serviceAccountCredentials = rootProject.file(".configure-files/firebase.secrets.json")
48+
managedDevices {
49+
"ftlDeviceTokay35" {
50+
device = "tokay"
51+
apiLevel = 35
52+
}
53+
}
54+
testOptions {
55+
results {
56+
directoriesToPull.addAll(directory.toString())
57+
recordVideo = true
58+
performanceMetrics = true
59+
}
60+
}
61+
}
62+
4463
// This is the configuration block for the Baseline Profile plugin.
4564
// You can specify to run the generators on a managed devices or connected devices.
4665
baselineProfile {
47-
managedDevices += "pixel6Api34"
66+
managedDevices += "ftlDeviceTokay35"
4867
useConnectedDevices = false
4968
}
5069

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ dependency.analysis.android.ignored.variants=release,vanillaDebug,vanillaRelease
1616

1717
# https://issuetracker.google.com/issues/259523353#comment21
1818
android.experimental.enableTestFixturesKotlinSupport=true
19+
20+
# GMD + FTL: Enable custom device types - https://developer.android.com/studio/test/gradle-managed-devices#gmd-ftl
21+
android.experimental.testOptions.managedDevices.customDevice=true

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ facebook-flipper = '0.176.1'
5353
facebook-shimmer = '0.5.0'
5454
facebook-soloader = '0.10.4'
5555
fastlane-screengrab = '2.1.1'
56+
firebase-testlab = '0.0.1-alpha10'
5657
fladle = '0.17.5'
5758
glassfish-javax-annotation = "10.0-b28"
5859
google-autoService = "1.0-rc4"
@@ -283,6 +284,7 @@ androidx-navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", ver
283284
automattic-measure-builds = { id = "com.automattic.android.measure-builds", version.ref = "automattic-measure-builds" }
284285
dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependency-analysis" }
285286
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
287+
firebase-testlab = { id = "com.google.firebase.testlab", version.ref = "firebase-testlab" }
286288
fladle = { id = "com.osacky.fladle", version.ref = "fladle" }
287289
google-dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "google-dagger" }
288290
google-protobuf = { id = "com.google.protobuf", version.ref = "google-protobuf-plugin" }

0 commit comments

Comments
 (0)