2 <project name="bob" default="usage" basedir=".">
\r
5 <!-- <property name="build.sysclasspath" value="last" />
\r
7 <property name="ant.build.javac.target" value="1.6" />
\r
9 <path id="bob.classpath" >
\r
11 <fileset dir="${java.home}/lib" >
\r
12 <include name="*.jar"/>
\r
14 <pathelement path="templates/" />
\r
15 <pathelement path="build/bootstrap" />
\r
16 <pathelement path="build/src" />
\r
17 <pathelement path="build/gen" />
\r
18 <pathelement path="build/test" />
\r
19 <pathelement path="test/xml/" />
\r
20 <pathelement path="lib/" />
\r
21 <pathelement path="." />
\r
22 <fileset dir="lib/">
\r
23 <include name="*.jar" />
\r
24 <include name="*.properties" />
\r
30 <path id="run.classpath" >
\r
33 <pathelement path="build/bob.jar" />
\r
34 <pathelement path="bob.jar" />
\r
36 <pathelement path="templates" />
\r
37 <pathelement path="build/src" />
\r
38 <pathelement path="build/gen" />
\r
39 <pathelement path="lib" />
\r
41 <include name="*.jar" />
\r
42 <include name="*.properties" />
\r
44 <fileset dir="${java.home}/lib" >
\r
45 <include name="*.jar"/>
\r
50 <target name="usage">
\r
52 <echo message="BOBJava build targets..."/>
\r
55 <echo message="init"/>
\r
56 <echo message="clean"/>
\r
59 <echo message="bootstrap-src"/>
\r
60 <echo message="bootstrap-gen"/>
\r
61 <echo message="bootstrap-compile"/>
\r
64 <echo message="compile-src"/>
\r
65 <echo message="compile-tests"/>
\r
66 <echo message="compile-all"/>
\r
67 <echo message="compile-gen"/>
\r
70 <echo message="release"/>
\r
71 <echo message="run-gen"/>
\r
72 <echo message="run-cc"/>
\r
73 <echo message="run-docs"/>
\r
74 <echo message="run-gendocs"/>
\r
75 <echo message="run-tests"/>
\r
76 <echo message="run-test"/>
\r
80 <!-- =============================== -->
\r
81 <!-- TASK DEFINITIONS -->
\r
82 <!-- =============================== -->
\r
83 <taskdef name="if" classpathref="bob.classpath" classname="ise.antelope.tasks.IfTask"/>
\r
84 <taskdef name="sablecc" classpathref="bob.classpath" classname="org.sablecc.ant.taskdef.Sablecc"/>
\r
87 <!-- =============================== -->
\r
88 <!-- INITIALIZE THE BUILD PROCESS -->
\r
89 <!-- =============================== -->
\r
90 <target name="init" >
\r
91 <loadproperties srcFile="build.properties" />
\r
96 <!-- =============================== -->
\r
97 <!-- CLEAN OUT THE BUILD FILES -->
\r
98 <!-- =============================== -->
\r
99 <target name="clean">
\r
100 <delete dir="build" />
\r
101 <delete dir="gen" />
\r
102 <delete dir="bootstrap" />
\r
106 <!-- =============================== -->
\r
107 <!-- COMPILE targets -->
\r
108 <!-- =============================== -->
\r
109 <target name="compile-all" depends="init,compile-src,compile-tests"/>
\r
112 <!-- <target name="bootstrap-src" depends="bootstrap-gen">
\r
114 <echo message="BOOTSTRAPPING SOURCE..."/>
\r
115 <mkdir dir="${dir.build}/src"/>
\r
116 <javac srcdir="${dir.src}"
\r
117 destdir="${dir.build}/src"
\r
118 classpathref="bob.classpath"
\r
121 <!- <exclude name="com/interrupt/bob/core/**"/>
\r
128 <target name="bootstrap-gen" depends="init">
\r
131 <echo message="BOOTSTRAP COMPILING 'Main'..."/>
\r
132 <mkdir dir="${dir.build}/src"/>
\r
133 <javac srcdir="${dir.src}"
\r
134 destdir="${dir.build}/src"
\r
135 classpathref="bob.classpath"
\r
141 <echo message="" />
\r
142 <echo message="" />
\r
143 <echo message="BOOTSTRAP GENERATING 'Bob' Core..."/>
\r
144 <java classname="com.interrupt.bob.Main" classpathref="bob.classpath" fork="yes" >
\r
146 <arg line="-gen ${dir.bootstrap} -base . -end .xml -def ${bootstrap.files} -sys ${bootstrap.files}" />
\r
151 <target name="bootstrap-compile" depends="bootstrap-gen">
\r
153 <echo message="COMPILING BOOTSTRAP SOURCE"/>
\r
154 <mkdir dir="${dir.build}/bootstrap" />
\r
155 <javac srcdir="${dir.bootstrap}" destdir="${dir.build}/bootstrap" debug="true"
\r
156 classpathref="bob.classpath" fork="yes" deprecation="on" nowarn="on" />
\r
161 <target name="compile-src" depends="bootstrap-compile">
\r
163 <echo message="COMPILING JAVA SOURCE"/>
\r
164 <!--<mkdir dir="${dir.build}/src"/>
\r
166 <javac srcdir="${dir.src}/" destdir="${dir.build}/src" debug="true"
\r
167 classpathref="bob.classpath" fork="yes" deprecation="on" nowarn="on" />
\r
172 <target name="compile-tests" depends="init,compile-src,compile-gen">
\r
174 <echo message="COMPILING JAVA TESTS"/>
\r
175 <mkdir dir="${dir.build}/test"/>
\r
176 <javac srcdir="${dir.test.src}" destdir="${dir.build}/test"
\r
177 classpathref="bob.classpath" fork="yes" deprecation="on" nowarn="on" />
\r
181 <target name="compile-gen" depends="init, run-gen, run-cc">
\r
183 <echo message="COMPILING GEN SOURCE"/>
\r
184 <mkdir dir="${dir.build}/gen"/>
\r
185 <javac srcdir="gen" destdir="${dir.build}/gen"
\r
186 classpathref="bob.classpath" fork="yes" deprecation="on" nowarn="on" />
\r
187 <copy todir="${dir.build}/gen">
\r
188 <fileset dir="gen" includes="**/*.dat"/>
\r
194 <!-- =============================== -->
\r
196 <!-- =============================== -->
\r
197 <target name="release" depends="compile-gen, compile-src" >
\r
198 <jar destfile="${dir.build}/bob.jar" includes="velocity.properties">
\r
200 <fileset dir="${dir.build}/gen">
\r
201 <include name="com/interrupt/bob/core/**/*.class"/>
\r
202 <include name="com/interrupt/bob/handler/**/*.class"/>
\r
203 <include name="com/interrupt/cc/**/*.class"/>
\r
204 <include name="com/interrupt/cc/**/*.dat"/>
\r
206 <fileset dir="${dir.build}/src"/>
\r
207 <fileset file="lib/velocity.properties" />
\r
208 <fileset dir="templates/" />
\r
213 <!-- =============================== -->
\r
214 <!-- RUN TARGETS -->
\r
215 <!-- =============================== -->
\r
216 <target name="predicate-run" >
\r
218 <available file="gen/" property="genExists" />
\r
219 <if name="genExists">
\r
221 <mkdir dir="gen" />
\r
226 <target name="run-cc" depends="init, predicate-run">
\r
228 <available file="gen/com/interrupt/cc/xpath" property="ccExists" />
\r
229 <if name="ccExists">
\r
231 <sablecc src="cc" outputdirectory="gen" includes="*.sablecc" />
\r
236 <target name="run-gen" depends="init, predicate-run" >
\r
238 <available file="gen/com/interrupt/bob" property="bobExists" />
\r
239 <if name="bobExists">
\r
241 <java classname="com.interrupt.bob.Main" classpathref="bob.classpath" fork="yes" >
\r
242 <arg line="-gen ${gen.dir} -base . -end .xml -def ${all.files} -sys ${all.files}" />
\r
248 <target name="run-docs" depends="compile-gen" >
\r
250 <javadoc destdir="doc/api"
\r
251 windowtitle="BOB API"
\r
252 sourcepath="src/:gen/"
\r
253 classpathref="bob.classpath" >
\r
255 <package name="com.interrupt.bob" />
\r
256 <package name="com.interrupt.bob.base" />
\r
257 <package name="com.interrupt.bob.generator" />
\r
258 <package name="com.interrupt.bob.handler" />
\r
259 <package name="com.interrupt.bob.processor" />
\r
260 <package name="com.interrupt.bob.util" />
\r
261 <package name="com.interrupt.callback" />
\r
265 <target name="run-gendocs" depends="run-gen" >
\r
267 <javadoc destdir="${gen.dir}/doc"
\r
268 windowtitle="Generated API"
\r
269 packagenames="${gen.packages}"
\r
270 sourcepath="${gen.dir}"
\r
271 classpathref="bob.classpath" >
\r
276 <target name="run-tests" depends="compile-tests" >
\r
278 <echo message="RUNNING UNIT TESTS in directory: ${dir.test.src}"/>
\r
279 <java classname="junit.textui.TestRunner" classpathref="bob.classpath" fork="yes" >
\r
280 <arg line="-Dbob.base=. -Dbob.end=.xml -Dbob.def=${all.files}" />
\r
281 <arg value="com.interrupt.bob.AllTests" />
\r
285 <target name="run-test" depends="compile-tests" >
\r
287 <echo message="RUNNING a single UNIT TEST in directory: ${dir.test.src}"/>
\r
288 <java classname="junit.textui.TestRunner" classpathref="bob.classpath" fork="yes" >
\r
289 <arg line="-Dbob.base=. -Dbob.end=.xml -Dbob.def=${all.files}" />
\r
290 <arg value="com.interrupt.bob.TestBob" />
\r
294 <target name='run-class' depends="init" >
\r
296 <java classname="com.interrupt.bob.base.Bob" classpathref="bob.classpath" fork="yes" >
\r
297 <arg line="-Dbob.base=. -Dbob.end=.xml -Dbob.def=${all.files}" />
\r