fixing checkout build and webkell-cactus process
[Bookkeeping.git] / build.xml
blob6d29829cee25734750c75395d26ed5ad6a51ff87
2 <project name="bookkeeping" default="usage" basedir=".">
3         
4         
5     <property name="ant.build.javac.target" value="1.5" />
6         
7     <!-- <path id="bookkeeping.classpath">
8                 <pathelement path="${dir.build}/test" />
9                 <pathelement path="${dir.build}/gen" />
10                 <pathelement path="${dir.build}/src" />
11                 <pathelement path="xml" />
12                 <fileset dir="${java.home}/lib" >
13                     <include name="*.jar"/>
14                 </fileset>
15                 <fileset dir="lib">
16                     <include name="**/*.jar" />
17                     <include name="**/*.properties"/>
18                 </fileset>
19     </path>
20     -->
21     
22         <path id="bookkeeping.classpath">
23                 <pathelement path="${dir.build}/gen" />
24                 <pathelement path="${dir.build}/src" />
25                 <pathelement path="${dir.build}/test" />
26                 <pathelement path="lib/" />
27                 <pathelement path="xml/" />
28                 <pathelement path="xml/http/" />
29                 <pathelement path="test/xml/" />
30                 <pathelement path="test/xml/http/" />
31                 <pathelement path="." />
32                 <fileset dir="lib">
33                     <include name="**/*.jar" />
34                     <include name="**/*.properties"/>
35                 </fileset>
36                 <fileset dir="${java.home}/lib" >
37                     <include name="**/*.jar"/>
38                 </fileset>
39         </path>
40         
41                         
42         <!-- Define the Cactus tasks -->
43         <path id="cactus.classpath" >
44                 <fileset dir="lib/">
45                     <include name="**/*.jar" />
46                     <include name="**/*.properties"/>
47                 </fileset>
48         </path>
49         
50     <target name="usage">
51                 
52                 <echo message="'bookkeeping' build targets..."/>
53                 
54                 <echo message=""/>
55                 <echo message="init"/>
56                 <echo message="clean"/>
57                 <echo message="compile-all"/>
58                 <echo message="compile-src"/>
59                 <echo message="compile-tests"/>
60                 <echo message="compile-gen"/>
61                 
62                 <echo message=""/>
63                 <echo message="run-gen"/>
64                 <echo message="run-cc"/>
65                 <echo message="run-tests"/>
66                 <echo message="run-test"/>
67                 <echo message="run-docs"/>
68                 <echo message="run-class"/>
69                 <echo message="deploy"/>
70         <echo message="deploy-war"/>
71         
72                 <echo message="release"/>
73                 <echo message="release-war"/>
74                 
75                 <echo message="cactus-deploy"/>
76                 <echo message="cactus-run"/>
77                 
78                 <echo message=""/>
79                 <echo message="compile-htest"/>
80                 <echo message="run-htest"/>
81                 
82     </target>
84     
85     <!-- =============================== -->
86     <!-- TASK DEFINITIONS               -->
87     <!-- =============================== -->
88     <taskdef name="if" classpathref="bookkeeping.classpath" classname="ise.antelope.tasks.IfTask"/>
89     <taskdef name="sablecc" classpathref="bookkeeping.classpath" classname="org.sablecc.ant.taskdef.Sablecc"/>
90     <taskdef resource="cactus.tasks" >
91                 <classpath>
92                         <pathelement location="lib/cactus/cactus.core.framework.uberjar.javaEE.14-1.8.1.jar" />
93                         <pathelement location="lib/cactus/cactus.integration.shared.api-1.8.1.jar" />
94                         <pathelement location="lib/cactus/cactus.integration.ant-1.8.1.jar" />
95                         <pathelement location="lib/cactus/cargo-ant-1.0-beta-2.jar" />
96                         <pathelement location="lib/cactus/cargo-core-uberjar-1.0-beta-2.jar" />
97                         <pathelement location="lib/cactus/commons-httpclient-3.1.jar" />
98                         <pathelement location="lib/cactus/commons-logging-1.1.jar" />
99                         <pathelement location="lib/cactus/aspectjrt-1.5.3.jar" />
100                         <pathelement location="lib/cactus/jdom.jar" />
101                         <pathelement location="lib/cactus/junit-3.8.2.jar" />
102                         <pathelement location="lib/htmlunit/jaxen-1.1.1.jar" />
103                         <pathelement location="lib/jsch-0.1.8.jar" />
104                         <pathelement location="lib/jdepend-2.9.1.jar" />
105                                 <pathelement location="lib/cactus/commons-discovery-0.4.jar" />
106                                 <pathelement location="lib/cactus/httpunit-1.6.jar" />
107                                 <pathelement location="lib/cactus/nekohtml-1.9.6" />
108                                 
109                 </classpath>
110     </taskdef>
111         
114     <!-- =============================== -->
115     <!-- INITIALIZE THE BUILD PROCESS    -->
116     <!-- =============================== -->
117     <target name="init" >
118                 <loadproperties srcFile="build.properties" />
119     </target>
122     <!-- =============================== -->
123     <!-- CLEAN OUT THE BUILD FILES       -->
124     <!-- =============================== -->
125     <target name="clean" depends="clean-src, clean-gen, clean-cc" >
126                 <delete dir="build" failonerror="false" />
127     </target>
128     <target name="clean-src">
129                 <delete dir="build/src" failonerror="false" />
130         <delete dir="temp" failonerror="false" />
131     </target>
132     <target name="clean-gen">
133                 <delete dir="gen" failonerror="false" />
134                 <delete dir="build/gen" failonerror="false" />
135     </target>
136     <target name="clean-cc">
137                 <delete dir="cc/com" failonerror="false" />
138     </target>
139         <target name="clean-cactus" depends='init, clean' >
140                 <delete dir="${tomcat.home}/webapps/echo-cactus" failonerror="false" />
141                 <delete file="${tomcat.home}/webapps/echo-cactus.war" failonerror="false" />
142     </target>
143         
144     <!-- =============================== -->
145     <!-- CREATE the generated java files -->
146     <!-- =============================== -->
147     <target name="run-gen" >
148                 
149                 <available file="gen/" property="genExists" />
150                 <if name="genExists">
151                         
152                     <else>
153                                 
154                         <mkdir dir="gen/"/>
155                         
156                         <!-- BOB GENERATION --> 
157                                 <java classname="com.interrupt.bob.Main" classpathref="bookkeeping.classpath" fork="yes" >
158                                 
159                                         <!-- <arg line="-gen gen -base . -end .xml -def ${xml.files} -sys ${system.files}" /> --> 
160                                         <arg line="-gen gen -base . -end .xml -def 'xml/bookkeeping.2.bookkeeping.xml xml/bookkeeping.2.transactions.xml xml/bookkeeping.2.users.xml xml/bookkeeping.authorise.xml xml/bookkeeping.system.xml xml/bookkeeping.debitPointers.xml test/xml/test.currencies.xml test/xml/test.currencies.badpointers.xml' -sys 'xml/bookkeeping.2.bookkeeping.xml xml/bookkeeping.2.transactions.xml xml/bookkeeping.2.users.xml xml/bookkeeping.authorise.xml xml/bookkeeping.system.xml xml/bookkeeping.debitPointers.xml test/xml/test.currencies.xml test/xml/test.currencies.badpointers.xml'" />
161                                 </java>
162                         
163                     </else>
164                 </if>
165     </target>
166     
167     
168     <!-- =============================== -->
169     <!-- COMPILE targets                 -->
170     <!-- =============================== -->
171     <target name="compile-all" depends="init,run-gen,compile-src,compile-tests"/>
172         
173     <target name="compile-src" depends="init,compile-gen">
174                 
175                 <echo message="COMPILING JAVA SOURCE"/>
176                 <mkdir dir="${dir.build}/src"/>
177                 
178                 <javac srcdir="${dir.src}" destdir="${dir.build}/src" debug="true" fork="yes" >
179                         
180                         <!-- 
181                         -Xlint:deprecation
182                         <compilerarg line="-Xlint" />
183                         <arg value="com.interrupt.bookkeeping.AllTests" />
184                         -->
185                         <classpath>
186                                 <pathelement path="${dir.build}/test" />
187                                 <pathelement path="${dir.build}/gen" />
188                                 <pathelement path="${dir.build}/src" />
189                                 <pathelement path="xml" />
190                                 <fileset dir="${java.home}/lib" >
191                                         <include name="**/*.jar"/>
192                                 </fileset>
193                                 <fileset dir="lib">
194                                         <include name="**/*.jar" />
195                                         <include name="**/*.properties"/>
196                                 </fileset>
197                         </classpath>
198                 </javac>
199                 
200     </target>
201         
202         
203         <target name="run-cc" depends="init"> 
204                 
205         <available file="gen/com/interrupt/bookkeeping/cc/analysis" property="ccExists" />
206                 <if name="ccExists">
207                         
208                     <else>
209                                 
210                         <mkdir dir="gen" />
211                         <sablecc src="cc" outputdirectory="gen" includes="*.grammar" />
212                         
213                         <!-- need to hack the lexer code and there's no easy way to sub-type --> 
214                         <copy todir="gen/com/interrupt/bookkeeping/cc/lexer/" overwrite="true"> 
215                                 <fileset file="src/com/Lexer.java" /> 
216                         </copy> 
217                 
218                     </else>
219                 </if>
220                 
221         </target>
222         
223         
224     <target name="compile-htest" depends="init">
225         
226         <echo message="COMPILING htest"/>
227         <javac srcdir="htest" destdir="." fork="yes" deprecation="on" >
229             <classpath>
230                 <fileset dir="${java.home}/lib" >
231                     <include name="**/*.jar"/>
232                 </fileset>
233                 <fileset dir="lib">
234                     <include name="**/*.jar" />
235                 </fileset>
236             </classpath>
237         </javac>
238         
239     </target>
240     <target name="run-htest" depends="compile-htest,init">
242         <echo message="RUNNING htest"/>
243         <java classname="Testing" >
245             <classpath>
246                 <pathelement path="." />
247                 <fileset dir="${java.home}/lib" >
248                     <include name="**/*.jar"/>
249                 </fileset>
250                 <fileset dir="lib">
251                     <include name="**/*.jar" />
252                 </fileset>
253             </classpath>
254         </java>
255         
256     </target>
257     
258     <target name="compile-tests" depends="init, compile-src">
259                 
260                 <echo message="COMPILING JAVA TESTS"/>
261                 <mkdir dir="${dir.build}/test"/>
262                 <javac srcdir="${dir.test.src}" destdir="${dir.build}/test" debug="true" deprecation="on" >
263                         
264                         <!-- <compilerarg line="-Xlint" />
265                         -->
266                     <classpath>
267                         <pathelement path="${dir.build}/gen" />
268                         <pathelement path="${dir.build}/src" />
269                         <pathelement path="${dir.build}/test" />
270                         <pathelement path="xml" />
271                         <fileset dir="${java.home}/lib" >
272                             <include name="**/*.jar"/>
273                         </fileset>
274                         <fileset dir="lib">
275                             <include name="**/*.jar" />
276                             <include name="**/*.properties"/>
277                         </fileset>
278                     </classpath>
279                 </javac>
280                 
281     </target>
282         
283     <target name="compile-gen" depends="init,run-gen,run-cc">
284                 
285         
286                 <!-- copy over Token with a toString() that doesn't add extra stuff 
287                 <copy todir="gen/com/interrupt/bookkeeping/cc/node/" overwrite="true"> 
288                         <fileset file="src/com/interrupt/bookkeeping/cc/node/Token.java" /> 
289                 </copy> 
290         -->
291                 
292                 <echo message="COMPILING GEN SOURCE"/>
293                 <mkdir dir="${dir.build}/gen"/>
294                 <javac srcdir="gen" destdir="${dir.build}/gen" fork="yes" debug="true" deprecation="on" >
295                         
296                         <classpath>
297                                 <pathelement path="${dir.build}/src" />
298                                 <pathelement path="${dir.build}/test" />
299                                 <fileset dir="${java.home}/lib" >
300                                     <include name="**/*.jar"/>
301                                 </fileset>
302                                 <fileset dir="lib">
303                                     <include name="**/*.jar" />
304                                     <include name="**/*.properties"/>
305                                 </fileset>
306                     </classpath>
307                 </javac>
308                 
309                 
310                 <!-- copy over SableCC dat files -->
311                 <copy todir="${dir.build}/gen" > 
312                         <fileset dir="gen" includes="**/*.dat" />
313                 </copy> 
314                 
315     </target>
316     
317         
318         
319     <!-- =============================== -->
320     <!-- RUN targets                    -->
321     <!-- =============================== -->
322     <target name="run-tests" depends="compile-tests" >
323                 
324                 <echo message="RUNNING UNIT TESTS in directory:  ${dir.test.src}"/>
325                 <!-- <java classname="junit.textui.TestRunner" classpathref="bookkeeping.classpath" fork="yes" > -->
326                 <java classname="junit.textui.TestRunner" fork="yes" >
327                         
328                         <arg value="com.interrupt.bookkeeping.AllTests" />
329                         
330                         <classpath>
331                                 <pathelement path="${dir.build}/gen" />
332                                 <pathelement path="${dir.build}/src" />
333                                 <pathelement path="${dir.build}/test" />
334                                 <pathelement path="lib/" />
335                                 <pathelement path="xml/" />
336                                 <pathelement path="xml/http/" />
337                                 <pathelement path="test/xml/" />
338                                 <pathelement path="test/xml/http/" />
339                                 <pathelement path="." />
340                                 
341                                 <fileset dir="lib">
342                                     <include name="**/*.jar" />
343                                     <include name="**/*.properties"/>
344                                 </fileset>
345                                 <fileset dir="${java.home}/lib" >
346                                     <include name="**/*.jar"/>
347                                 </fileset>
348                         </classpath>
349                         
350                 </java>
351         
352     </target>
353         
354         <target name="run-test" depends="compile-tests" >
355                 
356                 <echo message="RUNNING a Single UNIT TEST in directory:  ${dir.test.src}"/>
357                 <!-- <java classname="junit.textui.TestRunner" fork="yes" >
358                         
359                         <sysproperty key="db.url" value="xmldb:exist:///db/bookkeeping/" />
360                         <sysproperty key="exist.initdb" value="true" />
361                         <sysproperty key="exist.home" value="." />
362                         <arg value="com.interrupt.bookkeeping.cc.kkell.aauth.TestAAuthentication" />
363                         
364                         <classpath>
365                                 <pathelement path="${dir.build}/gen" />
366                                 <pathelement path="${dir.build}/src" />
367                                 <pathelement path="${dir.build}/test" />
368                                 <pathelement path="lib/" />
369                                 <pathelement path="xml/" />
370                                 <pathelement path="xml/http/" />
371                                 <pathelement path="test/xml/http/" />
372                                 <pathelement path="." />
373                                 <fileset dir="lib">
374                                     <include name="**/*.jar" />
375                                     <include name="**/*.properties"/>
376                                 </fileset>
377                                 <fileset dir="${java.home}/lib" >
378                                     <include name="*.jar"/>
379                                 </fileset>
380                         </classpath>
381                         
382                 </java>
383                 <java classname="junit.textui.TestRunner" fork="yes" >
384                         
385                         <sysproperty key="db.url" value="xmldb:exist:///db/bookkeeping/" />
386                         <sysproperty key="exist.initdb" value="true" />
387                         <sysproperty key="exist.home" value="." />
388                         <arg value="com.interrupt.bookkeeping.TestGeneral" />
389                         <classpath>
390                                 <pathelement path="${dir.build}/gen" />
391                                 <pathelement path="${dir.build}/src" />
392                                 <pathelement path="${dir.build}/test" />
393                                 <pathelement path="lib/" />
394                                 <pathelement path="xml/" />
395                                 <pathelement path="xml/http/" />
396                                 <pathelement path="test/xml/" />
397                                 <pathelement path="test/xml/http/" />
398                                 <pathelement path="." />
399                                 <fileset dir="lib">
400                                     <include name="**/*.jar" />
401                                     <include name="**/*.properties"/>
402                                 </fileset>
403                                 <fileset dir="${java.home}/lib" >
404                                     <include name="*.jar"/>
405                                 </fileset>
406                         </classpath>
407                 </java>
408                 --> 
409                 
410                 <java classname="junit.textui.TestRunner" fork="yes" >
411                         
412                         <sysproperty key="db.url" value="xmldb:exist:///db/bookkeeping/" />
413                         <sysproperty key="exist.initdb" value="true" />
414                         <sysproperty key="exist.home" value="." />
415                         
416                         <sysproperty key="org.xml.sax.features.validation" value="false" />
417                         <sysproperty key="java.endorsed.dirs" value="lib/endorsed" />
418                         
419                         <arg value="com.interrupt.bookkeeping.cc.kkell.TestBKellFunctional" />
420                         <classpath>
421                                 <pathelement path="${dir.build}/gen" />
422                                 <pathelement path="${dir.build}/src" />
423                                 <pathelement path="${dir.build}/test" />
424                                 <pathelement path="lib/" />
425                                 <pathelement path="xml/" />
426                                 <pathelement path="xml/http/" />
427                                 <pathelement path="test/bk/" />
428                                 <pathelement path="test/xml/" />
429                                 <pathelement path="test/xml/http/" />
430                                 <pathelement path="." />
431                                 <fileset dir="lib">
432                                     <include name="**/*.jar" />
433                                     <include name="**/*.properties"/>
434                                 </fileset>
435                                 <fileset dir="${java.home}/lib" >
436                                     <include name="**/*.jar"/>
437                                 </fileset>
438                         </classpath>
439                 </java>
440                 
441     </target>
442         
443         
444         <target name='cactus-deploy' depends='compile-tests, release-war' >
445                 
446                 <echo message="DEPLOYING 'webkell-cactus.war' to ${tomcat.home}/webapps " />
447                 <available file="build/webkell-cactus.war" property="cactusExists" />
448                 <if name="cactusExists">
449                     <else>
450                                 <!-- <cactifywar destfile="build/webkell-cactus.war" srcfile="build/webkell.war" mergewebxml="webmerge.xml" />
451                                 -->
452                                 <cactifywar destfile="build/webkell-cactus.war" srcfile="build/webkell.war" webxml="lib/web.xml" />
453                         </else>
454                 </if>
455                 
456                 
457                 <!-- BEGIN :: Adding cactus specific war file -->
458                 
459                 <!-- create temporary directory to copy war -->
460                 <mkdir dir="build/cactus" />
461                 <copy todir="build/cactus" file="build/webkell-cactus.war" />
462                 
463                 <!-- extract war -->
464                 <exec executable="jar">
465                         <arg value="-xvf"/>
466                         <arg value="build/cactus/webkell-cactus.war"/>
467                 </exec>
468                 
469                 <!-- put extracted war to 'build/cactus' dir -->
470                 <move todir="build/cactus/" >
471                         <fileset dir=".">
472                                 <include name="error.xhtml"/>
473                                 <include name="jspRedirector.jsp"/>
474                                 <include name="webkell.xhtml"/>
475                                 <include name="WEB-IN*/**"/>
476                                 <include name="META-IN*/**"/>
477                         </fileset>
478                 </move>
479                 
480                 <copy tofile="build/cactus/WEB-INF/web.xml" file="lib/web.cactus.xml" overwrite="true"/>
481                 <delete file="build/cactus/webkell-cactus.war" />
482                 <jar destfile="build/webkell-cactus.war" basedir="build/cactus/" />
483                 <!-- END -->
484                 
485                 
486                 <copy todir="${tomcat.home}/webapps/" 
487                         file="build/webkell-cactus.war" />
488                 
489         </target>
490         <target name="hello" depends="init" >
491                 
492                 <!-- create temporary directory to copy war -->
493                 <mkdir dir="build/cactus" />
494                 <copy todir="build/cactus" file="build/webkell-cactus.war" />
495                 
496                 <!-- extract war -->
497                 <exec executable="jar">
498                         <arg value="-xvf"/>
499                         <arg value="build/cactus/webkell-cactus.war"/>
500                 </exec>
501                 
502                 <!-- put extracted war to 'build/cactus' dir -->
503                 <move todir="build/cactus/" >
504                         <fileset dir=".">
505                                 <include name="error.xhtml"/>
506                                 <include name="jspRedirector.jsp"/>
507                                 <include name="webkell.xhtml"/>
508                                 <include name="WEB-IN*/**"/>
509                                 <include name="META-IN*/**"/>
510                         </fileset>
511                 </move>
512                 
513                 <copy tofile="build/cactus/WEB-INF/web.xml" file="lib/web.cactus.xml" overwrite="true"/>
514                 <delete file="build/cactus/webkell-cactus.war" />
515                 <jar destfile="build/webkell-cactus.war" basedir="build/cactus/" />
516                 
517         </target>
518         
519         <target name='cactus-run' depends='cactus-deploy' >
520                 
521                 <property name="CATALINA_HOME" value="${tomcat.home}" /> 
522                 <property name="CATALINA_BASE" value="${tomcat.home}" /> 
523                 <property name="CATALINA_TMPDIR" value="${tomcat.home}/temp" /> 
524                 <exec executable="${tomcat.home}/bin/setclasspath.sh">
525                 </exec> 
526                 
527                 <cactus warfile="/Users/timothyw/Projects/Bookkeeping/build/webkell-cactus.war"
528                 printsummary="yes" failureproperty="tests.failed">
529                         
530                         <cactusproperty server="false" propertiesFile="build.properties"/>
531                         <classpath >
532                                 <path refid="bookkeeping.classpath"/>
533                         </classpath>
534                         
535                         <containerset>
536                         <cargo containerId="tomcat5x" output="${logs.dir}/output.log" log="${logs.dir}/cargo.log" home="${tomcat.home}">
537                             <configuration>
538                                 <property name="cargo.servlet.port" value="${cargo.servlet.port}"/>
539                                 <property name="cargo.logging" value="${cargo.logging}"/>
540                                 <deployable type="${cactus.sample.archive.type}" file="${cactified.servlet.archive.name}"/>
541                             </configuration>
542                         </cargo>
543                         <!-- <tomcat5x dir="${tomcat.home}" port="8070" /> -->  
544                         </containerset>
545                         
546                         <formatter type="xml"/>
547                         <batchtest>
548                         <fileset dir="${dir.test.src}">
549                                 <!-- <include name="**/CactusTests.java"/> --> 
550                                 <exclude name="**/TestAll.java"/>
551                         </fileset>
552                         </batchtest>
553                 </cactus>
554         </target>
555         
556         
557         <target name='run-class' depends='compile-src' > 
558                 
559                 
560                 <java classname="com.interrupt.bookkeeping.cc.bkell.Bkell" classpathref="bookkeeping.classpath" fork='true' >
561                         
562                         <classpath>
563                                 <pathelement path="${dir.build}/test" />
564                                 <pathelement path="${dir.build}/gen" />
565                                 <pathelement path="${dir.build}/src" />
566                                 <pathelement path="xml" />
567                                 <fileset dir="${java.home}/lib" >
568                                         <include name="**/*.jar"/>
569                                 </fileset>
570                                 <fileset dir="lib">
571                                         <include name="**/*.jar" />
572                                         <include name="**/*.properties"/>
573                                 </fileset>
574                         </classpath>
575                 </java>
576                 
577                 
578                 <!-- <java classname="com.interrupt.persistence.xml.Spittoon" fork="true" >
579                         
580                         <sysproperty key="db.url" value="xmldb:exist:///db/bookkeeping/" />
581                         <sysproperty key="exist.initdb" value="true" />
582                         <sysproperty key="exist.home" value="." />
583                         
584                         <classpath>
585                                 <pathelement path="${dir.build}/gen" />
586                                 <pathelement path="${dir.build}/src" />
587                                 <pathelement path="${dir.build}/test" />
588                                 <pathelement path="lib/" />
589                                 <pathelement path="xml/" />
590                                 <pathelement path="xml/http/" />
591                                 <pathelement path="grammar" />
592                                 <pathelement path="." />
593                                 <fileset dir="lib">
594                                         <include name="**/*.jar" />
595                                         <include name="**/*.properties"/>
596                                 </fileset>
597                                 <fileset dir="${java.home}/lib" >
598                                         <include name="*.jar"/>
599                                 </fileset>
600                         </classpath>
601                 </java>
602                 --> 
603                 
604                 <!-- <java classname="com.interrupt.bookkeeping.http.BookkeepingSystemFacade" fork="true" >
605                 <java classname="com.interrupt.bookkeeping.Deleteme" fork="true" >
606                         
607                         <sysproperty key="db.url" value="xmldb:exist:///db/bookkeeping/" />
608                         <sysproperty key="exist.initdb" value="true" />
609                         <sysproperty key="exist.home" value="." />
610                         
611                         <classpath>
612                                 <pathelement path="${dir.build}/gen" />
613                                 <pathelement path="${dir.build}/src" />
614                                 <pathelement path="${dir.build}/test" />
615                                 <pathelement path="lib/" />
616                                 <pathelement path="xml/" />
617                                 <pathelement path="xml/http/" />
618                                 <pathelement path="test/bk/" />
619                                 <pathelement path="test/xml/" />
620                                 <pathelement path="test/xml/http/" />
621                                 <pathelement path="." />
622                                 <fileset dir="lib">
623                                     <include name="**/*.jar" />
624                                     <include name="**/*.properties"/>
625                                 </fileset>
626                                 <fileset dir="${java.home}/lib" >
627                                     <include name="**/*.jar"/>
628                                 </fileset>
629                         </classpath>
630                 </java>
631                 --> 
632                 
633         </target> 
634         
635         
636     <target name="run-docs" depends="compile-gen" >
637         
638         <javadoc destdir="doc/api" 
639             windowtitle="Bookkeeping API" 
640             sourcepath="src/:gen/"
641             classpathref="bookkeeping.classpath" >
643             <package name="com.interrupt.bookkeeping" />
644             <package name="com.interrupt.bookkeeping.account" />
645             <package name="com.interrupt.bookkeeping.action" />
646                 
647                 <package name="com.interrupt.bookkeeping.cc" />
648                 <package name="com.interrupt.bookkeeping.cc.bkell" />
649                 <package name="com.interrupt.bookkeeping.cc.bkell.command" />
650                 <package name="com.interrupt.bookkeeping.cc.executor" />
651                 <package name="com.interrupt.bookkeeping.cc.analysis" />
652                 <package name="com.interrupt.bookkeeping.cc.lexer" />
653                 <package name="com.interrupt.bookkeeping.cc.parser" />
654                 <package name="com.interrupt.bookkeeping.cc.node" />
655                 
656                 <!-- DELETE 'node' package 
657                 <package name="com.interrupt.bookkeeping.cc.node" />
658                 --> 
659                 
660                 <package name="com.interrupt.bookkeeping.exception" />
661             <package name="com.interrupt.bookkeeping.http" />
663                 <!-- DELETE 'interpreter' package 
664                 <package name="com.interrupt.bookkeeping.interpreter" />
665                 --> 
666                 
667             <package name="com.interrupt.bookkeeping.journal" />
668             <package name="com.interrupt.bookkeeping.system" />
669                 <package name="com.interrupt.bookkeeping.users" />
670                 <package name="com.interrupt.bookkeeping.util" />
671             <package name="com.interrupt.bookkeeping.workflow" />
672             <package name="com.interrupt.persistence" />
673             <package name="com.interrupt.persistence.or" />
674             <package name="com.interrupt.persistence.xml" />
675         </javadoc>
676     </target>
677     
678     
679     <!-- =============================== -->
680     <!-- DEPLOY targets                 -->
681     <!-- =============================== -->
682     
683         <target name="release" depends="compile-src" >
684                 
685                 <!-- jar main classes. Jar dependencies and properties files should be zipped into a lib directory
686                 -->
687                 <jar destfile="${dir.build}/bookkeeping.jar" >
688                         
689                         <fileset dir="${dir.build}/gen" includes="**/*.class" />
690                         <fileset dir="${dir.build}/gen" includes="**/*.dat" />
691                         <fileset dir="${dir.build}/src" includes="**/*.class" />
692                         <manifest >
693                                 <attribute name="Main-Class" value="com.interrupt.bookkeeping.cc.bkell.Bkell" />
694                                 <attribute name="Class-Path" value="${dir.lib}/Piccolo.jar  ${dir.lib}/commons-cli-1.0.jar  ${dir.lib}/commons-logging-api.jar  ${dir.lib}/javafind.jar  ${dir.lib}/commons-logging.jar  ${dir.lib}/bob.jar  ${dir.lib}/sablecc.jar  ${dir.lib}/log4j-1.2.7.jar  ${dir.lib}/velocity-1.3.1.jar  ${dir.lib}/velocity-dep-1.3.1.jar  ${dir.lib}/exist-optional.jar  ${dir.lib}/exist-modules.jar  ${dir.lib}/exist.jar  ${dir.lib}/xmldb.jar ${dir.lib}/xmlrpc-1.2-patched.jar " />
695                         </manifest>
696                 </jar>
697                 
698                 
699         </target> 
700         
701         <target name="release-war" depends="init, release" > 
702                 
703                 <echo message="Making webkell.war" />
704                 
705                 <!-- copy libs to a tempporary flattened directory --> 
706                 <mkdir dir="temp" /> 
707                 
708                 <copy file="/Users/timothyw/Tools/eXist-Aauth/conf.xml" tofile="temp/confAauth.xml" flatten="true" /> 
709                 <copy file="/Users/timothyw/Tools/eXist-Groups/conf.xml"  tofile="temp/confGroups.xml" flatten="true" />
710                 <copy todir="temp" flatten="true" > 
711                                 
712                         <fileset dir="." >
713                                 
714                                 <include name="confAauth.xml"/>
715                                 <!-- <include name="confGroups.xml"/>
716                                 -->
717                                 <include name="xml/bookkeeping.system.xml"/>
718                         </fileset>
719                         <fileset dir="${dir.lib}" >
720                                 <include name="**/*.jar"/>
721                                 <include name="**/*.properties"/>
722                                 <exclude name="**/spittoon.properties" />
723                                 <exclude name="**/*servlet*.jar" />
724                         </fileset>
725                 </copy> 
726                 <move file="temp/spittoon.web.properties" tofile="temp/spittoon.properties"/>
728                 <war destfile="${dir.build}/webkell.war" webxml="${dir.lib}/web.xml" >
729                         
730                         <fileset dir="webkell" includes="*.xhtml" />
731                         
732                         <!-- <fileset dir="lib" includes="exist-data/**" /> -->
733                         <zipfileset file="dataGroups/**"
734                                 prefix="WEB-INF/lib/dataGroups" />
735                         <zipfileset file="dataAauth/**"
736                                 prefix="WEB-INF/lib/dataAauth" />
737                         
738                         <zipfileset file="xml/*.xml"
739                                 prefix="WEB-INF/xml" />
740             
741                         <!-- <webinf ><includesfile name="lib/exist.conf.xml"/></webinf> 
742                         <zipfileset file="lib/exist-conf.xml"
743                             prefix="WEB-INF"/>
744                         -->
745                         <classes dir="${dir.build}/gen" includes="**/*.class" />
746                         <classes dir="${dir.build}/gen" includes="**/*.dat" />
747                         <classes dir="${dir.build}/src" includes="**/*.class" />
748                         <classes dir="temp" includes="*.properties" />
749                         
750                         <classes dir="${dir.build}/test" includes="**/TestBookkeepingServlet.class" />
751                         
752                         
753                         <!-- ** TODO Find a better place to put this. an 'xml' directory that can be added to the classpath --> 
754                         <classes dir="test/xml/http" includes="**/*.xml" />
755                         <classes dir="xml" file="xml/bookkeeping.system.xml" />
756                         
757                         
758                         <!-- test classes to include in war 
759                         <classes dir="${dir.build}/test" includes="**/*.class" />
760                         -->
761                         
762                         <!-- <lib dir="lib" fullpath="WEB-INF/lib" > -->
763                         <lib dir="temp" >
764                                 <include name="**/*.jar"/>
765                                 <!-- <include name="**/*.properties"/> -->
766                                 <include name="confAauth.xml" />
767                                 <include name="confGroups.xml" />
768                                 <!-- <include name="bookkeeping.system.xml"/> --> 
769                                 <exclude name="**/*servlet*.jar" />
770                         </lib>
771                         <manifest >
772                                 <attribute name="Class-Path" value="lib/cactus lib/endorsed lib/htmlunit lib/ xml/" />
773                         </manifest>
774                 </war>
775                 
776         </target> 
777         <target name="deploy-war" depends="release-war" > 
778                 
779                 <echo message="Deploying webkell.war" />
780                 <delete dir="${tomcat.home}/webapps/webkell" failonerror="false" />
781                 <delete file="${tomcat.home}/webapps/webkell.war" failonerror="false" />
782                 <copy file="${dir.build}/webkell.war" todir="${tomcat.home}/webapps" /> 
783                 
784         </target>
785         
786         <!-- <target name="cactus-war" depends="init, release-war" > 
787                 
788                 <echo message="Updating 'webkell.war' for cactus" />
789                 
790                 <!- Adding cactus specific war file ->
791                 <war destfile="${dir.build}/webkell.war" webxml="${dir.lib}/web.cactus.xml" update="true" />
792                 
793         </target> 
794         -->
795         
796         <target name="release-scratch" depends="init" >
797                 
798                 <!-- jar main classes. Jar dependencies and properties files should be zipped into a lib directory
799                 -->
800                 <jar destfile="${dir.build}/bookkeeping.jar" >
801                         
802                         <fileset dir="${dir.build}/gen" includes="**/*.class" />
803                         <fileset dir="${dir.build}/gen" includes="**/*.dat" />
804                         <fileset dir="${dir.build}/src" includes="**/*.class" />
805                         <fileset dir="." includes="xml/*.xml" />
806                         <manifest >
807                                 <attribute name="Main-Class" value="com.interrupt.bookkeeping.cc.bkell.Bkell" />
808                                 <attribute name="Class-Path" value="${dir.lib}/Piccolo.jar  ${dir.lib}/commons-cli-1.0.jar  ${dir.lib}/commons-logging-api.jar  ${dir.lib}/javafind.jar  ${dir.lib}/commons-logging.jar  ${dir.lib}/bob.jar  ${dir.lib}/sablecc.jar  ${dir.lib}/log4j-1.2.7.jar  ${dir.lib}/velocity-1.3.1.jar  ${dir.lib}/velocity-dep-1.3.1.jar  ${dir.lib}/exist-optional.jar  ${dir.lib}/exist-modules.jar  ${dir.lib}/exist.jar  ${dir.lib}/xmldb.jar ${dir.lib}/xmlrpc-1.2-patched.jar xml/ " />
809                         </manifest>
810                 </jar>
811                 
812                 
813         </target> 
814     
815     
816 </project>