1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-02 06:45:59 +01:00

Add git revision in build.xml output files

This commit is contained in:
Florian Schmaus 2014-02-06 10:17:40 +01:00
parent c4edd1f27c
commit 8ff5807586

View file

@ -33,6 +33,27 @@
<var name="mutable-version" value="${version.major}.${version.minor}.${version.revision}"/>
<var name="mutable-experimental-version" value="0.1"/>
<available file=".git" type="dir" property="gitDir.present"/>
<!-- <target name="git.revision" description="Store git revision in ${repository.version}" if="gitDir.present"> -->
<if>
<isset property="gitDir.present"/>
<then>
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="log"/>
<arg value="-n 1"/>
<arg value="--pretty=format:%h"/>
</exec>
</then>
</if>
<condition property="repository.version" value="${git.revision}" else="">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
<!-- </target> -->
<if>
<length string="${version.extra}" when="greater" length="0"/>
<then>
@ -52,6 +73,14 @@
</then>
</if>
<if>
<length string="${repository.version}" when="greater" length="0"/>
<then>
<var name="mutable-version" value="${mutable-version}-${repository.version}"/>
<var name="mutable-experimental-version" value="${mutable-experimental-version}-${repository.version}" />
</then>
</if>
<property name="version" value="${mutable-version}" />
<property name="experimental.version" value="${mutable-experimental-version}" />