2010-02-13 11:58:00 -06:00
<project name= "Personal Issue Tracker CLI" >
2010-02-15 11:06:28 -06:00
<property file= "../version.properties" />
2010-02-13 06:31:28 -06:00
<property file= "project.properties" />
2010-02-13 21:30:31 -06:00
<property environment= "env" />
2010-02-13 06:31:28 -06:00
2010-02-13 21:30:31 -06:00
<path id= "groovy.libs" >
<fileset dir= "${env.GROOVY_HOME}/lib" >
<include name= "**/*.jar" />
</fileset>
</path>
2010-02-18 11:02:20 -06:00
<path id= "groovy.embeddable" >
<fileset dir= "${env.GROOVY_HOME}/embeddable" >
<include name= "**/*.jar" />
</fileset>
</path>
<path id= "project.libs" >
2010-02-13 21:30:31 -06:00
<fileset dir= "${lib.dir}" >
2010-02-13 06:31:28 -06:00
<include name= "**/*.jar" />
</fileset>
</path>
2010-02-18 11:02:20 -06:00
<path id= "groovyc.classpath" >
<path refid= "groovy.libs" />
<path refid= "project.libs" />
</path>
<path id= "package.jars" >
<path refid= "groovy.embeddable" />
<path refid= "project.libs" />
</path>
2010-02-13 06:31:28 -06:00
<taskdef name= "groovyc"
classname="org.codehaus.groovy.ant.Groovyc"
2010-02-13 21:30:31 -06:00
classpathref="groovy.libs"/>
<target name= "init" >
<fail
unless="env.GROOVY_HOME"
message="GROOVY_HOME environment variable is not set."/>
<echo message= "GROOVY_HOME: ${env.GROOVY_HOME}" />
<fail message= "Could not find PIT ${application.version} library." >
<condition >
<not >
<available
file="${lib.dir}/pit-${application.version}.jar"/>
</not>
</condition>
</fail>
2010-02-15 11:06:28 -06:00
<echo message= "PIT library found at ${lib.dir}/pit-${application.version}.jar" />
<fail message= "The PIT project is at version ${application.version} but pit-cli is versioned as ${expected.application.version}. Ensure that pit-cli is updated tp reflect the changes in libpit and then run the 'upgrade-version' task to sync the pit-vli subproject with the PIT project." >
<condition >
<not >
<equals
arg1="${application.version}"
arg2="${expected.application.version}"/>
</not>
</condition>
</fail>
<echo message= "Application version: ${application.version}" />
</target>
<target name= "upgrade-version" >
<propertyfile file= "project.properties" >
<entry
key="expected.application.version"
value="${application.version}"/>
<entry key= "build.number" value= "0" />
</propertyfile>
<echo message= "pit-cli version upgraded to ${application.version}" />
</target>
<target name= "increment-build-number" depends= "init" >
<propertyfile file= "project.properties" >
<entry key= "build.number" operation= "+" type= "int" default= "0" />
</propertyfile>
2010-02-13 21:30:31 -06:00
</target>
2010-02-13 06:31:28 -06:00
<target name= "clean" >
<delete dir= "${build.dir}" />
</target>
2010-02-15 11:06:28 -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>
<target name= "build" depends= "compile" >
<mkdir dir= "${build.dir}/jar" />
<unjar dest= "${build.dir}/classes" >
2010-02-18 11:02:20 -06:00
<path refid= "package.jars" />
2010-02-13 06:31:28 -06:00
</unjar>
<jar
destfile="${build.dir}/jar/${build.jar}"
basedir="${build.dir}/classes"
2010-02-13 21:30:31 -06:00
compress="on">
2010-02-13 06:31:28 -06:00
<manifest >
<attribute name= "Main-Class" value= "${main.class}" />
</manifest>
</jar>
</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/${build.jar}"
2010-02-15 11:06:28 -06:00
tofile="${release.dir}/${release.jar}"/>
2010-02-13 21:30:31 -06:00
</target>
2010-02-13 11:58:00 -06:00
2010-02-13 06:31:28 -06:00
</project>