summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorTim Mutton <tim.mutton@outware.com.au>2017-03-24 14:33:12 +1100
committerTim Mutton <tim.mutton@outware.com.au>2017-05-04 17:13:31 +1000
commitc8d66fa2467655d89b89818e12bd2796be0c64af (patch)
treebc8b51738cae6313d26ba4b3c20c44df61ccb619 /Source/Android
parent8908d100284eb9ae38f73a916a6b55bcb2f1e3ba (diff)
Nix and windows variant of getting tag
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/app/build.gradle13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle
index 44e5bc5644..ea7165d4d5 100644
--- a/Source/Android/app/build.gradle
+++ b/Source/Android/app/build.gradle
@@ -1,3 +1,5 @@
+import org.apache.tools.ant.taskdefs.condition.Os
+
apply plugin: 'com.android.application'
android {
@@ -94,7 +96,12 @@ dependencies {
}
def getVersion() {
- return 'git describe --always --long'.execute([], project.rootDir).text
- .trim()
- .replaceAll(/(-0)?-[^-]+$/, "")
+ String result
+ if(Os.isFamily(Os.FAMILY_WINDOWS)) {
+ 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)?-[^-]+$/, "")
}