Skip to content

Instantly share code, notes, and snippets.

@danielgomezrico
Last active May 30, 2017 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danielgomezrico/bfb2fb5732d760e766f5 to your computer and use it in GitHub Desktop.
Save danielgomezrico/bfb2fb5732d760e766f5 to your computer and use it in GitHub Desktop.
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."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment