Nix and windows variant of getting tag
This commit is contained in:
parent
8908d10028
commit
c8d66fa246
|
@ -1,3 +1,5 @@
|
||||||
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -94,7 +96,12 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
def getVersion() {
|
def getVersion() {
|
||||||
return 'git describe --always --long'.execute([], project.rootDir).text
|
String result
|
||||||
.trim()
|
if(Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
.replaceAll(/(-0)?-[^-]+$/, "")
|
result = 'cmd /c git describe --always --long'.execute([], project.rootDir).text
|
||||||
|
} else {
|
||||||
|
result = 'git describe --always --long'.execute([], project.rootDir).text
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.trim().replaceAll(/(-0)?-[^-]+$/, "")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue