Include build number in output of release builds

This commit is contained in:
Sam Whited 2014-10-26 10:22:37 -04:00
parent 4024136b1c
commit ef25720f0f
1 changed files with 12 additions and 0 deletions

View File

@ -84,6 +84,18 @@ android {
runProguard true runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
} }
applicationVariants.all { variant ->
def fileName = variant.packageApplication.outputFile.name.replace(".apk",
"-" + defaultConfig.versionName + ".apk")
variant.packageApplication.outputFile = new
File(variant.packageApplication.outputFile.parent, fileName)
if (variant.zipAlign) {
if (variant.name.equals('release')) {
variant.outputFile = new File(variant.outputFile.parent,
rootProject.name + "-" + defaultConfig.versionName + ".apk")
}
}
}
} }
lintOptions { lintOptions {