Skip to content

Instantly share code, notes, and snippets.

@shekibobo
Created April 22, 2019 15:20
Show Gist options
  • Save shekibobo/447b34a218b322e8ce4904c8805b2bc2 to your computer and use it in GitHub Desktop.
Save shekibobo/447b34a218b322e8ce4904c8805b2bc2 to your computer and use it in GitHub Desktop.
Assemble all distribution apks with filenames and copy the debug and release versions of each build flavor to an `apks` directory.
task copyApks(type: Copy) {
["debug", "release"].each { type ->
from "build/outputs/apk/${type}/"
}
into "apks/all-${AppVersion.fullVersionCode}-${gitSha}"
include '**/*.apk'
rename { String filename ->
filename.replace("app-", "").replace(".apk", "-${AppVersion.fullVersionCode}-${gitSha}.apk")
}
}
task assembleDistribution(type: GradleBuild) {
tasks = ['clean', 'assembleDebug', 'assembleRelease']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment