diff options
author | Sam Whited <sam@samwhited.com> | 2014-10-26 10:22:37 -0400 |
---|---|---|
committer | Sam Whited <sam@samwhited.com> | 2014-10-26 10:22:37 -0400 |
commit | ef25720f0fda2e46e82e1e4b66607c42afe91170 (patch) | |
tree | 73f423fb07c2df7b7a95c43baedc25b829b15f58 | |
parent | 4024136b1c6ac55b68dcce0cc6c4c4a9a9e59143 (diff) |
Include build number in output of release builds
-rw-r--r-- | build.gradle | 12 |
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 { |