Use git describe to generate apk names
This commit is contained in:
parent
53dae43b8c
commit
f826bfe474
1 changed files with 17 additions and 1 deletions
|
@ -30,6 +30,22 @@ excludePackage.add('**/libopenh264**')
|
||||||
excludePackage.add('**/**tester**')
|
excludePackage.add('**/**tester**')
|
||||||
excludePackage.add('**/LICENSE.txt')
|
excludePackage.add('**/LICENSE.txt')
|
||||||
|
|
||||||
|
|
||||||
|
def gitVersion = new ByteArrayOutputStream()
|
||||||
|
|
||||||
|
task getGitVersion {
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'describe', '--always'
|
||||||
|
standardOutput = gitVersion
|
||||||
|
}
|
||||||
|
doLast {
|
||||||
|
gitVersion = gitVersion.toString().trim()
|
||||||
|
println("Git version: " + gitVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project.tasks['preBuild'].dependsOn 'getGitVersion'
|
||||||
|
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -57,7 +73,7 @@ android {
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all {
|
variant.outputs.all {
|
||||||
outputFileName = "linphone-android-${variant.buildType.name}-${defaultConfig.versionName}.apk"
|
outputFileName = "linphone-android-${variant.buildType.name}-${gitVersion.toString().trim()}.apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue