Successfully overwrote file: /home/Messier82/projects/service-book/app/build.gradle.kts. Here is the updated code: ... vectorDrawables { useSupportLibrary = true } } testBuildType = "debug" signingConfigs { create("release") { storeFile = rootProject.file("app/${keystoreProperties["storeFile"] ?: System.getenv("KEYSTORE_FILE") ?: ""}") storePassword = (keystoreProperties["storePassword"] ?: System.getenv("KEYSTORE_PASSWORD") ?: "").toString() ... !System.getenv("KEYSTORE_FILE").isNullOrEmpty() ) { signingConfig = signingConfigs.getByName("release") } isMinifyEnabled = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", ) val dsnRelease = ... else -> null } if (deviceDirName != null) { // Set the host-side directory where GMD will pull files from. getAdditionalTestOutputDir().set( layout.buildDirectory.dir("outputs/managed_device_android_test_additional_output/debug/$deviceDirName"), ) } // AGP does not provide a public DSL to set per-ManagedVirtualDevice instrumentation arguments. // We use reflection to reach into the internal testData property and its instrumentationRunnerArguments map. ... val map = mutableMapOf() when { taskName.contains("phonePixel6api34", ignoreCase = true) -> { map["package"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/screenshots" map["hideDeveloperPanel"] = "true" } taskName.contains("tablet7Nexus7api34", ignoreCase = true) -> { map["package"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/screenshots" map["hideDeveloperPanel"] = "true" } taskName.contains("tablet10PixelTabletApi34", ignoreCase = true) -> { map["package"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/screenshots" map["hideDeveloperPanel"] = "true" } taskName.contains("pixel2api33", ignoreCase = true) -> { map["notPackage"] = screenshotTestPackage map["additionalTestOutputDir"] = "/sdcard/test-outputs/smoke" } ... tasks.register("generateGmdCoverage") { group = "Verification" description = "Runs GMD tests and copies the coverage file to the baseline directory." dependsOn("pixel2api33DebugAndroidTest") from(layout.buildDirectory.dir("outputs/managed_device_code_coverage/debug/pixel2api33")) { include("coverage.ec") } into(layout.projectDirectory.dir("coverage-baselines")) rename { "gmd_smoke.ec" } ... "screen_06_paywall_dialog.png", ) val storeScreenshotsRoot = rootProject.layout.projectDirectory.dir("distribution/store-assets/screenshots") val storeAdditionalOutputRoots = listOf( layout.buildDirectory.dir("outputs/managed_device_android_test_additional_output/debug"), ) fun registerStoreScreenshotCopy( taskPrefix: String, deviceTaskName: String, ... } val copyPhoneStoreScreenshots = registerStoreScreenshotCopy( taskPrefix = "Phone", deviceTaskName = "phonePixel6api34DebugAndroidTest", outputDirectory = "phone", ) val copyTablet7StoreScreenshots = registerStoreScreenshotCopy( taskPrefix = "Tablet7", deviceTaskName = "tablet7Nexus7api34DebugAndroidTest", outputDirectory = "tablet-7", previousCopyTask = copyPhoneStoreScreenshots, ) val copyTablet10StoreScreenshots = registerStoreScreenshotCopy( taskPrefix = "Tablet10", deviceTaskName = "tablet10PixelTabletApi34DebugAndroidTest", outputDirectory = "tablet-10", previousCopyTask = copyTablet7StoreScreenshots, ) tasks.register("generateStoreScreenshots") { ... tasks.register("verifyWithCoverage") { group = "Verification" description = "Runs JVM unit tests and generates a combined coverage report using JaCoCo with the static GMD baseline." dependsOn("testDebugUnitTest") reports { xml.required.set(true) html.required.set(true) } ... // ComposableSingletons are compiler-generated classes for @Composable lambdas // that are often static and difficult to cover in unit tests, creating noise. "**/*ComposableSingletons*.*", ) val debugTree = fileTree(layout.buildDirectory.dir("tmp/kotlin-classes/debug")) { exclude(classFilter) } val javaTree = fileTree(layout.buildDirectory.dir("intermediates/javac/debug/classes")) { exclude(classFilter) } classDirectories.setFrom(files(debugTree, javaTree)) sourceDirectories.setFrom( files( "src/main/java", "src/main/kotlin", "src/debug/java", "src/debug/kotlin", ), ) // Collect all execution data from both unit tests and instrumented tests // Using specific roots to avoid implicit dependency issues with other tasks' outputs in the build folder ...