use sdk 22 for gradle builds too; rename apk file based on git revision number

This commit is contained in:
Eric House 2016-02-25 21:20:17 -08:00
parent ca41a2390c
commit b8c98487d7
2 changed files with 11 additions and 2 deletions

View file

@ -19,7 +19,7 @@ android {
buildToolsVersion "22.0.1" buildToolsVersion "22.0.1"
defaultConfig { defaultConfig {
minSdkVersion 7 minSdkVersion 7
targetSdkVersion 14 targetSdkVersion 22
} }
// Rename all output artifacts to include version information // Rename all output artifacts to include version information
@ -103,6 +103,15 @@ android {
lintOptions { lintOptions {
abortOnError false 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 { dependencies {

View file

@ -26,7 +26,7 @@ subprojects {
afterEvaluate {project -> afterEvaluate {project ->
if (project.hasProperty("android")) { if (project.hasProperty("android")) {
android { android {
compileSdkVersion 14 compileSdkVersion 22
buildToolsVersion '22.0.1' buildToolsVersion '22.0.1'
} }
} }