summaryrefslogtreecommitdiff
path: root/BKULocal
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2013-11-26 10:35:18 (GMT)
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2013-11-26 10:35:18 (GMT)
commit8eb379a8f0e0b35175cd574c26afdae951604dd2 (patch)
tree7a8e1553730df3bca14f3d1d414a79b636c060d9 /BKULocal
parent67a4dae7e7a234cd1361eca74cae72f8b6fdf631 (diff)
downloadmocca-8eb379a8f0e0b35175cd574c26afdae951604dd2.zip
mocca-8eb379a8f0e0b35175cd574c26afdae951604dd2.tar.gz
mocca-8eb379a8f0e0b35175cd574c26afdae951604dd2.tar.bz2
Update git-svn revision parsing for windows
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1224 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKULocal')
-rw-r--r--BKULocal/pom.xml18
1 files changed, 14 insertions, 4 deletions
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index b631691..ab9d22c 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -201,8 +201,8 @@
<profile>
<!--
This profile is here for triggering when another scm than svn is
- used (for example git). Instead of getting the version build number
- from svn we will use the build date and the user name.
+ used (for example git). Try to get the associated svn revision
+ from git-svn.
-->
<id>buildnumber-git</id>
<activation>
@@ -224,9 +224,19 @@
</goals>
<configuration>
<source>
- def gitSvnProc = ["sh", "-c", "git svn info | awk '/Revision:/ { print \$2 }'"].execute()
+ def shell = "sh"
+ def param = "-c"
+ if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")) {
+ shell = "cmd"
+ param = "/c"
+ }
+ def gitSvnProc = [shell, param, "git svn info | grep Revision:"].execute()
gitSvnProc.waitFor()
- project.properties['gitSvnRev'] = gitSvnProc.in.text.trim()
+ def svnref = "unknown"
+ def out = gitSvnProc.in.text.split(" ")
+ if (out.size() == 2)
+ svnref = out[1].trim()
+ project.properties['gitSvnRev'] = svnref
</source>
</configuration>
</execution>