source: trunk/build.xml @ 3977

Last change on this file since 3977 was 3977, checked in by Nicklas Nordborg, 15 years ago

References #827: Add more web services methods

Added AnnotationTypeService? that can be used to find available annotation types.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 50.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 3977 2007-11-16 10:59:48Z nicklas $
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    </path>
969    <path id="webservices.client.classpath" 
970      description="Class path for compiling client part of webservices"
971      >
972      <path refid="lib.webservices.classpath" />
973      <pathelement location="${info.build}"/>
974    </path>
975  </target>
976
977  <target
978    name="check.wsdl"
979    depends="webservices.init"
980    >
981    <uptodate
982      property="nowsdl"
983      >
984      <srcfiles dir="${webservices.src}/server" includes="**/*.java" />
985      <mapper type="merge" to="${webservices.wsdlpath}/SessionService.wsdl" />
986    </uptodate>
987    <condition property="wsdl.message" 
988      value="WSDL files are up to date; skipping" 
989      >
990      <istrue value="${nowsdl}" />
991    </condition>
992    <condition property="wsdl.message" 
993      value="WSDL files may not be up to date; generating new" 
994      >
995      <isfalse value="${nowsdl}" />
996    </condition>
997    <echo>${wsdl.message}</echo>
998  </target> 
999 
1000  <target
1001    name="webservices.compile"
1002    depends="webservices.server.compile,webservices.client.compile"
1003    description="Compile the core web services"
1004    >
1005  </target>
1006 
1007  <target
1008    name="webservices.server.compile"
1009    description="Compile the server part of webservices"
1010    depends="webservices.init,core.compile,coreplugins.compile"
1011    >
1012    <mkdir dir="${webservices.build}/server" />
1013    <javac
1014      destdir="${webservices.build}/server"
1015      classpathref="webservices.server.classpath"
1016      encoding="ISO-8859-1"
1017      debug="true"
1018      deprecation="true"
1019      >
1020      <src path="${webservices.src}/server" />
1021      <compilerarg value="${javac.arg}" />
1022    </javac>
1023    <copy todir="${webservices.build}/server" 
1024      description="Resource files needed by the webservices; excludes documentation and source files"
1025      includeEmptyDirs="false"
1026      >
1027      <fileset dir="${webservices.src}/server">
1028        <include name="**/*" />
1029        <exclude name="**/*.java" />
1030        <exclude name="**/doc-files/" />
1031        <exclude name="**/package.html" />
1032      </fileset>
1033    </copy>
1034  </target>
1035
1036  <target
1037    name="webservices.client.compile"
1038    description="Compile the client part of webservices"
1039    depends="webservices.init,info.compile"
1040    >
1041    <mkdir dir="${webservices.build}/client" />
1042    <javac
1043      destdir="${webservices.build}/client"
1044      classpathref="webservices.client.classpath"
1045      encoding="ISO-8859-1"
1046      debug="true"
1047      deprecation="true"
1048      >
1049      <src path="${webservices.src}/client/java" />
1050      <compilerarg value="${javac.arg}" />
1051    </javac>
1052  </target>
1053 
1054  <target 
1055    name="webservices.wsdl"
1056    description="Generate WSDL files for webservices"
1057    depends="check.wsdl,webservices.compile"
1058    unless="nowsdl"
1059    >
1060    <webservices.wsdl serviceClassName="ArrayDesignService"/>
1061    <webservices.wsdl serviceClassName="BioAssaySetService"/>
1062    <webservices.wsdl serviceClassName="ExperimentService"/>
1063    <webservices.wsdl serviceClassName="ProjectService"/>
1064    <webservices.wsdl serviceClassName="RawBioAssayService"/>
1065    <webservices.wsdl serviceClassName="SessionService"/>
1066    <webservices.wsdl serviceClassName="AnnotationTypeService"/>
1067  </target>
1068 
1069  <!-- Creates a WSDL file for a Webservice class -->
1070    <macrodef name="webservices.wsdl">
1071        <attribute name="serviceClassName"/>
1072        <sequential>
1073          <java2WSDL
1074        classpath="${webservices.build}/server;${info.build};${core.build}"
1075        className="net.sf.basedb.ws.server.@{serviceClassName}"
1076        outputLocation="${webservices.wsdlpath}"     
1077        serviceName="@{serviceClassName}"
1078        outputFileName="@{serviceClassName}.wsdl"
1079        >   
1080      </java2WSDL>   
1081        </sequential>
1082    </macrodef>
1083 
1084  <target
1085    name="webservices.jar"
1086    depends="webservices.compile"
1087    description="Create the core webservices aar file and client jar"
1088    >
1089    <mkdir dir="${config}/../services" />
1090    <!-- server side: core.aar -->
1091    <jar
1092      basedir="${webservices.build}/server"
1093      jarfile="${config}/../services/core.aar"
1094    />
1095    <!-- client side: BASE2WSClient.jar -->
1096    <jar
1097      jarfile="${jar}/BASE2WSClient.jar"
1098      >
1099      <fileset dir="${webservices.build}/client" />
1100      <fileset dir="${info.build}" />
1101    </jar>
1102  </target>
1103 
1104  <!-- installprg targets -->
1105  <target
1106    name="installprg.init"
1107    depends="core.init,coreplugins.init,web.init"
1108    >
1109    <property name="installprg.src" location="${src}/install" 
1110      description="Location of source files" />
1111    <property name="installprg.build" location="${build}/install" 
1112      description="Location of compiled files" />
1113    <path id="installprg.classpath" description="Class path for compiling installation programs">
1114      <path refid="core.classpath"/>
1115      <pathelement location="${core.build}"/>
1116      <pathelement location="${coreplugins.build}"/>
1117      <pathelement location="${web.build}"/>
1118    </path>
1119  </target>
1120  <target
1121    name="installprg.compile"
1122    depends="installprg.init,core.compile"
1123    description="Compile the installation programs"
1124    >
1125    <mkdir dir="${installprg.build}" />
1126    <javac
1127      srcdir="${installprg.src}"
1128      destdir="${installprg.build}"
1129      classpathref="installprg.classpath"
1130      encoding="ISO-8859-1"
1131      debug="true"
1132      deprecation="true"
1133      >
1134      <compilerarg value="${javac.arg}" />
1135    </javac>
1136  </target>
1137 
1138  <target
1139    name="installprg.jar"
1140    depends="installprg.compile"
1141    description="Create the installation jar file: BASE2Install.jar"
1142    >
1143    <jar
1144      basedir="${installprg.build}"
1145      jarfile="${bin}/jar/BASE2Install.jar"
1146    />
1147  </target>
1148
1149  <!-- jobagent targets -->
1150  <target
1151    name="jobagent.init"
1152    depends="core.init,coreplugins.init,web.init"
1153    >
1154    <property name="jobagent.src" location="${src}/clients/jobagent" 
1155      description="Location of source files" />
1156    <property name="jobagent.build" location="${build}/clients/jobagent" 
1157      description="Location of compiled files" />
1158    <path id="jobagent.classpath" description="Class path for compiling jobagent">
1159      <path refid="core.classpath"/>
1160      <pathelement location="${core.build}"/>
1161    </path>
1162  </target>
1163  <target
1164    name="jobagent.compile"
1165    depends="jobagent.init,core.compile"
1166    description="Compile the job agent application"
1167    >
1168    <mkdir dir="${jobagent.build}" />
1169    <javac
1170      srcdir="${jobagent.src}"
1171      destdir="${jobagent.build}"
1172      classpathref="jobagent.classpath"
1173      encoding="ISO-8859-1"
1174      debug="true"
1175      deprecation="true"
1176      >
1177      <compilerarg value="${javac.arg}" />
1178    </javac>
1179  </target>
1180 
1181  <target
1182    name="jobagent.jar"
1183    depends="jobagent.compile"
1184    description="Create the job agent jar file: JobAgent.jar"
1185    >
1186    <jar
1187      basedir="${jobagent.build}"
1188      jarfile="${bin}/jar/JobAgent.jar"
1189    />
1190  </target>
1191
1192  <!-- migrate targets -->
1193  <target
1194    name="migrate.init"
1195    depends="core.init,coreplugins.init,web.init"
1196    >
1197    <property name="migrate.src" location="${src}/clients/migrate" 
1198      description="Location of source files" />
1199    <property name="migrate.build" location="${build}/clients/migrate" 
1200      description="Location of compiled files" />
1201    <path id="migrate.classpath" description="Class path for compiling migration tool">
1202      <path refid="core.classpath"/>
1203      <pathelement location="${core.build}"/>
1204    </path>
1205  </target>
1206  <target
1207    name="migrate.compile"
1208    depends="migrate.init,core.compile"
1209    description="Compile the migration tool"
1210    >
1211    <mkdir dir="${migrate.build}" />
1212    <javac
1213      srcdir="${migrate.src}"
1214      destdir="${migrate.build}"
1215      classpathref="migrate.classpath"
1216      encoding="ISO-8859-1"
1217      debug="true"
1218      deprecation="true"
1219      >
1220      <compilerarg value="${javac.arg}" />
1221    </javac>
1222  </target>
1223 
1224  <target
1225    name="migrate.jar"
1226    depends="migrate.compile"
1227    description="Create the migration tool jar file: Migrate.jar"
1228    >
1229    <jar
1230      basedir="${migrate.build}"
1231      jarfile="${bin}/jar/Migrate.jar"
1232    />
1233  </target>
1234 
1235  <!-- documentation targets -->
1236  <target
1237    name="doc.init"
1238    depends="core.init"
1239    >
1240    <property name="javadoc.src" location="doc/src/javadoc" 
1241      description="Location of javadoc source files" />
1242    <property name="docbook.src" location="doc/src/docbook" 
1243      description="Location of docbook source XML files" />
1244    <path id="javadoc.classpath" description="Class path for generating javadoc">
1245      <path refid="core.classpath" />
1246      <path refid="lib.servlet.classpath" />
1247      <path refid="lib.webservices.classpath" />
1248    </path>
1249    <property name="docbook.html.out" location="${doc}/html" />
1250    <property name="docbook.pdf.out" location="${doc}" />
1251  </target>
1252 
1253  <target
1254    name="doc.javadoc"
1255    depends="doc.init,core.init,coreplugins.init,web.init,migrate.init,jobagent.init,webservices.init"
1256    description="Generate JavaDoc of entire API"
1257    >
1258    <!-- Create the time stamp -->
1259    <tstamp>
1260      <format property="TODAY" pattern="yyyy-MM-dd"/>
1261    </tstamp>
1262    <delete dir="${doc}/api" />
1263    <mkdir dir="${doc}/api"/>
1264
1265    <javadoc
1266      packagenames="net.sf.basedb.*"
1267      sourcepath="${info.src}:${core.src}:${coreplugins.src}:${web.src}:${migrate.src}:${jobagent.src}:${webservices.src}/server:${webservices.src}/client/java"
1268      destdir="${doc}/api"
1269      author="true"
1270      version="true"
1271      use="false"
1272      private="true"
1273      windowtitle="BASE ${base.version} API documentation"
1274      stylesheetfile="${javadoc.src}/javadoc.css"
1275      classpathref="javadoc.classpath"
1276      linksource="false"
1277      breakiterator="yes"
1278      encoding="iso-8859-1"
1279      overview="${javadoc.src}/overview.html"
1280      >
1281      <group title="Public API"
1282        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"
1283      />
1284      <group title="Mixed Public and Internal API"
1285        packages="net.sf.basedb.core.data:net.sf.basedb.clients.web:net.sf.basedb.clients.web.util"
1286      />
1287      <group title="Extension API"
1288        packages="net.sf.basedb.core.dbengine:net.sf.basedb.clients.jobagent:net.sf.basedb.ws.server*"
1289      />
1290      <group title="Internal API"
1291        packages="net.sf.basedb.core.data.keyring:net.sf.basedb.clients.jobagent.*:net.sf.basedb.clients.migrate*:net.sf.basedb.clients.web.*"
1292      />
1293     
1294      <header><![CDATA[${base.version}: ${TODAY}]]></header>
1295      <link href="http://java.sun.com/j2se/1.5/docs/api"/>
1296      <link href="http://www.hibernate.org/hib_docs/v3/api"/>
1297      <link href="http://www.jdom.org/docs/apidocs/" />
1298      <link href="http://java.sun.com/products/servlet/2.2/javadoc/" />
1299      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1300      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1301      <link href="http://logging.apache.org/log4j/docs/api/" />
1302      <link href="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/" />
1303      <tag name="base.developer" description="Developer info" />
1304      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1305      <tag name="base.modified" description="Last modified" />
1306      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1307      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1308      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1309      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1310      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1311      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1312      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1313      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1314      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1315      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1316      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1317      <tag name="hibernate.array" description="Hibernate: array" scope="methods" />
1318      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1319      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1320      <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" />
1321      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1322      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1323      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1324      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1325      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1326      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1327      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1328      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1329      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1330      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1331      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1332      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1333    </javadoc>
1334  </target>
1335 
1336  <target
1337    name="doc.docbook"
1338    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1339    description="Generate docbook user and admin documentation."
1340    >
1341  </target>
1342   
1343  <target 
1344    name="doc.docbook.html"
1345    depends="dev.init,doc.init,xsltprocessor"
1346    >
1347    <mkdir dir="${docbook.html.out}" />
1348    <!--Create subdirectories to store the chunked files in-->
1349    <mkdir dir="${docbook.html.out}/admindoc"/>
1350    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1351    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1352    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1353    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1354    <mkdir dir="${docbook.html.out}/developerdoc"/>
1355    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1356    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1357    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1358    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1359    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1360    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1361    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1362    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1363    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1364    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1365    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1366    <mkdir dir="${docbook.html.out}/userdoc"/>
1367    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1368    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1369    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1370    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1371    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1372    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1373    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1374    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1375    <mkdir dir="${docbook.html.out}/userdoc/import_export"/>
1376    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1377    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1378    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1379    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1380    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1381    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1382    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1383    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1384    <mkdir dir="${docbook.html.out}/faqs" />
1385    <mkdir dir="${docbook.html.out}/appendix" />
1386       
1387    <mkdir dir="${build}/docbook/html" />
1388    <delete description="Delete existing documents">
1389      <fileset dir="${build}/docbook" defaultexcludes="no" />
1390      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1391    </delete>
1392    <delete file="data/helptexts.xml" />
1393    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1394      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1395      <property name="docbook.xml.dir" location="${docbook.src}" />
1396      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1397      <property name="distribution.dir" location="${docbook.html.out}" />
1398      <property name="build.dir" location="${build}/docbook/html" />
1399      <property name="base.version" value="${base.version}"/>
1400    </ant>
1401     <copy todir="${docbook.html.out}">
1402         <fileset dir="${docbook.src}" includes="css/*.*" />
1403         <fileset dir="${docbook.src}" includes="script/*.*" />
1404     </copy>
1405   
1406    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1407    <path id="ant-extensions">
1408        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1409        <pathelement path="${lib}/docbook/ant-extensions" />
1410      </path>
1411   
1412    <xmlcatalog id="dtdcatalog">
1413          <catalogpath>
1414              <fileset file="${catalog.location}"/>
1415          </catalogpath>
1416      </xmlcatalog>
1417
1418      <xslt
1419          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1420          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1421          out     = "data/helptexts.xml"
1422          processor = "${xslt.processor}"
1423          >
1424          <xmlcatalog refid="dtdcatalog"/>
1425          <classpath refid="ant-extensions" />
1426
1427          <param name="xsltproc.catalog" expression="${catalog.location}" />
1428          <param name="xsltproc.option.--nonet"  expression="" />
1429      </xslt>
1430
1431    <replaceregexp 
1432      file="data/helptexts.xml"
1433      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1434      replace="&amp;lt;\$1&amp;gt;"
1435      flags="sg"
1436    />
1437  </target>
1438 
1439  <target 
1440    name="doc.docbook.pdf"
1441    depends="dev.init,doc.init"
1442    >
1443    <!-- Generate a pdf file from the documentation source -->
1444    <mkdir dir="${build}/docbook/pdf" />
1445    <echo>Generate pdf file</echo>
1446    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1447      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1448      <property name="docbook.xml.dir" location="${docbook.src}" />
1449      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1450      <property name="distribution.dir" location="${docbook.pdf.out}" />
1451      <property name="build.dir" location="${build}/docbook/pdf" />
1452      <property name="pdf.name" value="base.pdf" />
1453      <property name="base.version" value="${base.version}"/>
1454    </ant>
1455  </target>
1456 
1457  <target 
1458    name="doc.dist"
1459    description="Copy documentation to the binary distribution"
1460    >
1461    <mkdir dir="dist/doc" />
1462    <copy todir="dist/doc">
1463      <!--fileset dir="doc" includes="admin/**/*" /-->
1464      <!--fileset dir="doc" includes="development/**/*" /-->
1465      <fileset dir="doc" includes="licenses/**/*" />
1466      <fileset dir="doc" includes="specifications/**/*" />
1467      <!--fileset dir="doc" includes="user/**/*" /-->
1468      <fileset dir="doc" includes="*.*" />
1469    </copy>
1470  </target>
1471
1472  <target name="xsltprocessor">
1473      <property environment="env"/>
1474
1475      <condition  property="executable.file.extension"
1476                  value=".exe">
1477              <os family="windows"/>
1478      </condition>
1479      <condition  property="executable.file.extension"
1480                  value="">
1481              <os family="unix"/>
1482      </condition>
1483     
1484      <condition  property="tmp:xsltproc.available"
1485                  value="xsltproc${executable.file.extension}">
1486          <or>
1487              <and>
1488                  <os family="windows"/>
1489                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1490              </and>
1491              <and>
1492                  <os family="unix"/>
1493                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1494              </and>
1495          </or>
1496      </condition>
1497     
1498      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1499          <and>
1500              <isset property="tmp:xsltproc.available" />
1501              <not>
1502                  <isset property="disable.xsltproc" />
1503              </not>
1504          </and>
1505      </condition>
1506     
1507      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1508          <not>
1509              <isset property="disable.saxon" />
1510          </not>
1511      </condition>
1512
1513      <condition property="xslt.processor" value="trax">
1514          <not>
1515          <and>
1516                  <isset property="tmp:xsltproc.available" />
1517                  <not>
1518                      <isset property="disable.xsltproc" />
1519                  </not>
1520          </and>
1521          </not>
1522      </condition>
1523
1524    </target>
1525 
1526  <!--package targets -->
1527  <target
1528    name="package.bin"
1529    depends="dist"
1530    description="Create binary distribution package"
1531    >
1532    <mkdir dir="${package}" />
1533    <tar
1534      destfile="${package}/base-${base.version}.tar.gz"
1535      longfile="gnu"
1536      compression="gzip"
1537      >
1538      <tarfileset
1539        dir="${dist}"
1540        mode="755"
1541        prefix="base-${base.version}"
1542        preserveLeadingSlashes="true"
1543        >
1544        <include name="**/*.sh" />
1545      </tarfileset>
1546      <tarfileset
1547        dir="${dist}"
1548        prefix="base-${base.version}"
1549        preserveLeadingSlashes="true"
1550        >
1551        <exclude name="**/*.sh" />
1552      </tarfileset>
1553    </tar>
1554    <checksum file="${package}/base-${base.version}.tar.gz" />
1555  </target>
1556 
1557  <target
1558    name="package.src"
1559    depends="svn.revision"
1560    description="Create source distribution package"
1561    >
1562    <property name="tempdir" location="base-${base.version}-src" />
1563    <delete dir="${tempdir}" failonerror="false"/>
1564    <svn>
1565      <export srcPath="." destPath="${tempdir}" />
1566    </svn>
1567    <replaceregexp 
1568      file="${tempdir}/build.xml"
1569      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1570      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1571      flags="s"
1572    />
1573    <replace file="${tempdir}/build.xml"
1574      description="Remove references to package.src">
1575      <replacefilter 
1576        token="package.bin,package.src"
1577        value="package.bin"
1578      />
1579    </replace>
1580    <replaceregexp 
1581      file="${tempdir}/build.xml"
1582      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1583      replace=""
1584      flags="s"
1585      description="Remove package.src target"
1586    />
1587    <mkdir dir="${package}" />
1588      <tar
1589      destfile="${package}/base-${base.version}-src.tar.gz"
1590      longfile="gnu"
1591      compression="gzip"
1592      >
1593      <tarfileset
1594        dir="${tempdir}"
1595        mode="755"
1596        prefix="base-${base.version}-src"
1597        preserveLeadingSlashes="true"
1598        >
1599        <include name="**/*.sh" />
1600      </tarfileset>
1601      <tarfileset
1602        dir="${tempdir}"
1603        prefix="base-${base.version}-src"
1604        preserveLeadingSlashes="true"
1605        >
1606        <exclude name="**/*.sh" />
1607      </tarfileset>
1608    </tar>
1609    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1610    <delete dir="${tempdir}" />
1611  </target>
1612 
1613  <target 
1614    name="package.examples"
1615    depends="package.examples.plugins,package.examples.webservices"
1616  />
1617 
1618  <target
1619    name="package.examples.plugins"
1620    depends="examples.plugins"
1621    description="Create a downloadable tar file with the example plugins"
1622    >
1623    <mkdir dir="${package}" />
1624    <tar
1625      destfile="${package}/exampleplugins.tar.gz"
1626      compression="gzip"
1627      >
1628      <tarfileset
1629        dir="${examples}/plugins"
1630        preserveLeadingSlashes="true"
1631      />
1632    </tar>
1633  </target>
1634 
1635  <target
1636    name="package.examples.webservices"
1637    depends="examples.webservices"
1638    description="Create a downloadable tar file with the webservices example"
1639    >
1640    <mkdir dir="${package}" />
1641    <tar
1642      destfile="${package}/examplewebservices.tar.gz"
1643      compression="gzip"
1644      >
1645      <tarfileset
1646        dir="${examples}/webservices"
1647        preserveLeadingSlashes="true"
1648      />
1649    </tar>
1650  </target>
1651 
1652</project>
Note: See TracBrowser for help on using the repository browser.