forked from QuickBlox/quickblox-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
artifacts.gradle
30 lines (28 loc) · 1.09 KB
/
artifacts.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
android.applicationVariants.all {
variant ->
def appName
//Check if an applicationName property is supplied; if not use the name of the parent project.
if (project.hasProperty("applicationName")) {
appName = applicationName
} else {
appName = project.projectDir.getName()
}
variant.outputs.each {
output ->
def newApkName
def apkEndName
//If there's no ZipAlign task it means that our artifact will be unaligned and we need to mark it as such.
if (output.zipAlign) {
apkEndName = ".apk"
} else {
apkEndName = "-unaligned.apk"
}
newApkName = "${appName}-${variant.buildType.name}-${getDate()}-code-${variant.versionCode}-version-${variant.versionName}" + apkEndName
output.outputFile = new File(output.outputFile.parent, newApkName)
}
}
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}