Last active
December 25, 2015 00:29
-
-
Save aembleton/6887807 to your computer and use it in GitHub Desktop.
Builds a jar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sat, 12 Oct 2013 23:12:10 +0100 | |
major=0 | |
minor=1 | |
build=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="ScrapeRequest" basedir="." default="jar"> | |
<property name="build" value="build"/> | |
<property file="build.info" prefix="info"/> | |
<target name="clean"> | |
<delete dir="${build}"/> | |
</target> | |
<target name="init" depends="clean"> | |
<mkdir dir="${build}"/> | |
</target> | |
<target name="compile" depends="init"> | |
<!-- Compile the java code --> | |
<javac srcdir="src" destdir="${build}" /> | |
</target> | |
<target name="incrementBuild"> | |
<propertyfile file="build.info"> | |
<entry key="build" operation="+" value="1" type="int"/> | |
</propertyfile> | |
</target> | |
<target name="buildJar" depends="compile,incrementBuild"> | |
<!-- Build the jar file --> | |
<jar basedir="${build}" destfile="ScrapeRequest-${info.major}.${info.minor}.${info.build}.jar"/> | |
</target> | |
<target name="jar" depends="buildJar"> | |
<!-- jar has been built, now just remove the build directory so that it doesn't pollute the dev environment --> | |
<delete dir="${build}"/> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Without the
type="int"
, a 1 gets appended to the end of the value, so you end up with01111
... etc. The int forces it to actually increment the value as a number.