Last active
May 13, 2019 18:25
-
-
Save aquaflamingo/23e4ae728ef3fd3f924440c059a4b6e1 to your computer and use it in GitHub Desktop.
Gradle task to archive APKs once built through android studio by running ./gradlew deployApks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Thanks to @Manoj.Madanmohan for letting me know this can be extended for every build by applying this additional code