Skip to content

Commit

Permalink
Fix for issue 305: generate random version info where not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindholmes committed Sep 13, 2024
1 parent 3a00cc1 commit b27f6df
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,32 @@
<delete file="${ssBaseDir.converted}/test/VERSION"/>
<exec executable="git">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
<redirector output="${ssBaseDir.converted}/test/VERSION"/>
<arg value="--is-inside-work-tree"/>
<redirector outputproperty="isGitRepo"/>
</exec>
<if>
<equals arg1="true" arg2="${isGitRepo}"/>
<then>
<exec executable="git">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
<redirector output="${ssBaseDir.converted}/test/VERSION"/>
</exec>
</then>
<else>
<!-- Generate a random version string. -->
<math result="rand" datatype="int">
<op op="rint">
<op op="*">
<num value="1000"/>
<op op="random"/>
</op>
</op>
</math>
<echo file="${ssBaseDir.converted}/test/VERSION" message="vrand${rand}"/>
</else>
</if>
</then>
</if>
<!-- If this build is our test suite, then we need to copy the
Expand Down

0 comments on commit b27f6df

Please sign in to comment.