summaryrefslogtreecommitdiff
path: root/ant/build-common.xml
diff options
context:
space:
mode:
Diffstat (limited to 'ant/build-common.xml')
-rw-r--r--ant/build-common.xml17
1 files changed, 17 insertions, 0 deletions
diff --git a/ant/build-common.xml b/ant/build-common.xml
index 573ba31..d3a96be 100644
--- a/ant/build-common.xml
+++ b/ant/build-common.xml
@@ -165,5 +165,22 @@
</jar>
</target>
+ <available file=".git" type="dir" property="git.present"/>
+
+ <target name="gitrevision" description="Store git revision in ${repository.version}" if="git.present">
+ <exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
+ <arg value="describe"/>
+ <arg value="--tags"/>
+ <arg value="--always"/>
+ <arg value="--dirty"/>
+ </exec>
+ <condition property="repository.version" value="${git.revision}" else="unknown">
+ <and>
+ <isset property="git.revision"/>
+ <length string="${git.revision}" trim="yes" length="0" when="greater"/>
+ </and>
+ </condition>
+ </target>
+
<import file="${jesterpm.buildtools.root}/ant/ivy-common.xml" />
</project>