Use SVN revision as buildnumber if available, default to zero if that fails. Zero isn't really a valid build number, but this allows a full build if working offline.

git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@202 38686702-15cf-42e4-a595-3071df8bf5ea
This commit is contained in:
lizzardo 2008-12-30 06:13:34 +00:00
parent ff94ddec57
commit bf194a19e2
2 changed files with 11 additions and 5 deletions

View File

@ -77,9 +77,15 @@
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<!-- get the current svn revision (needed by version.properties) -->
<!-- get the current svn revision (needed by version.properties) - if repository is unavailable, this will be zero -->
<macro_svn_revision repository="https://svn2.assembla.com/svn/romraider" property="svn.revision"/>
<!-- Set the buildnumber to be the revision fetched from the repository, but default to zero for
offline work -->
<condition property="buildnumber" value="${svn.revision}" else="0">
<isset property="svn.revision"/>
</condition>
<!-- version properties are set in this file, both for the product itself and
for some of the external dependencies (jar files and such) -->
<property file="version.properties"/>
@ -240,7 +246,7 @@
<attribute name="property"/>
<sequential>
<tempfile property="svninfo.log"/>
<exec executable="svn" output="${svninfo.log}">
<exec executable="svn" output="${svninfo.log}" failonerror="false">
<arg line="info @{repository}"/>
</exec>
<loadfile property="@{property}" srcFile="${svninfo.log}">

View File

@ -20,7 +20,7 @@ release_notes=release_notes.txt
version.major=0
version.minor=5
version.patch=1
version.buildnumber=${svn.revision}
version.buildnumber=${buildnumber}
version.extra=Beta
version.extra1=