Use git describe instead of hardcoded version number

This commit is contained in:
Sylvain Berfini 2018-10-12 17:49:08 +02:00
parent 680a0ff701
commit 4c5c0b58c6

View file

@ -154,6 +154,15 @@ task copyAssets(type: Sync) {
}
project.tasks['preBuild'].dependsOn 'copyAssets'
def gitversion = new ByteArrayOutputStream()
task getGitVersion {
exec {
commandLine 'git', 'describe', '--abbrev=0', '--always'
standardOutput = gitversion
}
}
uploadArchives {
repositories {
mavenDeployer {
@ -164,9 +173,10 @@ uploadArchives {
pom.project {
groupId 'org.linphone'
artifactId 'liblinphone-sdk'
version '3.4.1'
version project.hasProperty("debug") ? gitversion + "-DEBUG" : gitversion
}
}
}
}
project.tasks['uploadArchives'].dependsOn 'getGitVersion'