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

Commit cb0d394

Browse files
committed
Create sane APK names from gradle builds
1 parent b71fa87 commit cb0d394

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

eddystone-uid/tools/txeddystone-uid/TxEddystone-UID/app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.application'
2+
apply from: '../variants.gradle'
23

34
android {
45
compileSdkVersion 22
@@ -9,8 +10,9 @@ android {
910
minSdkVersion 22
1011
targetSdkVersion 22
1112
versionCode 1
12-
versionName "1.0"
13+
versionName "1.0.0"
1314
}
15+
1416
buildTypes {
1517
release {
1618
minifyEnabled false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Name and version the APK variants.
2+
3+
android.applicationVariants.all { variant ->
4+
def outName
5+
if (project.hasProperty("applicationName")) {
6+
outName = applicationName
7+
} else {
8+
outName = parent.name
9+
}
10+
11+
variant.outputs.each { output ->
12+
def apkName
13+
if (output.zipAlign) {
14+
apkName = "${outName}-${output.baseName}-${variant.versionName}.apk"
15+
} else {
16+
apkName = "${outName}-${output.baseName}-${variant.versionName}-unaligned.apk"
17+
}
18+
output.outputFile = new File(output.outputFile.parent, apkName)
19+
}
20+
}

tools/eddystone-validator/EddystoneValidator/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.application'
2+
apply from: '../variants.gradle'
23

34
android {
45
compileSdkVersion 22
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Name and version the APK variants.
2+
3+
android.applicationVariants.all { variant ->
4+
def outName
5+
if (project.hasProperty("applicationName")) {
6+
outName = applicationName
7+
} else {
8+
outName = parent.name
9+
}
10+
11+
variant.outputs.each { output ->
12+
def apkName
13+
if (output.zipAlign) {
14+
apkName = "${outName}-${output.baseName}-${variant.versionName}.apk"
15+
} else {
16+
apkName = "${outName}-${output.baseName}-${variant.versionName}-unaligned.apk"
17+
}
18+
output.outputFile = new File(output.outputFile.parent, apkName)
19+
}
20+
}

0 commit comments

Comments
 (0)