Skip to content

Instantly share code, notes, and snippets.

@bensandee
Created April 16, 2018 22:14
Show Gist options
  • Save bensandee/8d31a0effa0861b167e0af30575d87c1 to your computer and use it in GitHub Desktop.
Save bensandee/8d31a0effa0861b167e0af30575d87c1 to your computer and use it in GitHub Desktop.
task archiveApks {
description = "Copies APKs and mapping files to the archive directory"
doLast {
def appName = "${rootProject.name}"
def versionDir = android.defaultConfig.versionName + "-" + android.defaultConfig.versionCode
copy {
from fileTree(dir: 'build/outputs/apk').files
into 'build/archive'
include '*.apk'
rename('app-(.*)\\.apk', "${appName}-${versionDir}-\$1.apk")
}
copy {
from 'build/outputs/mapping'
into 'build/archive/mapping'
}
}
}
archiveApks.mustRunAfter assemble
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment