gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control systemdiff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
<fileset dir="${log.dir}"/>
</delete>
</target>
+
+ <!-- version tasks
+ based on ideas by Jesper Öqvist http://llbit.se/?p=1876 -->
+ <!-- this target is only run if the 'version' property is undefined -->
+
+ <target name="update-version-string" unless="version">
+ <!-- get a new version string using git describe if possible -->
+ <echo message="Updating version string..."/>
+ <exec executable="git" outputproperty="version"
+ failifexecutionfails="false">
+ <arg value="describe"/>
+ </exec>
+ <antcall target="-store-version-string"/>
+ <!-- ensure version is defined even if git was not available -->
+ <property file="${res.dir}/version.properties"/>
+ </target>
+ <target name="-store-version-string" if="version">
+ <!-- store the new version string in the correct property file -->
+ <echo message="version=${version}"/>
+ <propertyfile file="${res.dir}/version.properties">
+ <entry key="version" value="${version}"/>
+ </propertyfile>
+ <exec executable="git" failifexecutionfails="false">
+ <arg value="update-index"/>
+ <arg value="--assume-unchanged"/>
+ <arg value="${res.dir}/version.properties"/>
+ </exec>
+ </target>
+
<!-- mjc2wsl related tasks -->
- <target name="build" depends="init" description="build the mjc2wsl tool">
+ <target name="build" depends="init,update-version-string" description="build the mjc2wsl tool">
<javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
</target>
</java>
</target>
- <target name="mj-samples" description="run the mj compiler on the samples">
+ <target name="mj-samples" description="run the mj compiler on the samples" depends="init">
<foreach param="filename" target="mj-compile">
<path>
<fileset dir='${samples.temp.dir}'>