2 <project name="Spittoon" default="" basedir="." >
5 <property name="ant.build.javac.target" value="1.5" />
7 <path id="spittoon.classpath" >
9 <fileset dir="${java.home}/lib" >
10 <include name="*.jar"/>
12 <pathelement path="build/" />
13 <pathelement path="build/src" />
14 <pathelement path="build/gen" />
15 <pathelement path="build/test" />
16 <pathelement path="xml/" />
17 <pathelement path="lib/" />
18 <pathelement path="." />
20 <include name="**/*.jar" />
21 <include name="**/*.properties" />
27 <!-- =============================== -->
28 <!-- TASK DEFINITIONS -->
29 <!-- =============================== -->
30 <taskdef name="if" classpathref="spittoon.classpath" classname="ise.antelope.tasks.IfTask"/>
33 <!-- =============================== -->
34 <!-- INITIALIZE the build process -->
35 <!-- =============================== -->
38 <loadproperties srcFile="build.properties" />
43 <!-- =============================== -->
44 <!-- CLEAN build files -->
45 <!-- =============================== -->
48 <delete dir="build" />
50 <delete dir="bootstrap" />
54 <!-- ================================= -->
55 <!-- GENERATE source from xml -->
56 <!-- ================================= -->
57 <target name="run-gen" depends="init" >
59 <available file="gen/com/interrupt" property="genExists" />
62 <java classname="com.interrupt.bob.Main" classpathref="spittoon.classpath" fork="yes" >
63 <arg line="-gen ${gen.dir} -base . -end .xml -def ${all.files} -sys ${all.files}" />
70 <!-- ================================= -->
72 <!-- ================================= -->
73 <target name="compile-gen" depends="init, run-gen">
75 <echo message="COMPILING GEN SOURCE"/>
76 <mkdir dir="${dir.build}/gen"/>
77 <javac srcdir="gen" destdir="${dir.build}/gen"
78 classpathref="spittoon.classpath" fork="yes" deprecation="on" nowarn="on" />
79 <copy todir="${dir.build}/gen">
80 <fileset dir="gen" includes="**/*.dat"/>
84 <target name="compile-src" depends="init, compile-gen">
86 <echo message="COMPILING JAVA SOURCE"/>
87 <mkdir dir="${dir.build}/src"/>
88 <javac srcdir="${dir.src}/" destdir="${dir.build}/src" debug="true"
89 classpathref="spittoon.classpath" fork="yes" deprecation="on" nowarn="on" />
92 <target name="compile-tests" depends="init,compile-src">
94 <echo message="COMPILING JAVA TESTS"/>
95 <mkdir dir="${dir.build}/test"/>
96 <javac srcdir="${dir.test.src}" destdir="${dir.build}/test"
97 classpathref="spittoon.classpath" fork="yes" deprecation="on" nowarn="on" />
101 <!-- ================================= -->
102 <!-- RELEASE a jar file -->
103 <!-- ================================= -->
104 <target name="release" depends="compile-gen, compile-src" >
106 <jar destfile="${dir.build}/spittoon.jar" >
108 <fileset dir="${dir.build}/gen">
109 <include name="**/*.class"/>
111 <fileset dir="${dir.build}/src">
112 <include name="**/*.class"/>
118 <!-- ================================= -->
119 <!-- PACKAGE a zip file -->
120 <!-- ================================= -->
125 <!-- ================================= -->
126 <!-- PACKAGE a zip file -->
127 <!-- ================================= -->
128 <target name="run-tests" depends="compile-tests" >
130 <echo message="RUNNING UNIT TESTS in directory: ${dir.test.src}"/>
131 <java classname="junit.textui.TestRunner" classpathref="spittoon.classpath" fork="yes" >
132 <arg line="-Dbob.base=. -Dbob.end=.xml -Dbob.def=${all.files}" />
133 <arg value="com.interrupt.spittoon.AllTests" />
137 <target name="run-test" depends="compile-tests" >
139 <echo message="RUNNING a single UNIT TEST in directory: ${dir.test.src}"/>
140 <java classname="junit.textui.TestRunner" classpathref="spittoon.classpath" fork="yes" >
141 <arg line="-Dbob.base=. -Dbob.end=.xml -Dbob.def=${all.files} -Ddb.url=xmldb:exist:///db/bookkeeping/ -Dexist.initdb=true -Dexist.home=. -Dorg.xml.sax.features.validation=false -Djava.endorsed.dirs=lib/endorsed " />
142 <arg value="com.interrupt.spittoon.TestSpittoon" />