Skip to content

Commit

Permalink
Generate a buildinfo property file with the current Git revision.
Browse files Browse the repository at this point in the history
  • Loading branch information
dolda2000 committed Jan 10, 2009
1 parent 1ebf458 commit 11ee996
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.xml
Expand Up @@ -5,9 +5,19 @@
<mkdir dir="build" />
<mkdir dir="build/classes" />
<available property="has-res-jar" file="build/haven-res.jar" />
<available property="has-buildinfo" file="build/classes/buildinfo" />
<available property="unpacked-lib" file="build/classes-lib" />
</target>

<target name="buildinfo" depends="build-env" unless="has-buildinfo">
<exec executable="git" outputproperty="gitrev" failifexecutionfails="false">
<arg line="rev-parse HEAD" />
</exec>
<propertyfile file="build/classes/buildinfo">
<entry key="git-rev" value="${gitrev}" />
</propertyfile>
</target>

<target name="haven-client" depends="build-env">
<javac srcdir="src" destdir="build/classes" debug="on">
<classpath>
Expand Down Expand Up @@ -40,7 +50,7 @@
</unjar>
</target>

<target name="jar" depends="haven-client,lib-classes">
<target name="jar" depends="haven-client,buildinfo,lib-classes">
<jar destfile="build/haven.jar" update="true">
<fileset dir="build/classes" />
<fileset dir="build/classes-lib" />
Expand Down

0 comments on commit 11ee996

Please sign in to comment.