From b8c98487d78035b10ecac34044ee07691b644665 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 25 Feb 2016 21:20:17 -0800 Subject: [PATCH] use sdk 22 for gradle builds too; rename apk file based on git revision number --- xwords4/android/XWords4/app/build.gradle | 11 ++++++++++- xwords4/android/XWords4/build.gradle | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/app/build.gradle b/xwords4/android/XWords4/app/build.gradle index 0cde8aa58..9268abc8f 100644 --- a/xwords4/android/XWords4/app/build.gradle +++ b/xwords4/android/XWords4/app/build.gradle @@ -19,7 +19,7 @@ android { buildToolsVersion "22.0.1" defaultConfig { minSdkVersion 7 - targetSdkVersion 14 + targetSdkVersion 22 } // Rename all output artifacts to include version information @@ -103,6 +103,15 @@ android { lintOptions { abortOnError false } + + def gitrev = "git describe --tags".execute().text + applicationVariants.all { variant -> + variant.outputs.each { output -> + output.outputFile = + new File(output.outputFile.parent, + output.outputFile.name.replace(".apk", "-${gitrev}.apk")) + } + } } dependencies { diff --git a/xwords4/android/XWords4/build.gradle b/xwords4/android/XWords4/build.gradle index a1590caf8..3157dd5eb 100644 --- a/xwords4/android/XWords4/build.gradle +++ b/xwords4/android/XWords4/build.gradle @@ -26,7 +26,7 @@ subprojects { afterEvaluate {project -> if (project.hasProperty("android")) { android { - compileSdkVersion 14 + compileSdkVersion 22 buildToolsVersion '22.0.1' } }