source: trunk/build.xml @ 5706

Last change on this file since 5706 was 5706, checked in by Nicklas Nordborg, 10 years ago

References #1590: Documentation cleanup

User documentation chapter 10 to 15. Added new chapter about "Item subtypes". Removed sections about protocol types, hardware types and software types. Merged "Hardware" and "Software" into a single chapter.

Added some menu separators in the New annotation type menu.

As usual, screen shots have not yet been updated.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 49.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 5706 2011-08-23 13:20:30Z 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/migrate_2_3"/>
1295    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1296    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1297    <mkdir dir="${docbook.html.out}/developerdoc/extensions"/>
1298    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1299    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1300    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1301    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1302    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1303    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1304    <mkdir dir="${docbook.html.out}/overviewdoc/features"/>
1305    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1306    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1307    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1308    <mkdir dir="${docbook.html.out}/userdoc"/>
1309    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1310    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1311    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1312    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1313    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1314    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1315    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1316    <mkdir dir="${docbook.html.out}/userdoc/subtypes"/>
1317    <mkdir dir="${docbook.html.out}/userdoc/wares"/>
1318    <mkdir dir="${docbook.html.out}/userdoc/import"/>
1319    <mkdir dir="${docbook.html.out}/userdoc/export"/>
1320    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1321    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1322    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1323    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1324    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1325    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1326    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1327    <mkdir dir="${docbook.html.out}/faqsdoc" />
1328    <mkdir dir="${docbook.html.out}/faqsdoc/faqs" />
1329    <mkdir dir="${docbook.html.out}/appendix" />
1330       
1331    <mkdir dir="${build}/docbook/html" />
1332    <delete description="Delete existing documents">
1333      <fileset dir="${build}/docbook" defaultexcludes="no" />
1334      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1335    </delete>
1336    <delete file="data/helptexts.xml" />
1337    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1338      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1339      <property name="docbook.xml.dir" location="${docbook.src}" />
1340      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1341      <property name="distribution.dir" location="${docbook.html.out}" />
1342      <property name="build.dir" location="${build}/docbook/html" />
1343      <property name="base.version" value="${base.version}${base.versionsuffix}"/>
1344    </ant>
1345    <copy todir="${docbook.html.out}">
1346      <fileset dir="${docbook.src}" includes="css/*.*" />
1347      <fileset dir="${docbook.src}" includes="script/*.*" />
1348      <fileset dir="${docbook.src}" includes="examples/*.*" />
1349     </copy>
1350   
1351    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1352    <path id="ant-extensions">
1353        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1354        <pathelement path="${lib}/docbook/ant-extensions" />
1355      </path>
1356   
1357    <xmlcatalog id="dtdcatalog">
1358          <catalogpath>
1359              <fileset file="${catalog.location}"/>
1360          </catalogpath>
1361      </xmlcatalog>
1362
1363      <xslt
1364          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1365          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1366          out     = "data/helptexts.xml"
1367          processor = "${xslt.processor}"
1368          >
1369          <xmlcatalog refid="dtdcatalog"/>
1370          <classpath refid="ant-extensions" />
1371
1372          <param name="xsltproc.catalog" expression="${catalog.location}" />
1373          <param name="xsltproc.option.--nonet"  expression="" />
1374      </xslt>
1375  </target>
1376 
1377  <target 
1378    name="doc.docbook.pdf"
1379    depends="dev.init,doc.init"
1380    >
1381    <!-- Generate a pdf file from the documentation source -->
1382    <mkdir dir="${build}/docbook/pdf" />
1383    <echo>Generate pdf file</echo>
1384    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1385      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1386      <property name="docbook.xml.dir" location="${docbook.src}" />
1387      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1388      <property name="distribution.dir" location="${docbook.pdf.out}" />
1389      <property name="build.dir" location="${build}/docbook/pdf" />
1390      <property name="pdf.name" value="base.pdf" />
1391      <property name="base.version" value="${base.version}${base.versionsuffix}"/>
1392    </ant>
1393  </target>
1394 
1395  <target 
1396    name="doc.dist"
1397    description="Copy documentation to the binary distribution"
1398    >
1399    <mkdir dir="dist/doc" />
1400    <copy todir="dist/doc">
1401      <!--fileset dir="doc" includes="admin/**/*" /-->
1402      <!--fileset dir="doc" includes="development/**/*" /-->
1403      <fileset dir="doc" includes="licenses/**/*" />
1404      <fileset dir="doc" includes="historical/**/*" />
1405      <fileset dir="doc" includes="test/**/*" />
1406      <!--fileset dir="doc" includes="user/**/*" /-->
1407      <fileset dir="doc" includes="*.*" />
1408    </copy>
1409  </target>
1410
1411  <target name="xsltprocessor">
1412      <property environment="env"/>
1413
1414      <condition  property="executable.file.extension"
1415                  value=".exe">
1416              <os family="windows"/>
1417      </condition>
1418      <condition  property="executable.file.extension"
1419                  value="">
1420              <os family="unix"/>
1421      </condition>
1422     
1423      <condition  property="tmp:xsltproc.available"
1424                  value="xsltproc${executable.file.extension}">
1425          <or>
1426              <and>
1427                  <os family="windows"/>
1428                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1429              </and>
1430              <and>
1431                  <os family="unix"/>
1432                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1433              </and>
1434          </or>
1435      </condition>
1436     
1437      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1438          <and>
1439              <isset property="tmp:xsltproc.available" />
1440              <not>
1441                  <isset property="disable.xsltproc" />
1442              </not>
1443          </and>
1444      </condition>
1445     
1446      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1447          <not>
1448              <isset property="disable.saxon" />
1449          </not>
1450      </condition>
1451
1452      <condition property="xslt.processor" value="trax">
1453          <not>
1454          <and>
1455                  <isset property="tmp:xsltproc.available" />
1456                  <not>
1457                      <isset property="disable.xsltproc" />
1458                  </not>
1459          </and>
1460          </not>
1461      </condition>
1462
1463    </target>
1464 
1465  <!--package targets -->
1466  <target
1467    name="package.bin"
1468    depends="dist"
1469    description="Create binary distribution package"
1470    >
1471    <mkdir dir="${package}" />
1472    <tar
1473      destfile="${package}/base-${base.version}.tar.gz"
1474      longfile="gnu"
1475      compression="gzip"
1476      >
1477      <tarfileset
1478        dir="${dist}"
1479        mode="755"
1480        prefix="base-${base.version}"
1481        preserveLeadingSlashes="true"
1482        >
1483        <include name="**/*.sh" />
1484      </tarfileset>
1485      <tarfileset
1486        dir="${dist}"
1487        prefix="base-${base.version}"
1488        preserveLeadingSlashes="true"
1489        >
1490        <exclude name="**/*.sh" />
1491      </tarfileset>
1492    </tar>
1493    <checksum file="${package}/base-${base.version}.tar.gz" />
1494  </target>
1495 
1496  <target
1497    name="package.src"
1498    depends="svn.revision"
1499    description="Create source distribution package"
1500    >
1501    <property name="tempdir" location="base-${base.version}-src" />
1502    <delete dir="${tempdir}" failonerror="false"/>
1503    <svn>
1504      <export srcPath="." destPath="${tempdir}" />
1505    </svn>
1506    <replaceregexp 
1507      file="${tempdir}/build.xml"
1508      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1509      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1510      flags="s"
1511    />
1512    <replace file="${tempdir}/build.xml"
1513      description="Remove references to package.src">
1514      <replacefilter 
1515        token="package.bin,package.src"
1516        value="package.bin"
1517      />
1518    </replace>
1519    <replaceregexp 
1520      file="${tempdir}/build.xml"
1521      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1522      replace=""
1523      flags="s"
1524      description="Remove package.src target"
1525    />
1526    <mkdir dir="${package}" />
1527      <tar
1528      destfile="${package}/base-${base.version}-src.tar.gz"
1529      longfile="gnu"
1530      compression="gzip"
1531      >
1532      <tarfileset
1533        dir="${tempdir}"
1534        mode="755"
1535        prefix="base-${base.version}-src"
1536        preserveLeadingSlashes="true"
1537        >
1538        <include name="**/*.sh" />
1539      </tarfileset>
1540      <tarfileset
1541        dir="${tempdir}"
1542        prefix="base-${base.version}-src"
1543        preserveLeadingSlashes="true"
1544        >
1545        <exclude name="**/*.sh" />
1546      </tarfileset>
1547    </tar>
1548    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1549    <delete dir="${tempdir}" />
1550  </target>
1551   
1552  <target 
1553    name="svn.update"
1554    description="Issues an 'svn update' command to check out the latest revision from subversion"
1555    >
1556    <svn>
1557      <update dir="." />
1558    </svn>
1559  </target>
1560 
1561  <target
1562    name="svn.diff"
1563    depends="svn.revision"
1564    description="Issues an 'svn diff' command to generate a patch with local changes"
1565    >
1566    <echo>NOTE! New files must be added to svn with 'svn add' or they will not be added to the patch.</echo>
1567    <property name="patchfile" value="patch-${base.build}.diff" />
1568    <pathconvert property="patchdir" dirsep="/" >
1569      <path location="." />
1570    </pathconvert>
1571    <svn>
1572      <diff oldpath="." outfile="${patchfile}"/>
1573    </svn>
1574    <replaceregexp file="${patchfile}" match="${patchdir}/" replace="" flags="g" />
1575    <echo>Generated patch file: ${patchfile}</echo>
1576  </target>
1577   
1578</project>
Note: See TracBrowser for help on using the repository browser.