source: trunk/build.xml @ 3978

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

References #827 Created ReporterService? and a method to get the extended properties for reporters.

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