Skip to content

Instantly share code, notes, and snippets.

@sunwicked
Forked from aquaflamingo/deployApks.groovy
Created April 24, 2017 18:01
Show Gist options
  • Save sunwicked/cd18060f740222838db8428520aad31a to your computer and use it in GitHub Desktop.
Save sunwicked/cd18060f740222838db8428520aad31a to your computer and use it in GitHub Desktop.
Gradle task to archive APKs once built through android studio by running ./gradlew deployApks
task deployApks(type:Copy) {
description = "Copies APKs and Proguard mappings to the deploy directory"
def appName = "posture";
def versionDir = android.defaultConfig.versionName+"_"+android.defaultConfig.versionCode;
println("Copies APK and Proguard to " + versionDir)
from 'build/outputs/mapping/release/'
include '**/mapping.txt'
into '../.admin/deploy/' + versionDir
rename ('mapping.txt', "${versionDir}-mapping.txt")
from ('.') {
exclude '**/build', '**/src'
}
include '*.apk'
into '../.admin/deploy/' + versionDir
rename ('app-release.apk', "${appName}-${versionDir}.apk")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment