2010-02-13 06:31:28 -06:00
|
|
|
<project name="Personal Issue Tracker">
|
2010-02-13 21:30:31 -06:00
|
|
|
<property file="../version.properties"/>
|
2010-02-13 06:31:28 -06:00
|
|
|
<property file="project.properties"/>
|
2010-02-13 11:58:00 -06:00
|
|
|
<property environment="env"/>
|
2010-02-13 06:31:28 -06:00
|
|
|
|
2010-02-13 11:58:00 -06:00
|
|
|
<path id="groovy.libs">
|
|
|
|
<fileset dir="${env.GROOVY_HOME}/lib">
|
2010-02-13 06:31:28 -06:00
|
|
|
<include name="**/*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
2010-02-13 21:30:31 -06:00
|
|
|
<path id="groovyc.classpath">
|
2010-02-13 11:58:00 -06:00
|
|
|
<path refid="groovy.libs"/>
|
2010-02-13 21:30:31 -06:00
|
|
|
<fileset dir="${lib.dir}">
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
</fileset>
|
2010-02-18 11:02:20 -06:00
|
|
|
<pathelement path="${build.dir}/classes"/>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="test.classpath">
|
|
|
|
<path refid="groovyc.classpath"/>
|
|
|
|
<pathelement path="${build.dir}/tests"/>
|
2010-02-13 06:31:28 -06:00
|
|
|
</path>
|
|
|
|
|
|
|
|
<taskdef name="groovyc"
|
|
|
|
classname="org.codehaus.groovy.ant.Groovyc"
|
2010-02-13 11:58:00 -06:00
|
|
|
classpathref="groovy.libs"/>
|
2010-02-13 06:31:28 -06:00
|
|
|
|
2010-02-13 21:30:31 -06:00
|
|
|
<target name="init">
|
|
|
|
<fail
|
|
|
|
unless="env.GROOVY_HOME"
|
|
|
|
message="GROOVY_HOME environment variable is not set."/>
|
|
|
|
<echo message="GROOVY_HOME: ${env.GROOVY_HOME}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="increment-build-number" depends="init">
|
|
|
|
<!-- Check to see if the application version has changed.
|
|
|
|
If it has, reset the build number to 0 -->
|
|
|
|
<condition property="build.number.final"
|
|
|
|
value="${build.number}"
|
|
|
|
else="0" >
|
|
|
|
<equals
|
|
|
|
arg1="${application.version}"
|
|
|
|
arg2="${expected.application.version}"/>
|
|
|
|
</condition>
|
|
|
|
|
|
|
|
<echo message="Version: ${application.version}"/>
|
|
|
|
<echo message="Build number: ${build.number.final}"/>
|
|
|
|
|
|
|
|
<!-- Write the actual application version and build number -->
|
|
|
|
<propertyfile file="project.properties">
|
|
|
|
<entry key="build.number" value="${build.number.final}"/>
|
|
|
|
<entry
|
|
|
|
key="expected.application.version"
|
|
|
|
value="${application.version}"/>
|
|
|
|
</propertyfile>
|
|
|
|
|
|
|
|
<!-- increment build number -->
|
|
|
|
<propertyfile file="project.properties">
|
|
|
|
<entry key="build.number" operation="+" type="int" default="0"/>
|
|
|
|
</propertyfile>
|
|
|
|
<property file="project.properties"/>
|
|
|
|
</target>
|
|
|
|
|
2010-02-13 06:31:28 -06:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${build.dir}"/>
|
|
|
|
</target>
|
|
|
|
|
2010-02-13 21:30:31 -06:00
|
|
|
<target name="compile" depends="init,increment-build-number">
|
2010-02-13 06:31:28 -06:00
|
|
|
<mkdir dir="${build.dir}/classes"/>
|
|
|
|
<groovyc
|
|
|
|
srcdir="${src.dir}"
|
|
|
|
destdir="${build.dir}/classes"
|
2010-02-13 21:30:31 -06:00
|
|
|
classpathref="groovyc.classpath"/>
|
2010-02-13 06:31:28 -06:00
|
|
|
</target>
|
|
|
|
|
2010-02-18 11:02:20 -06:00
|
|
|
<target name="compile-tests" depends="init,compile">
|
|
|
|
<mkdir dir="${build.dir}/tests"/>
|
|
|
|
<groovyc
|
|
|
|
srcdir="${test.dir}"
|
|
|
|
destdir="${build.dir}/tests"
|
|
|
|
classpathref="groovyc.classpath"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="run-tests" depends="compile-tests">
|
|
|
|
<junit fork="yes" haltonfailure="yes">
|
|
|
|
<classpath refid="test.classpath"/>
|
|
|
|
<formatter type="brief" usefile="false" />
|
|
|
|
<batchtest>
|
|
|
|
<fileset dir="${build.dir}/tests">
|
2010-02-20 22:31:33 -06:00
|
|
|
<include name="**/*Test.class"/>
|
2010-02-18 11:02:20 -06:00
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build" depends="compile,run-tests">
|
2010-02-13 06:31:28 -06:00
|
|
|
<mkdir dir="${build.dir}/jar"/>
|
|
|
|
<jar
|
2010-02-13 21:30:31 -06:00
|
|
|
destfile="${build.dir}/jar/pit-${application.version}.${build.number.final}.jar"
|
2010-02-13 06:31:28 -06:00
|
|
|
basedir="${build.dir}/classes"
|
|
|
|
compress="on"/>
|
|
|
|
</target>
|
2010-02-13 21:30:31 -06:00
|
|
|
|
|
|
|
<target name="release" depends="build">
|
|
|
|
<delete dir="${release.dir}"/>
|
|
|
|
<mkdir dir="${release.dir}"/>
|
|
|
|
<copy file="${build.dir}/jar/pit-${application.version}.${build.number.final}.jar"
|
|
|
|
tofile="${release.dir}/${release.jar}"/>
|
|
|
|
</target>
|
2010-02-13 06:31:28 -06:00
|
|
|
</project>
|