
okreplay.ClearTapesTask.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugin Show documentation
Show all versions of gradle-plugin Show documentation
OkReplay Gradle plugin for pushing and pulling tape files to/from device
The newest version!
package okreplay
import okreplay.OkReplayPlugin.Companion.REMOTE_TAPES_DIR
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
abstract class ClearTapesTask : DefaultTask(), TapeTask {
init {
description = "Remove OkReplay tapes from the device"
group = "OkReplay"
}
@Suppress("unused")
@TaskAction
internal fun clearTapes() {
val deviceBridge = DeviceBridgeProvider.get(adbPath.get(), adbTimeout.get(), logger)
deviceBridge.devices().forEach { device ->
val externalStorage = device.externalStorageDir()
try {
device.deleteDirectory("$externalStorage/$REMOTE_TAPES_DIR/${packageName.get()}/")
} catch (e: RuntimeException) {
logger.error("ADB Command failed: ${e.message}")
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy