source: trunk/build.xml @ 3991

Last change on this file since 3991 was 3991, checked in by Martin Svensson, 15 years ago

Fixes #827 Reporters can now be exported through web services. Two new methods in ReporterService? are added, one that exports reporters in a reporters list and one that exports all reports. The reporters are exported to a tab-separated text file.

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