From c8d66fa2467655d89b89818e12bd2796be0c64af Mon Sep 17 00:00:00 2001 From: Tim Mutton Date: Fri, 24 Mar 2017 14:33:12 +1100 Subject: [PATCH] Nix and windows variant of getting tag --- Source/Android/app/build.gradle | 13 ++++++++++--- 1 file 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)?-[^-]+$/, "") }