From ef25720f0fda2e46e82e1e4b66607c42afe91170 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Sun, 26 Oct 2014 10:22:37 -0400 Subject: [PATCH] Include build number in output of release builds --- build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.gradle b/build.gradle index 9139a6ae4..68b1b2f2f 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 {