mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 15:32:06 +01:00
Add git revision in build.xml output files
This commit is contained in:
parent
c4edd1f27c
commit
8ff5807586
1 changed files with 29 additions and 0 deletions
|
@ -33,6 +33,27 @@
|
||||||
<var name="mutable-version" value="${version.major}.${version.minor}.${version.revision}"/>
|
<var name="mutable-version" value="${version.major}.${version.minor}.${version.revision}"/>
|
||||||
<var name="mutable-experimental-version" value="0.1"/>
|
<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>
|
<if>
|
||||||
<length string="${version.extra}" when="greater" length="0"/>
|
<length string="${version.extra}" when="greater" length="0"/>
|
||||||
<then>
|
<then>
|
||||||
|
@ -52,6 +73,14 @@
|
||||||
</then>
|
</then>
|
||||||
</if>
|
</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="version" value="${mutable-version}" />
|
||||||
<property name="experimental.version" value="${mutable-experimental-version}" />
|
<property name="experimental.version" value="${mutable-experimental-version}" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue