Android / Gradle - copy apk to folder for backup after assemble. Should be run manually ( $./gradlew assemble backupApks
)
// Copy assembled apks into TEST_BACKUP (must run manually)
task backupApks(type: Copy) {
if (project.hasProperty("TEST_BACKUP")) {
println "Backing up apks..."
from('build/outputs/apk/')
include '*prod-release.apk'
include '*prod-staging.apk'
into "${project.getProperty("TEST_BACKUP")}"
} else {
println "No backup done because TEST_BACKUP gradle variable is not defined."
}
}