Successfully modified file: /home/Messier82/projects/service-book/app/build.gradle.kts (1 replacements). Here is the updated code: ... deviceTaskName: String, outputDirectory: String, previousCopyTask: TaskProvider? = null, ): TaskProvider { tasks.matching { it.name == deviceTaskName }.configureEach { // We inject a doFirst block to wipe the additional output root before every run. // This ensures a clean state for the subsequent copy task, but has the side-effect // of clearing previous outputs even when running a single device test for debugging. doFirst { delete(storeAdditionalOutputRoots) } } ...