Skip to content

Commit

Permalink
APK naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisdt committed Jan 2, 2019
1 parent fb317a5 commit 118d1e5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/build.gradle
@@ -1,5 +1,13 @@
import java.text.SimpleDateFormat

apply plugin: 'com.android.application'

static def buildTime() {
def df = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss")
df.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"))
return df.format(new Date())
}

android {
compileSdkVersion 27

Expand All @@ -17,6 +25,13 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

// rename final APK files
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "SDBViewer_${variant.versionName}_${buildTime()}_${variant.buildType.name}${variant.signingReady ? "" : "-unsigned"}.apk"
}
}
}

dependencies {
Expand Down

0 comments on commit 118d1e5

Please sign in to comment.