source: trunk/build.xml @ 5631

Last change on this file since 5631 was 5631, checked in by Nicklas Nordborg, 12 years ago

References #1597: Subtypes of items

Added support for subtypes with related subtypes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 49.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 5631 2011-05-16 12:56:23Z nicklas $
4
5    Copyright (C) 2005 Samuel Andersson, Johan Enell, Jari Häkkinen, Nicklas Nordborg, Gregory Vincic
6    Copyright (C) 2006, 2007 Johan Enell, Jari Häkkinen, Nicklas Nordborg, Martin Svensson
7
8    This file is part of BASE - BioArray Software Environment.
9    Available at http://base.thep.lu.se/
10
11    BASE is free software; you can redistribute it and/or modify it
12    under the terms of the GNU General Public License as published by
13    the Free Software Foundation; either version 3 of the License, or
14    (at your option) any later version.
15
16    BASE is distributed in the hope that it will be useful, but
17    WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with BASE. If not, see <http://www.gnu.org/licenses/>.
23-->
24
25<project
26  name="BASE"
27  default="dev"
28  basedir="."
29  >
30  <description>
31    Build file for BASE. The main targets are ('dev' is default):
32
33    Clean up:
34    clean:        Remove all generated files
35
36    Compiling code
37    core:         Build core for local use
38    coreplugins:  Build core plugins for local use
39    dev:          Build everything for local use
40    dist:         Build everything (except test) for distribution (put in 'dist'
41                  subdirectory)
42    installprg:   Build installation programs for local use
43    jobagent:     Build jobagent for local use
44    webservices:  Build webservices for local use
45    test:         Build test programs
46    web:          Build web client application for local use
47   
48    Documentation:
49    doc:          Build documentation for local use
50    doc.javadoc:  Build javadoc for local use
51    doc.docbook:  Build docbook documentation for local use
52    helptext:     Generate help text import file from the docbook documentation
53
54    Packaging:
55    package:          Create *.tar.gz files with binary, source and exampele distributions
56    package.bin       Create binary distribution only
57    package.src       Create source distribution only
58  </description>
59
60  <!-- set BASE version
61    Use numerical versions for bugfix (maintenance) releases starting
62    with "1". Use "0" for the first release of a new trunk version.  Set
63    "base.versionsuffix" to "-dev" for unreleased versions. Examples: 2.1.1-dev, 2.1.1,
64    2.1.2-dev, 2.2.2, 2.2.0-dev, 2.2.0, 2.2.1-dev, 2.2.1
65  -->
66  <property name="base.majorversion" value="3" />
67  <property name="base.minorversion" value="0" />
68  <property name="base.maintenanceversion" value="0" />
69  <property name="base.versionsuffix" value="-dev" />
70  <property name="base.version" 
71    value="${base.majorversion}.${base.minorversion}.${base.maintenanceversion}" />
72 
73  <!-- set other global properties for this build -->
74  <property name="javac.arg" value="-Xlint:unchecked" 
75    description="Extra arguments sent to Java compiler" />
76  <property name="javac.source" value="1.6"
77    description="Default value for the 'source' attribute when compiling java code" />
78  <property name="javac.target" value="1.6"
79    description="Default value for the 'target' attribute when compiling java code" />
80  <property name="javac.encoding" value="UTF-8"
81    description="Default value for the 'encoding' attribute when compiling java code" />
82  <property name="src" location="src" description="Location of source files" />
83  <property name="build" location="build" description="Location of compiled files" />
84  <property name="dist" location="dist" description="Directory where distribution should be created" />
85  <property name="package" location="package" description="Directory where packaged distribution files are created"/>
86  <property name="lib" location="lib" description="Location of 3rd-party JAR files" />
87  <property name="config.dist" location="config/dist" 
88    description="Location of default configuration files" />
89  <property name="config.local" location="config/local" 
90    description="Location of local configuration files" />
91 
92  <!-- classpaths to library files -->
93  <path id="lib.dist.classpath">
94    <fileset dir="${lib}/dist">
95      <include name="**/*.jar"/>
96    </fileset>
97  </path>
98
99  <path id="lib.webservices.classpath">
100    <fileset dir="${lib}/webservices">
101      <include name="**/*.jar"/>
102    </fileset>
103  </path>
104 
105  <path id="lib.svn.classpath">
106    <fileset dir="${lib}/svn">
107      <include name="**/*.jar"/>
108    </fileset>
109  </path>
110 
111  <path id="lib.hibernatedoclet.classpath">
112    <fileset dir="${lib}/hibernatedoclet">
113      <include name="**/*.jar"/>
114    </fileset>
115  </path>
116 
117  <path id="lib.servlet.classpath">
118    <fileset dir="${lib}/servlet">
119      <include name="**/*.jar"/>
120    </fileset>
121  </path>
122 
123  <!-- pattern for configuration files use by copy.config -->
124  <patternset id="config.files">
125    <include name="**/*.*" />
126    <exclude name="web.xml" />
127    <exclude name="readme.txt" />
128  </patternset>
129 
130  <!-- task definitions -->
131  <taskdef
132    name="hibernatedoclet"
133    classname="xdoclet.modules.hibernate.HibernateDocletTask"
134    description="Task for generating Hibernate mapping files from XDoclet tags"
135    >
136    <classpath>
137      <path refid="lib.hibernatedoclet.classpath" />
138    </classpath>
139  </taskdef>
140
141  <taskdef
142    name="svn"
143    classname="org.tigris.subversion.svnant.SvnTask"
144    description="Task for interacting with subversion"
145    >
146    <classpath>
147      <path refid="lib.svn.classpath" />
148    </classpath>
149  </taskdef>
150 
151  <taskdef
152    name="java2WSDL"
153    classname="org.apache.ws.java2wsdl.Java2WSDLTask"
154    description="Task for creating wsdl files for the web services"
155    >
156    <classpath>
157      <path refid="lib.dist.classpath" />
158      <path refid="lib.webservices.classpath" />
159      <pathelement location="config/local" />
160      <pathelement location="config/dist" />
161    </classpath>
162  </taskdef>
163 
164  <!-- main targets -->
165  <target
166    name="clean"
167    description="Remove all generated files and backup files" >
168    <delete failonerror="false" includeemptydirs="true">
169      <fileset dir="${build}" defaultexcludes="no" />
170      <fileset dir="${dist}" defaultexcludes="no" />
171      <fileset dir="${package}" defaultexcludes="no" />
172      <fileset dir="bin/jar" defaultexcludes="no" />
173      <fileset dir="misc/wsdl" defaultexcludes="no" />
174      <fileset dir="www/WEB-INF/lib" defaultexcludes="no" />
175      <fileset dir="www/WEB-INF/classes" defaultexcludes="no" />
176      <fileset dir="www/WEB-INF/conf" defaultexcludes="no" />
177      <fileset dir="www/WEB-INF/services" defaultexcludes="no" />
178      <fileset dir="www/WEB-INF" includes="web.xml" defaultexcludes="no" />
179      <fileset dir="doc/api" defaultexcludes="no" />
180      <fileset dir="doc/html" defaultexcludes="no" />
181      <fileset file="doc/base.pdf" />
182      <fileset file="data/helptexts.xml" />
183    </delete>
184  </target>
185 
186  <target
187    name="dist"
188    depends="clean,dist.init,core.jar,coreplugins.jar,web.jar,xjspcompiler,webservices.jar,webservices.wsdl,
189      installprg.jar,jobagent.jar,copy.config,copy.jar,doc,doc.dist"
190    description="Create everything needed for distribution"
191    >
192    <copy file="${config.dist}/web.xml" todir="${config}/.." description="Default web.xml" />
193    <copy todir="${dist}/www" description="JSP files, etc.">
194      <fileset dir="www" />
195    </copy>
196    <copy todir="${dist}/data" description="Additional data files">
197      <fileset dir="data" />
198    </copy>
199    <copy todir="${dist}/bin" description="Scripts, etc.">
200      <fileset dir="bin">
201      </fileset>
202    </copy>
203    <copy todir="${dist}/misc" description="Other files">
204      <fileset dir="misc">
205        <include name="sql/**/*" />
206        <include name="config/**/*" />
207        <include name="wsdl/**/*" />
208      </fileset>
209    </copy>
210    <copy todir="${dist}" description="License and credits">
211      <fileset file="base.license.txt" />
212      <fileset file="credits.txt" />
213    </copy>
214    <chmod dir="." includes="**/*.sh" perm="a+x" description="Make all scripts executable" />
215  </target>
216
217  <target
218    name="package"
219    depends="package.bin,package.src"
220    description="Generate tar.gz files for the binary and source distribution"
221    >
222  </target>
223 
224  <target
225    name="dev"
226    depends="dev.init,core,coreplugins,web,webservices,installprg,jobagent,test"
227    description="Create a runnable local installation"
228  />
229 
230  <target
231    name="core"
232    depends="dev.init,core.jar"
233    description="Build the core for local use"
234  />
235
236  <target
237    name="coreplugins"
238    depends="core,coreplugins.jar"
239    description="Build the core plugins for local use"
240  />
241 
242  <target
243    name="test"
244    depends="test.jar,core.hibernate"
245    description="Compile the test programs for local use"
246    >
247    <mkdir dir="${test.build}/data" />
248    <copy todir="${test.build}/data" description="Test-data files">
249      <fileset dir="${test.src}/data">
250        <include name="**/*" />
251      </fileset>
252    </copy>
253    <copy todir="${test.build}" description="Script files, etc.">
254      <fileset dir="${test.src}">
255        <include name="**/*" />
256        <exclude name="**/*.java" />
257      </fileset>
258    </copy>
259    <chmod dir="${test.build}" includes="*.sh" perm="a+x"/>
260  </target>
261 
262  <target
263    name="web"
264    depends="core,coreplugins,web.jar,xjspcompiler,copy.config,copy.jar"
265    description="Build web client application for local use"
266    >
267  </target>
268 
269  <target
270    name="webservices"
271    depends="core,web,webservices.jar,webservices.wsdl"
272    description="Build webservices for local use"
273  />
274 
275  <target
276    name="installprg"
277    depends="core,web,installprg.jar"
278    description="Build installation programs for local use"
279  />
280 
281  <target
282    name="jobagent"
283    depends="core,web,jobagent.jar"
284    description="Build job agent for local use"
285  />
286 
287  <target
288    name="doc"
289    depends="doc.javadoc,doc.docbook"
290    description="Generate documentation (javadoc and docbook) for local use and distribution"
291  />
292 
293  <!-- init targets -->
294  <target
295    name="init"
296    depends="svn.revision"
297    description="Initialise things"
298    >
299  </target>
300 
301  <target
302    name="dist.init"
303    depends="init"
304    unless="isDev"
305    >
306    <property name="isDist" value="1" />
307    <property name="jar" location="${dist}/www/WEB-INF/lib" />
308    <property name="config" location="${dist}/www/WEB-INF/classes" />
309    <property name="bin" location="${dist}/bin" />
310    <property name="doc" location="${dist}/doc" />
311    <property name="plugins" location="${dist}/plugins" />
312    <mkdir dir="${jar}" />
313    <mkdir dir="${config}" />
314    <mkdir dir="${bin}" />
315    <mkdir dir="${bin}/jar" />
316    <mkdir dir="${dist}/data" />
317    <mkdir dir="${dist}/doc" />
318    <mkdir dir="${dist}/misc" />
319  </target>
320 
321  <target
322    name="dev.init"
323    depends="init"
324    unless="isDist"
325    >
326    <property name="isDev" value="1" />
327    <property name="jar" location="www/WEB-INF/lib" />
328    <property name="config" location="www/WEB-INF/classes" />
329    <property name="bin" location="bin" />
330    <property name="doc" location="doc" />
331    <property name="plugins" location="plugins" />
332    <mkdir dir="${bin}/jar" />
333    <mkdir dir="${jar}" />
334    <mkdir dir="${config}" />
335  </target>
336 
337  <target 
338    name="svn.revision"
339    description="Get the current revision number in the subversion and put the
340      value into the base.build property; replaced by constant expression in source distributions"
341    >
342    <svn>
343      <status path="." lastChangedRevisionProperty="base.build" />
344    </svn>
345    <echo message="Build #${base.build}" />
346  </target>
347 
348  <!-- configuration targets -->
349  <target
350    name="copy.config"
351    depends="copy.config.local,copy.config.dist"
352    description="Copies configuration files to the appropriate folder"
353    >
354    <!-- move axis2.xml to the correct place -->
355    <mkdir dir="${config}/../conf" />
356    <move file="${config}/axis2.xml" todir="${config}/../conf" overwrite="true" />
357  </target>
358   
359  <target
360    name="copy.config.dist"
361    >
362    <copy todir="${config}" description="Default configuration files">
363      <fileset dir="${config.dist}">
364        <patternset refid="config.files" />
365        <present present="srconly" targetdir="${config}" />
366      </fileset>
367    </copy>
368    <copy todir="${config}/.."  description="Default web.xml">
369      <fileset dir="${config.dist}">
370        <include name="web.xml" />
371        <present present="srconly" targetdir="${config}/.." />
372      </fileset>
373    </copy>
374  </target>
375 
376  <target
377    name="copy.config.local"
378    if="isDev"
379    unless="isDist"
380    >
381    <copy todir="${config}" description="Local configuration files">
382      <fileset dir="${config.local}">
383        <patternset refid="config.files" />
384      </fileset>
385    </copy>
386    <copy todir="${config}/.."  description="Local web.xml">
387      <fileset dir="${config.local}">
388        <include name="web.xml" />
389      </fileset>
390    </copy>
391  </target>
392 
393  <target
394    name="copy.jar"
395    description="Copy required jar files to the appropriate folder"
396    >
397    <copy todir="${jar}" description="3rd-party JAR files">
398      <fileset dir="${lib}/dist">
399        <include name="**/*" />
400      </fileset>
401      <fileset dir="${lib}/webservices">
402        <include name="**/*" />
403      </fileset>
404    </copy>
405  </target>
406
407  <!-- info targets -->
408  <target 
409    name="info.init"
410    >
411    <property name="info.src" location="${src}/info" 
412      description="Location of info.* source files" />
413    <property name="info.build" location="${build}/info" 
414      description="Location of compiled info.* files" />
415  </target>
416 
417  <target 
418    name="info.compile"
419    depends="info.init"
420    description="Compile the info.* classes"
421    >
422    <mkdir dir="${info.build}"/>
423    <javac
424      srcdir="${info.src}"
425      destdir="${info.build}"
426      encoding="${javac.encoding}"
427      debug="true"
428      deprecation="true"
429      source="${javac.source}"
430      target="${javac.target}"
431      includeantruntime="false"
432      >
433      <compilerarg value="${javac.arg}" />
434    </javac>
435  </target>
436 
437  <!-- core targets -->
438  <target
439    name="core.init"
440    depends="dev.init,info.init"
441    >
442    <property name="core.src" location="${src}/core" 
443      description="Location of core source files" />
444    <property name="core.build" location="${build}/core" 
445      description="Location of compiled core files" />
446    <path id="core.classpath">
447      <path refid="lib.dist.classpath" />
448      <pathelement location="${info.build}" />
449    </path>
450  </target>
451 
452  <target
453    name="core.compile"
454    depends="core.init,info.compile"
455    description="Compile the core"
456    >
457    <mkdir dir="${core.build}"/>
458    <javac
459      srcdir="${core.src}"
460      destdir="${core.build}"
461      classpathref="core.classpath"
462      encoding="${javac.encoding}"
463      debug="true"
464      deprecation="true"
465      source="${javac.source}"
466      target="${javac.target}"
467      includeantruntime="false"
468      >
469      <compilerarg value="${javac.arg}" />
470    </javac>
471    <copy todir="${core.build}" 
472      description="Resource files needed by the core; excludes documentation and source files">
473      <fileset dir="${core.src}">
474        <include name="**/*" />
475        <exclude name="**/*.java" />
476        <exclude name="**/doc-files/" />
477        <exclude name="**/package.html" />
478      </fileset>
479    </copy>
480    <replace file="${core.build}/base.version">
481      <replacefilter 
482        token="@MAJOR@"
483        value="${base.majorversion}"
484      />
485      <replacefilter 
486        token="@MINOR@"
487        value="${base.minorversion}"
488      />
489      <replacefilter 
490        token="@MAINTENANCE@"
491        value="${base.maintenanceversion}"
492      />
493      <replacefilter 
494        token="@BUILD@"
495        value="${base.build}"
496      />
497      <replacefilter 
498        token="@SUFFIX@"
499        value="${base.versionsuffix}"
500      />
501    </replace>
502    <replaceregexp 
503      file="${core.build}/core-extensions.xml"
504      match="&lt;version&gt;.*&lt;/version&gt;"
505      replace="&lt;version&gt;${base.version}${base.versionsuffix}&lt;/version&gt;"
506      encoding="UTF-8"
507    />
508  </target>
509
510  <target
511    name="check.hibernate"
512    depends="core.init"
513    >
514    <uptodate
515      property="nohibernate"
516      >
517      <srcfiles dir="${core.src}/net/sf/basedb/core/data" includes="**/*.java">
518        <contains text="@hibernate.class" />
519      </srcfiles>
520      <mapper type="glob" from="*.java" to="${core.build}/net/sf/basedb/core/data/*.hbm.xml" />
521    </uptodate>
522    <condition property="hibernate.message" 
523      value="up to date; skipping" 
524      >
525      <istrue value="${nohibernate}" />
526    </condition>
527    <condition property="hibernate.message" 
528      value="not up to date; generating new" 
529      >
530      <isfalse value="${nohibernate}" />
531    </condition>
532    <echo>Hibernate mapping files are ${hibernate.message}</echo>
533  </target>
534 
535  <target
536    name="core.hibernate"
537    depends="core.init,core.compile,check.hibernate"
538    description="Generates Hibernate mapping files from the source code"
539    unless="nohibernate"
540    >
541    <delete>
542      <fileset dir="${core.build}" includes="**/*.hbm.xml" />
543    </delete>
544    <copy todir="${core.build}" 
545      description="Hardcoded *.hbm.xml files">
546      <fileset dir="${core.src}" includes="**/*.hbm.xml" />
547    </copy>
548    <hibernatedoclet
549      destdir="${core.build}"
550      excludedtags="@version,@author,@todo"
551      mergedir="${core.build}"
552      verbose="${xdoclet.verbose}">
553      <fileset dir="${core.src}">
554        <include name="net/sf/basedb/core/data/**/*.java"/>
555      </fileset>
556      <hibernate version="2.0"/>
557    </hibernatedoclet>
558   
559    <replace
560      dir="${core.build}"
561      >
562      <include name="**/*.hbm.xml"/>
563      <replacefilter 
564        token="-//Hibernate/Hibernate Mapping DTD 2.0//EN"
565        value="-//Hibernate/Hibernate Mapping DTD 3.0//EN"
566      />
567      <replacefilter 
568        token="http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"
569        value="http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
570      />
571      <replacefilter
572        token="outer-join=&#34;false&#34;"
573        value="fetch=&#34;select&#34;"
574      />
575      <replacefilter
576        token="outer-join=&#34;true&#34;"
577        value="fetch=&#34;join&#34;"
578      />
579      <replacefilter
580        token="index-many-to-many"
581        value="map-key-many-to-many"
582      />
583      <replacefilter
584        token="&lt;index&gt;"
585        value="&lt;list-index&gt;"
586      />
587      <replacefilter
588        token="&lt;/index&gt;"
589        value="&lt;/list-index&gt;"
590      />
591      <replacefilter
592        token="composite-index"
593        value="composite-map-key"
594      />
595    </replace>
596   
597    <!--
598      Move the mappings files for all Extendable classes
599      because we are going to add more tags to them at runtime
600    -->
601    <!--
602    <move
603      todir="${core.build}/net/sf/basedb/core/templates"
604      >
605      <fileset dir="${core.build}/net/sf/basedb/core/data">
606        <include name="ReporterData.hbm.xml"/>
607        <include name="UserData.hbm.xml"/>
608      </fileset>
609      <mapper type="glob" from="*.hbm.xml" to="hibernate-properties-*.xml" />
610    </move>
611    -->
612  </target>
613 
614  <target
615    name="core.jar"
616    depends="core.init,core.compile,core.hibernate"
617    description="Create the core jar file: base-core-a.b.c.jar"
618    >
619    <jar
620      basedir="${core.build}"
621      jarfile="${jar}/base-core-${base.version}.jar"
622    />
623  </target>
624
625  <!-- core plugin targets -->
626  <target
627    name="coreplugins.init"
628    depends="core.init"
629    >
630    <property name="coreplugins.src" location="${src}/plugins/core" 
631      description="Location of source files" />
632    <property name="coreplugins.build" location="${build}/plugins/core" 
633      description="Location of compiled files" />
634    <path id="coreplugins.classpath" description="Class path for compiling plugins">
635      <path refid="core.classpath"/>
636      <pathelement location="${core.build}"/>
637    </path>
638  </target>
639 
640  <target
641    name="coreplugins.compile"
642    depends="core.compile,coreplugins.init"
643    description="Compile the core plugins"
644    >
645    <mkdir dir="${coreplugins.build}" />
646    <javac
647      srcdir="${coreplugins.src}"
648      destdir="${coreplugins.build}"
649      classpathref="coreplugins.classpath"
650      encoding="${javac.encoding}"
651      debug="true"
652      deprecation="true"
653      source="${javac.source}"
654      target="${javac.target}"
655      includeantruntime="false"
656      >
657      <compilerarg value="${javac.arg}" />
658    </javac>
659    <copy todir="${coreplugins.build}" 
660      description="Resource files needed by the core plug-ins; excludes documentation and source files">
661      <fileset dir="${coreplugins.src}">
662        <include name="**/*" />
663        <exclude name="**/*.java" />
664        <exclude name="**/doc-files/" />
665        <exclude name="**/package.html" />
666      </fileset>
667    </copy>
668    <replaceregexp 
669      file="${coreplugins.build}/core-plugins.xml"
670      match="&lt;version&gt;.*&lt;/version&gt;"
671      replace="&lt;version&gt;${base.version}${base.versionsuffix}&lt;/version&gt;"
672      encoding="UTF-8"
673    />
674  </target>
675 
676  <target
677    name="coreplugins.jar"
678    depends="coreplugins.compile"
679    description="Create the plugin jar file: base-coreplugins-a.b.c.jar"
680    >
681    <jar
682      basedir="${coreplugins.build}"
683      jarfile="${jar}/base-coreplugins-${base.version}.jar"
684    />
685  </target>
686 
687  <!-- test targets -->
688  <target
689    name="test.init"
690    depends="core.init,coreplugins.init,jobagent.init,webservices.init"
691    >
692    <property name="test.src" location="${src}/test" 
693      description="Location of source files" />
694    <property name="test.build" location="${build}/test" 
695      description="Location of compiled files" />
696    <path id="test.classpath" description="Class path for compiling">
697      <path refid="core.classpath"/>
698      <path refid="lib.webservices.classpath" />
699      <pathelement location="${core.build}" />
700      <pathelement location="${coreplugins.build}" />
701      <pathelement location="${jobagent.build}" />
702      <pathelement location="${webservices.build}/server" />
703      <pathelement location="${webservices.build}/client" />
704    </path>
705  </target>
706 
707  <target
708    name="test.compile"
709    depends="test.init,core.compile,coreplugins.compile,jobagent.compile,webservices.compile"
710    description="Compile the test programs"
711    >
712    <mkdir dir="${test.build}" />
713    <javac
714      srcdir="${test.src}"
715      destdir="${test.build}"
716      classpathref="test.classpath"
717      encoding="${javac.encoding}"
718      debug="true"
719      deprecation="true"
720      source="${javac.source}"
721      target="${javac.target}"
722      includeantruntime="false"
723      >
724      <compilerarg value="${javac.arg}" />
725    </javac>
726  </target>
727 
728  <target
729    name="test.jar"
730    depends="test.compile"
731    description="Create a JAR file used by the test programs; Delete corresponding .class files"
732    >
733    <jar 
734      jarfile="${test.build}/JarPlugin.jar" 
735      basedir="${test.build}" 
736      includes="JarPlugin*,NullPlugin*,Base1*"
737      excludes="JarPlugin.jar"
738      manifest="${test.src}/data/JarPluginManifest.txt"
739      >
740    </jar>
741    <delete>
742      <fileset dir="${test.build}" includes="JarPlugin*.class" />
743    </delete>
744  </target>
745
746  <!-- web targets -->
747  <target
748    name="web.init"
749    depends="core.init,coreplugins.init"
750    >
751    <property name="web.src" location="${src}/clients/web" 
752      description="Location of source files" />
753    <property name="xjspcompiler.src" location="${src}/misc/compiler" />   
754    <property name="web.build" location="${build}/clients/web" 
755      description="Location of compiled files" />
756    <property name="web.inf" location="www/WEB-INF" 
757      description="Location of the WEB-INF folder" />
758    <path id="web.classpath" description="Class path for compiling web client">
759      <path refid="core.classpath"/>
760      <pathelement location="${core.build}"/>
761      <pathelement location="${coreplugins.build}" />
762      <path refid="lib.servlet.classpath" />
763    </path>
764  </target>
765 
766  <target
767    name="web.compile"
768    depends="web.init,core.compile,coreplugins.compile"
769    description="Compile the web client application"
770    >
771    <mkdir dir="${web.build}" />
772    <javac
773      srcdir="${web.src}"
774      destdir="${web.build}"
775      classpathref="web.classpath"
776      encoding="${javac.encoding}"
777      debug="true"
778      deprecation="true"
779      source="${javac.source}"
780      target="${javac.target}"
781      includeantruntime="false"
782      >
783      <compilerarg value="${javac.arg}" />
784    </javac>
785    <copy todir="${web.build}" 
786      description="Resource files needed by the web client; excludes documentation and source files">
787      <fileset dir="${web.src}">
788        <include name="**/*" />
789        <exclude name="**/*.java" />
790        <exclude name="**/doc-files/" />
791        <exclude name="**/package.html" />
792      </fileset>
793    </copy>
794    <replaceregexp 
795      file="${web.build}/web-extensions.xml"
796      match="&lt;version&gt;.*&lt;/version&gt;"
797      replace="&lt;version&gt;${base.version}${base.versionsuffix}&lt;/version&gt;"
798      encoding="UTF-8"
799    />
800  </target>
801 
802  <target
803    name="web.jar"
804    depends="web.compile"
805    description="Create the web client jar file: base-webclient-a.b.c.jar"
806    >
807    <jar
808      basedir="${web.build}"
809      jarfile="${jar}/base-webclient-${base.version}.jar"
810    />
811  </target>
812 
813  <target 
814    name="web.jsp"
815    depends="web"
816    description="Compile all JSP pages to a temporary directory; used for checking only"
817    >
818    <property name="jsp.build" location="${build}/jsp" />
819    <property environment="env" />
820    <delete dir="${jsp.build}" />
821    <mkdir dir="${jsp.build}/src" />
822    <mkdir dir="${jsp.build}/classes" />
823    <path id="jsp.precompile.classpath">
824      <pathelement location="${java.home}/../lib/tools.jar" />
825      <fileset dir="${env.CATALINA_HOME}">
826        <include name="lib/*.jar" />
827      </fileset>
828      <fileset dir="${env.CATALINA_HOME}/bin">
829        <include name="*.jar" />
830      </fileset>
831    </path>
832   
833    <path id="jsp.compile.classpath">
834      <path refid="jsp.precompile.classpath" />
835      <fileset dir="${web.inf}/lib">
836        <include name="*.jar" />
837      </fileset>
838      <pathelement location="${info.build}" />
839    </path>
840
841    <taskdef
842      classname="org.apache.jasper.JspC" 
843      name="jasper2"
844      classpathref="jsp.precompile.classpath"
845    />
846    <jasper2
847      validateXml="false"
848      uriroot="www"
849      webXmlFragment="${jsp.build}/generated_web.xml"
850      outputdir="${jsp.build}/src"
851      javaencoding="${javac.encoding}"
852     
853    />
854    <javac
855      destdir="${jsp.build}/classes"
856      srcdir="${jsp.build}/src"
857      debug="true"
858      classpathref="jsp.compile.classpath"
859      memoryinitialsize="256m"
860      memorymaximumsize="512m"
861      fork="true"
862      source="${javac.source}"
863      target="${javac.target}"
864      encoding="${javac.encoding}"
865      includeantruntime="false"
866      >
867    </javac>
868  </target>
869 
870  <!-- XJsp compiler targets -->
871  <target
872    name="xjspcompiler"
873    depends="web.compile,core.compile"
874    description="Compile the XJsp compiler and put JAR in ./bin/jar"
875    >
876    <mkdir dir="${build}/misc/compiler" />
877    <javac
878      srcdir="${xjspcompiler.src}"
879      destdir="${build}/misc/compiler"
880      classpathref="web.classpath"
881      encoding="${javac.encoding}"
882      debug="true"
883      deprecation="true"
884      source="${javac.source}"
885      target="${javac.target}"
886      includeantruntime="false"
887      >
888      <compilerarg value="${javac.arg}" />
889    </javac>
890    <jar
891      basedir="${build}/misc/compiler"
892      jarfile="${bin}/jar/base-xjsp-compiler-${base.version}.jar"
893    />
894  </target> 
895 
896  <!-- webservices targets -->
897  <target
898    name="webservices.init"
899    depends="core.init,coreplugins.init,web.init"
900    >
901    <property name="webservices.src" location="${src}/webservices" 
902      description="Location of source files" />
903    <property name="webservices.build" location="${build}/webservices" 
904      description="Location of compiled files" />
905    <property name="webservices.wsdlpath" location="misc/wsdl"
906      description="Location of created wsdl-files" />
907    <path id="webservices.server.classpath" 
908      description="Class path for compiling server part of webservices"
909      >
910      <path refid="lib.webservices.classpath" />
911      <path refid="core.classpath"/>
912      <pathelement location="${core.build}"/>
913      <pathelement location="${coreplugins.build}"/>
914      <pathelement location="${web.build}"/>
915    </path>
916    <path id="webservices.client.classpath" 
917      description="Class path for compiling client part of webservices"
918      >
919      <path refid="lib.webservices.classpath" />
920      <pathelement location="${info.build}"/>
921    </path>
922  </target>
923
924  <target
925    name="check.wsdl"
926    depends="webservices.init"
927    >
928    <uptodate
929      property="nowsdl"
930      >
931      <srcfiles dir="${webservices.src}/server" includes="**/*.java" />
932      <mapper type="merge" to="${webservices.wsdlpath}/SessionService.wsdl" />
933    </uptodate>
934    <condition property="wsdl.message" 
935      value="WSDL files are up to date; skipping" 
936      >
937      <istrue value="${nowsdl}" />
938    </condition>
939    <condition property="wsdl.message" 
940      value="WSDL files may not be up to date; generating new" 
941      >
942      <isfalse value="${nowsdl}" />
943    </condition>
944    <echo>${wsdl.message}</echo>
945  </target> 
946 
947  <target
948    name="webservices.compile"
949    depends="webservices.server.compile,webservices.client.compile"
950    description="Compile the core web services"
951    >
952  </target>
953 
954  <target
955    name="webservices.server.compile"
956    description="Compile the server part of webservices"
957    depends="webservices.init,core.compile,coreplugins.compile,web.compile"
958    >
959    <mkdir dir="${webservices.build}/server" />
960    <javac
961      destdir="${webservices.build}/server"
962      classpathref="webservices.server.classpath"
963      encoding="${javac.encoding}"
964      debug="true"
965      deprecation="true"
966      source="${javac.source}"
967      target="${javac.target}"
968      includeantruntime="false"
969      >
970      <src path="${webservices.src}/server" />
971      <compilerarg value="${javac.arg}" />
972    </javac>
973    <copy todir="${webservices.build}/server" 
974      description="Resource files needed by the webservices; excludes documentation and source files"
975      includeEmptyDirs="false"
976      >
977      <fileset dir="${webservices.src}/server">
978        <include name="**/*" />
979        <exclude name="**/*.java" />
980        <exclude name="**/doc-files/" />
981        <exclude name="**/package.html" />
982      </fileset>
983    </copy>
984  </target>
985
986  <target
987    name="webservices.client.compile"
988    description="Compile the client part of webservices"
989    depends="webservices.init,info.compile"
990    >
991    <mkdir dir="${webservices.build}/client" />
992    <javac
993      destdir="${webservices.build}/client"
994      classpathref="webservices.client.classpath"
995      encoding="${javac.encoding}"
996      debug="true"
997      deprecation="true"
998      source="${javac.source}"
999      target="${javac.target}"
1000      includeantruntime="false"
1001      >
1002      <src path="${webservices.src}/client/java" />
1003      <compilerarg value="${javac.arg}" />
1004    </javac>
1005  </target>
1006 
1007  <target 
1008    name="webservices.wsdl"
1009    description="Generate WSDL files for webservices"
1010    depends="check.wsdl,webservices.compile"
1011    unless="nowsdl"
1012    >
1013    <mkdir dir="${webservices.wsdlpath}" />
1014    <webservices.wsdl serviceClassName="ArrayDesignService"/>
1015    <webservices.wsdl serviceClassName="BioAssaySetService"/>
1016    <webservices.wsdl serviceClassName="ExperimentService"/>
1017    <webservices.wsdl serviceClassName="ProjectService"/>
1018    <webservices.wsdl serviceClassName="RawBioAssayService"/>
1019    <webservices.wsdl serviceClassName="SessionService"/>
1020    <webservices.wsdl serviceClassName="ReporterService"/>
1021    <webservices.wsdl serviceClassName="AnnotationTypeService"/>
1022  </target>
1023 
1024  <!-- Creates a WSDL file for a Webservice class -->
1025    <macrodef name="webservices.wsdl">
1026        <attribute name="serviceClassName"/>
1027        <sequential>
1028          <java2WSDL
1029        classpath="${webservices.build}/server;${info.build};${core.build}:${web.build}"
1030        className="net.sf.basedb.ws.server.@{serviceClassName}"
1031        outputLocation="${webservices.wsdlpath}"     
1032        serviceName="@{serviceClassName}"
1033        outputFileName="@{serviceClassName}.wsdl"
1034        >   
1035      </java2WSDL>   
1036        </sequential>
1037    </macrodef>
1038 
1039  <target
1040    name="webservices.jar"
1041    depends="webservices.compile"
1042    description="Create the core webservices aar file and client jar"
1043    >
1044    <mkdir dir="${config}/../services" />
1045    <!-- server side: core.aar -->
1046    <jar
1047      basedir="${webservices.build}/server"
1048      jarfile="${config}/../services/core.aar"
1049    />
1050    <!-- client side: base-webservices-client-a.b.c.jar -->
1051    <jar
1052      jarfile="${jar}/base-webservices-client-${base.version}.jar"
1053      >
1054      <fileset dir="${webservices.build}/client" />
1055      <fileset dir="${info.build}" />
1056    </jar>
1057  </target>
1058 
1059  <!-- installprg targets -->
1060  <target
1061    name="installprg.init"
1062    depends="core.init,coreplugins.init,web.init"
1063    >
1064    <property name="installprg.src" location="${src}/install" 
1065      description="Location of source files" />
1066    <property name="installprg.build" location="${build}/install" 
1067      description="Location of compiled files" />
1068    <path id="installprg.classpath" description="Class path for compiling installation programs">
1069      <path refid="core.classpath"/>
1070      <pathelement location="${core.build}"/>
1071      <pathelement location="${coreplugins.build}"/>
1072      <pathelement location="${web.build}"/>
1073    </path>
1074  </target>
1075  <target
1076    name="installprg.compile"
1077    depends="installprg.init,core.compile"
1078    description="Compile the installation programs"
1079    >
1080    <mkdir dir="${installprg.build}" />
1081    <javac
1082      srcdir="${installprg.src}"
1083      destdir="${installprg.build}"
1084      classpathref="installprg.classpath"
1085      encoding="${javac.encoding}"
1086      debug="true"
1087      deprecation="true"
1088      source="${javac.source}"
1089      target="${javac.target}"
1090      includeantruntime="false"
1091      >
1092      <compilerarg value="${javac.arg}" />
1093    </javac>
1094  </target>
1095 
1096  <target
1097    name="installprg.jar"
1098    depends="installprg.compile"
1099    description="Create the installation jar file: base-install-a.b.c.jar"
1100    >
1101    <jar
1102      basedir="${installprg.build}"
1103      jarfile="${bin}/jar/base-install-${base.version}.jar"
1104    />
1105  </target>
1106
1107  <!-- jobagent targets -->
1108  <target
1109    name="jobagent.init"
1110    depends="core.init,coreplugins.init,web.init"
1111    >
1112    <property name="jobagent.src" location="${src}/clients/jobagent" 
1113      description="Location of source files" />
1114    <property name="jobagent.build" location="${build}/clients/jobagent" 
1115      description="Location of compiled files" />
1116    <path id="jobagent.classpath" description="Class path for compiling jobagent">
1117      <path refid="core.classpath"/>
1118      <pathelement location="${core.build}"/>
1119    </path>
1120  </target>
1121  <target
1122    name="jobagent.compile"
1123    depends="jobagent.init,core.compile"
1124    description="Compile the job agent application"
1125    >
1126    <mkdir dir="${jobagent.build}" />
1127    <javac
1128      srcdir="${jobagent.src}"
1129      destdir="${jobagent.build}"
1130      classpathref="jobagent.classpath"
1131      encoding="${javac.encoding}"
1132      debug="true"
1133      deprecation="true"
1134      source="${javac.source}"
1135      target="${javac.target}"
1136      includeantruntime="false"
1137      >
1138      <compilerarg value="${javac.arg}" />
1139    </javac>
1140  </target>
1141 
1142  <target
1143    name="jobagent.jar"
1144    depends="jobagent.compile"
1145    description="Create the job agent jar file: base-jobagent-a.b.c.jar"
1146    >
1147    <jar
1148      basedir="${jobagent.build}"
1149      jarfile="${bin}/jar/base-jobagent-${base.version}.jar"
1150    />
1151  </target>
1152
1153  <!-- documentation targets -->
1154  <target
1155    name="doc.init"
1156    depends="core.init"
1157    >
1158    <property name="javadoc.src" location="doc/src/javadoc" 
1159      description="Location of javadoc source files" />
1160    <property name="docbook.src" location="doc/src/docbook" 
1161      description="Location of docbook source XML files" />
1162    <path id="javadoc.classpath" description="Class path for generating javadoc">
1163      <path refid="core.classpath" />
1164      <path refid="lib.servlet.classpath" />
1165      <path refid="lib.webservices.classpath" />
1166    </path>
1167    <property name="docbook.html.out" location="${doc}/html" />
1168    <property name="docbook.pdf.out" location="${doc}" />
1169  </target>
1170 
1171  <target
1172    name="doc.javadoc"
1173    depends="doc.init,core.init,coreplugins.init,web.init,jobagent.init,webservices.init"
1174    description="Generate JavaDoc of entire API"
1175    >
1176    <!-- Create the time stamp -->
1177    <tstamp>
1178      <format property="TODAY" pattern="yyyy-MM-dd"/>
1179    </tstamp>
1180    <delete dir="${doc}/api" />
1181    <mkdir dir="${doc}/api"/>
1182
1183    <javadoc
1184      packagenames="net.sf.basedb.*"
1185      sourcepath="${info.src}:${core.src}:${coreplugins.src}:${web.src}:${xjspcompiler.src}:${jobagent.src}:${webservices.src}/server:${webservices.src}/client/java"
1186      destdir="${doc}/api"
1187      author="true"
1188      version="true"
1189      use="false"
1190      private="true"
1191      windowtitle="BASE ${base.version}${base.versionsuffix} API documentation"
1192      stylesheetfile="${javadoc.src}/javadoc.css"
1193      classpathref="javadoc.classpath"
1194      linksource="false"
1195      breakiterator="yes"
1196      encoding="${javac.encoding}"
1197      overview="${javadoc.src}/overview.html"
1198      maxmemory="256M"
1199      >
1200      <group title="Public API">
1201        <package name="net.sf.basedb.info" />
1202        <package name="net.sf.basedb.core" />
1203        <package name="net.sf.basedb.core.plugin" />
1204        <package name="net.sf.basedb.core.query" />
1205        <package name="net.sf.basedb.core.signal" />
1206        <package name="net.sf.basedb.util*" />
1207        <package name="net.sf.basedb.clients.web.taglib*" />
1208        <package name="net.sf.basedb.plugins*" />
1209        <package name="net.sf.basedb.core.authentication" />
1210        <package name="net.sf.basedb.ws.client" />
1211        <package name="net.sf.basedb.core.filehandler" />
1212        <package name="net.sf.basedb.clients.web.extensions*" />
1213      </group>
1214      <group title="Mixed Public and Internal API">
1215        <package name="net.sf.basedb.core.data" />
1216        <package name="net.sf.basedb.clients.web" />
1217        <package name="net.sf.basedb.clients.web.util" />
1218        <package name="net.sf.basedb.util.overview" />
1219      </group>
1220      <group title="Extension API">
1221        <package name="net.sf.basedb.core.dbengine" />
1222        <package name="net.sf.basedb.clients.jobagent" />
1223        <package name="net.sf.basedb.ws.server*" />
1224      </group>
1225      <group title="Internal API">
1226        <package name="net.sf.basedb.core.data.keyring" />
1227        <package name="net.sf.basedb.clients.jobagent.*" />
1228        <package name="net.sf.basedb.clients.web.*" />
1229        <package name="net.sf.basedb.core.hibernate" />
1230      </group>
1231     
1232      <header><![CDATA[${base.version}${base.versionsuffix}: ${TODAY}]]></header>
1233      <link href="http://download.oracle.com/javase/6/docs/api"/>
1234      <link href="http://docs.jboss.org/hibernate/stable/core/api/"/>
1235      <link href="http://www.jdom.org/docs/apidocs/" />
1236      <link href="http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/" />
1237      <link href="http://download.oracle.com/docs/cd/E17802_01/products/products/jsp/2.1/docs/jsp-2_1-pfd2/" />
1238      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1239      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1240      <link href="http://logging.apache.org/log4j/docs/api/" />
1241      <link href="http://download.oracle.com/docs/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/" />
1242      <link href="http://tomcat.apache.org/tomcat-6.0-doc/api/" />
1243      <tag name="base.developer" description="Developer info" />
1244      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1245      <tag name="base.modified" description="Last modified" />
1246      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1247      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1248      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1249      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1250      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1251      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1252      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1253      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1254      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1255      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1256      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1257      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1258      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1259      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1260      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1261      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1262      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1263      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1264      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1265      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1266      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1267      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1268      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1269      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1270      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1271    </javadoc>
1272  </target>
1273 
1274  <target
1275    name="doc.docbook"
1276    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1277    description="Generate docbook user and admin documentation."
1278    >
1279  </target>
1280   
1281  <target 
1282    name="doc.docbook.html"
1283    depends="dev.init,doc.init,xsltprocessor"
1284    >
1285    <mkdir dir="${docbook.html.out}" />
1286    <!--Create subdirectories to store the chunked files in-->
1287    <mkdir dir="${docbook.html.out}/admindoc"/>
1288    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1289    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1290    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1291    <mkdir dir="${docbook.html.out}/admindoc/extensions"/>
1292    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1293    <mkdir dir="${docbook.html.out}/developerdoc"/>
1294    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1295    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1296    <mkdir dir="${docbook.html.out}/developerdoc/extensions"/>
1297    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1298    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1299    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1300    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1301    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1302    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1303    <mkdir dir="${docbook.html.out}/overviewdoc/features"/>
1304    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1305    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1306    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1307    <mkdir dir="${docbook.html.out}/userdoc"/>
1308    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1309    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1310    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1311    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1312    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1313    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1314    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1315    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1316    <mkdir dir="${docbook.html.out}/userdoc/import"/>
1317    <mkdir dir="${docbook.html.out}/userdoc/export"/>
1318    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1319    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1320    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1321    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1322    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1323    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1324    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1325    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1326    <mkdir dir="${docbook.html.out}/faqsdoc" />
1327    <mkdir dir="${docbook.html.out}/faqsdoc/faqs" />
1328    <mkdir dir="${docbook.html.out}/appendix" />
1329       
1330    <mkdir dir="${build}/docbook/html" />
1331    <delete description="Delete existing documents">
1332      <fileset dir="${build}/docbook" defaultexcludes="no" />
1333      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1334    </delete>
1335    <delete file="data/helptexts.xml" />
1336    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1337      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1338      <property name="docbook.xml.dir" location="${docbook.src}" />
1339      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1340      <property name="distribution.dir" location="${docbook.html.out}" />
1341      <property name="build.dir" location="${build}/docbook/html" />
1342      <property name="base.version" value="${base.version}${base.versionsuffix}"/>
1343    </ant>
1344     <copy todir="${docbook.html.out}">
1345         <fileset dir="${docbook.src}" includes="css/*.*" />
1346         <fileset dir="${docbook.src}" includes="script/*.*" />
1347     </copy>
1348   
1349    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1350    <path id="ant-extensions">
1351        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1352        <pathelement path="${lib}/docbook/ant-extensions" />
1353      </path>
1354   
1355    <xmlcatalog id="dtdcatalog">
1356          <catalogpath>
1357              <fileset file="${catalog.location}"/>
1358          </catalogpath>
1359      </xmlcatalog>
1360
1361      <xslt
1362          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1363          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1364          out     = "data/helptexts.xml"
1365          processor = "${xslt.processor}"
1366          >
1367          <xmlcatalog refid="dtdcatalog"/>
1368          <classpath refid="ant-extensions" />
1369
1370          <param name="xsltproc.catalog" expression="${catalog.location}" />
1371          <param name="xsltproc.option.--nonet"  expression="" />
1372      </xslt>
1373
1374    <replaceregexp 
1375      file="data/helptexts.xml"
1376      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1377      replace="&amp;lt;\$1&amp;gt;"
1378      flags="sg"
1379    />
1380  </target>
1381 
1382  <target 
1383    name="doc.docbook.pdf"
1384    depends="dev.init,doc.init"
1385    >
1386    <!-- Generate a pdf file from the documentation source -->
1387    <mkdir dir="${build}/docbook/pdf" />
1388    <echo>Generate pdf file</echo>
1389    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1390      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1391      <property name="docbook.xml.dir" location="${docbook.src}" />
1392      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1393      <property name="distribution.dir" location="${docbook.pdf.out}" />
1394      <property name="build.dir" location="${build}/docbook/pdf" />
1395      <property name="pdf.name" value="base.pdf" />
1396      <property name="base.version" value="${base.version}${base.versionsuffix}"/>
1397    </ant>
1398  </target>
1399 
1400  <target 
1401    name="doc.dist"
1402    description="Copy documentation to the binary distribution"
1403    >
1404    <mkdir dir="dist/doc" />
1405    <copy todir="dist/doc">
1406      <!--fileset dir="doc" includes="admin/**/*" /-->
1407      <!--fileset dir="doc" includes="development/**/*" /-->
1408      <fileset dir="doc" includes="licenses/**/*" />
1409      <fileset dir="doc" includes="historical/**/*" />
1410      <fileset dir="doc" includes="test/**/*" />
1411      <!--fileset dir="doc" includes="user/**/*" /-->
1412      <fileset dir="doc" includes="*.*" />
1413    </copy>
1414  </target>
1415
1416  <target name="xsltprocessor">
1417      <property environment="env"/>
1418
1419      <condition  property="executable.file.extension"
1420                  value=".exe">
1421              <os family="windows"/>
1422      </condition>
1423      <condition  property="executable.file.extension"
1424                  value="">
1425              <os family="unix"/>
1426      </condition>
1427     
1428      <condition  property="tmp:xsltproc.available"
1429                  value="xsltproc${executable.file.extension}">
1430          <or>
1431              <and>
1432                  <os family="windows"/>
1433                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1434              </and>
1435              <and>
1436                  <os family="unix"/>
1437                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1438              </and>
1439          </or>
1440      </condition>
1441     
1442      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1443          <and>
1444              <isset property="tmp:xsltproc.available" />
1445              <not>
1446                  <isset property="disable.xsltproc" />
1447              </not>
1448          </and>
1449      </condition>
1450     
1451      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1452          <not>
1453              <isset property="disable.saxon" />
1454          </not>
1455      </condition>
1456
1457      <condition property="xslt.processor" value="trax">
1458          <not>
1459          <and>
1460                  <isset property="tmp:xsltproc.available" />
1461                  <not>
1462                      <isset property="disable.xsltproc" />
1463                  </not>
1464          </and>
1465          </not>
1466      </condition>
1467
1468    </target>
1469 
1470  <!--package targets -->
1471  <target
1472    name="package.bin"
1473    depends="dist"
1474    description="Create binary distribution package"
1475    >
1476    <mkdir dir="${package}" />
1477    <tar
1478      destfile="${package}/base-${base.version}.tar.gz"
1479      longfile="gnu"
1480      compression="gzip"
1481      >
1482      <tarfileset
1483        dir="${dist}"
1484        mode="755"
1485        prefix="base-${base.version}"
1486        preserveLeadingSlashes="true"
1487        >
1488        <include name="**/*.sh" />
1489      </tarfileset>
1490      <tarfileset
1491        dir="${dist}"
1492        prefix="base-${base.version}"
1493        preserveLeadingSlashes="true"
1494        >
1495        <exclude name="**/*.sh" />
1496      </tarfileset>
1497    </tar>
1498    <checksum file="${package}/base-${base.version}.tar.gz" />
1499  </target>
1500 
1501  <target
1502    name="package.src"
1503    depends="svn.revision"
1504    description="Create source distribution package"
1505    >
1506    <property name="tempdir" location="base-${base.version}-src" />
1507    <delete dir="${tempdir}" failonerror="false"/>
1508    <svn>
1509      <export srcPath="." destPath="${tempdir}" />
1510    </svn>
1511    <replaceregexp 
1512      file="${tempdir}/build.xml"
1513      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1514      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1515      flags="s"
1516    />
1517    <replace file="${tempdir}/build.xml"
1518      description="Remove references to package.src">
1519      <replacefilter 
1520        token="package.bin,package.src"
1521        value="package.bin"
1522      />
1523    </replace>
1524    <replaceregexp 
1525      file="${tempdir}/build.xml"
1526      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1527      replace=""
1528      flags="s"
1529      description="Remove package.src target"
1530    />
1531    <mkdir dir="${package}" />
1532      <tar
1533      destfile="${package}/base-${base.version}-src.tar.gz"
1534      longfile="gnu"
1535      compression="gzip"
1536      >
1537      <tarfileset
1538        dir="${tempdir}"
1539        mode="755"
1540        prefix="base-${base.version}-src"
1541        preserveLeadingSlashes="true"
1542        >
1543        <include name="**/*.sh" />
1544      </tarfileset>
1545      <tarfileset
1546        dir="${tempdir}"
1547        prefix="base-${base.version}-src"
1548        preserveLeadingSlashes="true"
1549        >
1550        <exclude name="**/*.sh" />
1551      </tarfileset>
1552    </tar>
1553    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1554    <delete dir="${tempdir}" />
1555  </target>
1556   
1557  <target 
1558    name="svn.update"
1559    description="Issues an 'svn update' command to check out the latest revision from subversion"
1560    >
1561    <svn>
1562      <update dir="." />
1563    </svn>
1564  </target>
1565 
1566  <target
1567    name="svn.diff"
1568    depends="svn.revision"
1569    description="Issues an 'svn diff' command to generate a patch with local changes"
1570    >
1571    <echo>NOTE! New files must be added to svn with 'svn add' or they will not be added to the patch.</echo>
1572    <property name="patchfile" value="patch-${base.build}.diff" />
1573    <pathconvert property="patchdir" dirsep="/" >
1574      <path location="." />
1575    </pathconvert>
1576    <svn>
1577      <diff oldpath="." outfile="${patchfile}"/>
1578    </svn>
1579    <replaceregexp file="${patchfile}" match="${patchdir}/" replace="" flags="g" />
1580    <echo>Generated patch file: ${patchfile}</echo>
1581  </target>
1582   
1583</project>
Note: See TracBrowser for help on using the repository browser.