source: branches/2.6-stable/build.xml @ 4175

Last change on this file since 4175 was 4175, checked in by Nicklas Nordborg, 14 years ago

Fixes #949: Installation documentation has incorrect information about which Java version to use

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