Created
April 16, 2018 22:14
-
-
Save bensandee/8d31a0effa0861b167e0af30575d87c1 to your computer and use it in GitHub Desktop.
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 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