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
def publish = project.tasks.create("copyReleaseApkToCustomDir") | |
publish.description "Copies release apk to custom directory" | |
android.applicationVariants.all { variant -> | |
if (variant.buildType.name.equals("release")) { | |
variant.outputs.each { output -> | |
if ( output.outputFile != null && output.outputFile.name.endsWith('.apk')) { | |
def task = project.tasks.create("copyAndRename${variant.name}Apk", Copy) | |
def outputFile = output.outputFile | |
println "Creating " + rootProject.name + "-${versionName}.apk" + " from " + project.name + "-${variant.name}.apk" |
OlderNewer