Add git hash to APK file name
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
...
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${rootProject.name}-${variant.name}-" + {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--match=', '--always', '--dirty'
standardOutput = stdout
}
stdout.toString().trim()
}() + ".apk"
}
}
}
dependencies {
...
}Last updated