aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2014-10-26 10:22:37 -0400
committerSam Whited <sam@samwhited.com>2014-10-26 10:22:37 -0400
commitef25720f0fda2e46e82e1e4b66607c42afe91170 (patch)
tree73f423fb07c2df7b7a95c43baedc25b829b15f58 /build.gradle
parent4024136b1c6ac55b68dcce0cc6c4c4a9a9e59143 (diff)
Include build number in output of release builds
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle12
1 files changed, 12 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index 9139a6ae..68b1b2f2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -84,6 +84,18 @@ android {
runProguard true
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 {