Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Create sane APK names from gradle builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mashbridge committed Jul 22, 2015
1 parent b71fa87 commit cb0d394
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply from: '../variants.gradle'

android {
compileSdkVersion 22
Expand All @@ -9,8 +10,9 @@ android {
minSdkVersion 22
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionName "1.0.0"
}

buildTypes {
release {
minifyEnabled false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Name and version the APK variants.

android.applicationVariants.all { variant ->
def outName
if (project.hasProperty("applicationName")) {
outName = applicationName
} else {
outName = parent.name
}

variant.outputs.each { output ->
def apkName
if (output.zipAlign) {
apkName = "${outName}-${output.baseName}-${variant.versionName}.apk"
} else {
apkName = "${outName}-${output.baseName}-${variant.versionName}-unaligned.apk"
}
output.outputFile = new File(output.outputFile.parent, apkName)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply from: '../variants.gradle'

android {
compileSdkVersion 22
Expand Down
20 changes: 20 additions & 0 deletions tools/eddystone-validator/EddystoneValidator/variants.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Name and version the APK variants.

android.applicationVariants.all { variant ->
def outName
if (project.hasProperty("applicationName")) {
outName = applicationName
} else {
outName = parent.name
}

variant.outputs.each { output ->
def apkName
if (output.zipAlign) {
apkName = "${outName}-${output.baseName}-${variant.versionName}.apk"
} else {
apkName = "${outName}-${output.baseName}-${variant.versionName}-unaligned.apk"
}
output.outputFile = new File(output.outputFile.parent, apkName)
}
}

0 comments on commit cb0d394

Please sign in to comment.