source: branches/2.11-stable/build.xml @ 4863

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

Changes for future release 2.11.1

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