source: branches/2.14-stable/build.xml @ 5153

Last change on this file since 5153 was 5153, checked in by Nicklas Nordborg, 12 years ago

Preparing release 2.14

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 49.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 5153 2009-10-22 06:28:14Z nicklas $
4
5    Copyright (C) 2005 Samuel Andersson, Johan Enell, Jari Häkkinen, Nicklas Nordborg, Gregory Vincic
6    Copyright (C) 2006, 2007 Johan Enell, Jari Häkkinen, 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="14" />
69  <property name="base.maintenanceversion" value="0" />
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="UTF-8"
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      javaencoding="${javac.encoding}"
812     
813    />
814    <javac
815      destdir="${jsp.build}/classes"
816      srcdir="${jsp.build}/src"
817      debug="true"
818      classpathref="jsp.compile.classpath"
819      memoryinitialsize="256m"
820      memorymaximumsize="512m"
821      fork="true"
822      source="${javac.source}"
823      target="${javac.target}"
824      encoding="${javac.encoding}"
825      >
826    </javac>
827  </target>
828 
829  <!-- XJsp compiler targets -->
830  <target
831    name="xjspcompiler"
832    depends="web.compile,core.compile"
833    description="Compile the XJsp compiler and put JAR in ./bin/jar"
834    >
835    <mkdir dir="${build}/misc/compiler" />
836    <javac
837      srcdir="${xjspcompiler.src}"
838      destdir="${build}/misc/compiler"
839      classpathref="web.classpath"
840      encoding="${javac.encoding}"
841      debug="true"
842      deprecation="true"
843      source="${javac.source}"
844      target="${javac.target}"
845      >
846      <compilerarg value="${javac.arg}" />
847    </javac>
848    <jar
849      basedir="${build}/misc/compiler"
850      jarfile="${bin}/jar/base2-xjsp-compiler.jar"
851    />
852  </target> 
853 
854  <!-- webservices targets -->
855  <target
856    name="webservices.init"
857    depends="core.init,coreplugins.init,web.init"
858    >
859    <property name="webservices.src" location="${src}/webservices" 
860      description="Location of source files" />
861    <property name="webservices.build" location="${build}/webservices" 
862      description="Location of compiled files" />
863    <property name="webservices.wsdlpath" location="misc/wsdl"
864      description="Location of created wsdl-files" />
865    <path id="webservices.server.classpath" 
866      description="Class path for compiling server part of webservices"
867      >
868      <path refid="lib.webservices.classpath" />
869      <path refid="core.classpath"/>
870      <pathelement location="${core.build}"/>
871      <pathelement location="${coreplugins.build}"/>
872      <pathelement location="${web.build}"/>
873    </path>
874    <path id="webservices.client.classpath" 
875      description="Class path for compiling client part of webservices"
876      >
877      <path refid="lib.webservices.classpath" />
878      <pathelement location="${info.build}"/>
879    </path>
880  </target>
881
882  <target
883    name="check.wsdl"
884    depends="webservices.init"
885    >
886    <uptodate
887      property="nowsdl"
888      >
889      <srcfiles dir="${webservices.src}/server" includes="**/*.java" />
890      <mapper type="merge" to="${webservices.wsdlpath}/SessionService.wsdl" />
891    </uptodate>
892    <condition property="wsdl.message" 
893      value="WSDL files are up to date; skipping" 
894      >
895      <istrue value="${nowsdl}" />
896    </condition>
897    <condition property="wsdl.message" 
898      value="WSDL files may not be up to date; generating new" 
899      >
900      <isfalse value="${nowsdl}" />
901    </condition>
902    <echo>${wsdl.message}</echo>
903  </target> 
904 
905  <target
906    name="webservices.compile"
907    depends="webservices.server.compile,webservices.client.compile"
908    description="Compile the core web services"
909    >
910  </target>
911 
912  <target
913    name="webservices.server.compile"
914    description="Compile the server part of webservices"
915    depends="webservices.init,core.compile,coreplugins.compile,web.compile"
916    >
917    <mkdir dir="${webservices.build}/server" />
918    <javac
919      destdir="${webservices.build}/server"
920      classpathref="webservices.server.classpath"
921      encoding="${javac.encoding}"
922      debug="true"
923      deprecation="true"
924      source="${javac.source}"
925      target="${javac.target}"
926      >
927      <src path="${webservices.src}/server" />
928      <compilerarg value="${javac.arg}" />
929    </javac>
930    <copy todir="${webservices.build}/server" 
931      description="Resource files needed by the webservices; excludes documentation and source files"
932      includeEmptyDirs="false"
933      >
934      <fileset dir="${webservices.src}/server">
935        <include name="**/*" />
936        <exclude name="**/*.java" />
937        <exclude name="**/doc-files/" />
938        <exclude name="**/package.html" />
939      </fileset>
940    </copy>
941  </target>
942
943  <target
944    name="webservices.client.compile"
945    description="Compile the client part of webservices"
946    depends="webservices.init,info.compile"
947    >
948    <mkdir dir="${webservices.build}/client" />
949    <javac
950      destdir="${webservices.build}/client"
951      classpathref="webservices.client.classpath"
952      encoding="${javac.encoding}"
953      debug="true"
954      deprecation="true"
955      source="${javac.source}"
956      target="${javac.target}"
957      >
958      <src path="${webservices.src}/client/java" />
959      <compilerarg value="${javac.arg}" />
960    </javac>
961  </target>
962 
963  <target 
964    name="webservices.wsdl"
965    description="Generate WSDL files for webservices"
966    depends="check.wsdl,webservices.compile"
967    unless="nowsdl"
968    >
969    <mkdir dir="${webservices.wsdlpath}" />
970    <webservices.wsdl serviceClassName="ArrayDesignService"/>
971    <webservices.wsdl serviceClassName="BioAssaySetService"/>
972    <webservices.wsdl serviceClassName="ExperimentService"/>
973    <webservices.wsdl serviceClassName="ProjectService"/>
974    <webservices.wsdl serviceClassName="RawBioAssayService"/>
975    <webservices.wsdl serviceClassName="SessionService"/>
976    <webservices.wsdl serviceClassName="ReporterService"/>
977    <webservices.wsdl serviceClassName="AnnotationTypeService"/>
978  </target>
979 
980  <!-- Creates a WSDL file for a Webservice class -->
981    <macrodef name="webservices.wsdl">
982        <attribute name="serviceClassName"/>
983        <sequential>
984          <java2WSDL
985        classpath="${webservices.build}/server;${info.build};${core.build}"
986        className="net.sf.basedb.ws.server.@{serviceClassName}"
987        outputLocation="${webservices.wsdlpath}"     
988        serviceName="@{serviceClassName}"
989        outputFileName="@{serviceClassName}.wsdl"
990        >   
991      </java2WSDL>   
992        </sequential>
993    </macrodef>
994 
995  <target
996    name="webservices.jar"
997    depends="webservices.compile"
998    description="Create the core webservices aar file and client jar"
999    >
1000    <mkdir dir="${config}/../services" />
1001    <!-- server side: core.aar -->
1002    <jar
1003      basedir="${webservices.build}/server"
1004      jarfile="${config}/../services/core.aar"
1005    />
1006    <!-- client side: BASE2WSClient.jar -->
1007    <jar
1008      jarfile="${jar}/BASE2WSClient.jar"
1009      >
1010      <fileset dir="${webservices.build}/client" />
1011      <fileset dir="${info.build}" />
1012    </jar>
1013  </target>
1014 
1015  <!-- installprg targets -->
1016  <target
1017    name="installprg.init"
1018    depends="core.init,coreplugins.init,web.init"
1019    >
1020    <property name="installprg.src" location="${src}/install" 
1021      description="Location of source files" />
1022    <property name="installprg.build" location="${build}/install" 
1023      description="Location of compiled files" />
1024    <path id="installprg.classpath" description="Class path for compiling installation programs">
1025      <path refid="core.classpath"/>
1026      <pathelement location="${core.build}"/>
1027      <pathelement location="${coreplugins.build}"/>
1028      <pathelement location="${web.build}"/>
1029    </path>
1030  </target>
1031  <target
1032    name="installprg.compile"
1033    depends="installprg.init,core.compile"
1034    description="Compile the installation programs"
1035    >
1036    <mkdir dir="${installprg.build}" />
1037    <javac
1038      srcdir="${installprg.src}"
1039      destdir="${installprg.build}"
1040      classpathref="installprg.classpath"
1041      encoding="${javac.encoding}"
1042      debug="true"
1043      deprecation="true"
1044      source="${javac.source}"
1045      target="${javac.target}"
1046      >
1047      <compilerarg value="${javac.arg}" />
1048    </javac>
1049  </target>
1050 
1051  <target
1052    name="installprg.jar"
1053    depends="installprg.compile"
1054    description="Create the installation jar file: BASE2Install.jar"
1055    >
1056    <jar
1057      basedir="${installprg.build}"
1058      jarfile="${bin}/jar/BASE2Install.jar"
1059    />
1060  </target>
1061
1062  <!-- jobagent targets -->
1063  <target
1064    name="jobagent.init"
1065    depends="core.init,coreplugins.init,web.init"
1066    >
1067    <property name="jobagent.src" location="${src}/clients/jobagent" 
1068      description="Location of source files" />
1069    <property name="jobagent.build" location="${build}/clients/jobagent" 
1070      description="Location of compiled files" />
1071    <path id="jobagent.classpath" description="Class path for compiling jobagent">
1072      <path refid="core.classpath"/>
1073      <pathelement location="${core.build}"/>
1074    </path>
1075  </target>
1076  <target
1077    name="jobagent.compile"
1078    depends="jobagent.init,core.compile"
1079    description="Compile the job agent application"
1080    >
1081    <mkdir dir="${jobagent.build}" />
1082    <javac
1083      srcdir="${jobagent.src}"
1084      destdir="${jobagent.build}"
1085      classpathref="jobagent.classpath"
1086      encoding="${javac.encoding}"
1087      debug="true"
1088      deprecation="true"
1089      source="${javac.source}"
1090      target="${javac.target}"
1091      >
1092      <compilerarg value="${javac.arg}" />
1093    </javac>
1094  </target>
1095 
1096  <target
1097    name="jobagent.jar"
1098    depends="jobagent.compile"
1099    description="Create the job agent jar file: JobAgent.jar"
1100    >
1101    <jar
1102      basedir="${jobagent.build}"
1103      jarfile="${bin}/jar/JobAgent.jar"
1104    />
1105  </target>
1106
1107  <!-- migrate targets -->
1108  <target
1109    name="migrate.init"
1110    depends="core.init,coreplugins.init,web.init"
1111    >
1112    <property name="migrate.src" location="${src}/clients/migrate" 
1113      description="Location of source files" />
1114    <property name="migrate.build" location="${build}/clients/migrate" 
1115      description="Location of compiled files" />
1116    <path id="migrate.classpath" description="Class path for compiling migration tool">
1117      <path refid="core.classpath"/>
1118      <pathelement location="${core.build}"/>
1119    </path>
1120  </target>
1121  <target
1122    name="migrate.compile"
1123    depends="migrate.init,core.compile"
1124    description="Compile the migration tool"
1125    >
1126    <mkdir dir="${migrate.build}" />
1127    <javac
1128      srcdir="${migrate.src}"
1129      destdir="${migrate.build}"
1130      classpathref="migrate.classpath"
1131      encoding="${javac.encoding}"
1132      debug="true"
1133      deprecation="true"
1134      source="${javac.source}"
1135      target="${javac.target}"
1136      >
1137      <compilerarg value="${javac.arg}" />
1138    </javac>
1139  </target>
1140 
1141  <target
1142    name="migrate.jar"
1143    depends="migrate.compile"
1144    description="Create the migration tool jar file: Migrate.jar"
1145    >
1146    <jar
1147      basedir="${migrate.build}"
1148      jarfile="${bin}/jar/Migrate.jar"
1149    />
1150  </target>
1151 
1152  <!-- documentation targets -->
1153  <target
1154    name="doc.init"
1155    depends="core.init"
1156    >
1157    <property name="javadoc.src" location="doc/src/javadoc" 
1158      description="Location of javadoc source files" />
1159    <property name="docbook.src" location="doc/src/docbook" 
1160      description="Location of docbook source XML files" />
1161    <path id="javadoc.classpath" description="Class path for generating javadoc">
1162      <path refid="core.classpath" />
1163      <path refid="lib.servlet.classpath" />
1164      <path refid="lib.webservices.classpath" />
1165    </path>
1166    <property name="docbook.html.out" location="${doc}/html" />
1167    <property name="docbook.pdf.out" location="${doc}" />
1168  </target>
1169 
1170  <target
1171    name="doc.javadoc"
1172    depends="doc.init,core.init,coreplugins.init,web.init,migrate.init,jobagent.init,webservices.init"
1173    description="Generate JavaDoc of entire API"
1174    >
1175    <!-- Create the time stamp -->
1176    <tstamp>
1177      <format property="TODAY" pattern="yyyy-MM-dd"/>
1178    </tstamp>
1179    <delete dir="${doc}/api" />
1180    <mkdir dir="${doc}/api"/>
1181
1182    <javadoc
1183      packagenames="net.sf.basedb.*"
1184      sourcepath="${info.src}:${core.src}:${coreplugins.src}:${web.src}:${xjspcompiler.src}:${migrate.src}:${jobagent.src}:${webservices.src}/server:${webservices.src}/client/java"
1185      destdir="${doc}/api"
1186      author="true"
1187      version="true"
1188      use="false"
1189      private="true"
1190      windowtitle="BASE ${base.version} API documentation"
1191      stylesheetfile="${javadoc.src}/javadoc.css"
1192      classpathref="javadoc.classpath"
1193      linksource="false"
1194      breakiterator="yes"
1195      encoding="${javac.encoding}"
1196      overview="${javadoc.src}/overview.html"
1197      maxmemory="256M"
1198      >
1199      <group title="Public API">
1200        <package name="net.sf.basedb.info" />
1201        <package name="net.sf.basedb.core" />
1202        <package name="net.sf.basedb.core.plugin" />
1203        <package name="net.sf.basedb.core.query" />
1204        <package name="net.sf.basedb.core.signal" />
1205        <package name="net.sf.basedb.util*" />
1206        <package name="net.sf.basedb.clients.web.taglib*" />
1207        <package name="net.sf.basedb.plugins*" />
1208        <package name="net.sf.basedb.core.authentication" />
1209        <package name="net.sf.basedb.ws.client" />
1210        <package name="net.sf.basedb.core.filehandler" />
1211        <package name="net.sf.basedb.clients.web.extensions*" />
1212      </group>
1213      <group title="Mixed Public and Internal API">
1214        <package name="net.sf.basedb.core.data" />
1215        <package name="net.sf.basedb.clients.web" />
1216        <package name="net.sf.basedb.clients.web.util" />
1217        <package name="net.sf.basedb.util.overview" />
1218      </group>
1219      <group title="Extension API">
1220        <package name="net.sf.basedb.core.dbengine" />
1221        <package name="net.sf.basedb.clients.jobagent" />
1222        <package name="net.sf.basedb.ws.server*" />
1223      </group>
1224      <group title="Internal API">
1225        <package name="net.sf.basedb.core.data.keyring" />
1226        <package name="net.sf.basedb.clients.jobagent.*" />
1227        <package name="net.sf.basedb.clients.migrate*" />
1228        <package name="net.sf.basedb.clients.web.*" />
1229        <package name="net.sf.basedb.core.hibernate" />
1230      </group>
1231     
1232      <header><![CDATA[${base.version}: ${TODAY}]]></header>
1233      <link href="http://java.sun.com/javase/6/docs/api"/>
1234      <link href="http://www.hibernate.org/hib_docs/v3/api"/>
1235      <link href="http://www.jdom.org/docs/apidocs/" />
1236      <link href="http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/" />
1237      <link href="http://java.sun.com/products/jsp/2.1/docs/jsp-2_1-pfd2/" />
1238      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1239      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1240      <link href="http://logging.apache.org/log4j/docs/api/" />
1241      <link href="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/" />
1242      <link href="http://tomcat.apache.org/tomcat-6.0-doc/api/" />
1243      <tag name="base.developer" description="Developer info" />
1244      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1245      <tag name="base.modified" description="Last modified" />
1246      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1247      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1248      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1249      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1250      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1251      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1252      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1253      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1254      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1255      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1256      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1257      <tag name="hibernate.array" description="Hibernate: array" scope="methods" />
1258      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1259      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1260      <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" />
1261      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1262      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1263      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1264      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1265      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1266      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1267      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1268      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1269      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1270      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1271      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1272      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1273    </javadoc>
1274  </target>
1275 
1276  <target
1277    name="doc.docbook"
1278    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1279    description="Generate docbook user and admin documentation."
1280    >
1281  </target>
1282   
1283  <target 
1284    name="doc.docbook.html"
1285    depends="dev.init,doc.init,xsltprocessor"
1286    >
1287    <mkdir dir="${docbook.html.out}" />
1288    <!--Create subdirectories to store the chunked files in-->
1289    <mkdir dir="${docbook.html.out}/admindoc"/>
1290    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1291    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1292    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1293    <mkdir dir="${docbook.html.out}/admindoc/extensions"/>
1294    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1295    <mkdir dir="${docbook.html.out}/developerdoc"/>
1296    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1297    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1298    <mkdir dir="${docbook.html.out}/developerdoc/extensions"/>
1299    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1300    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1301    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1302    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1303    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1304    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1305    <mkdir dir="${docbook.html.out}/overviewdoc/features"/>
1306    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1307    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1308    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1309    <mkdir dir="${docbook.html.out}/userdoc"/>
1310    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1311    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1312    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1313    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1314    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1315    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1316    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1317    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1318    <mkdir dir="${docbook.html.out}/userdoc/import"/>
1319    <mkdir dir="${docbook.html.out}/userdoc/export"/>
1320    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1321    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1322    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1323    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1324    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1325    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1326    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1327    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1328    <mkdir dir="${docbook.html.out}/faqsdoc" />
1329    <mkdir dir="${docbook.html.out}/faqsdoc/faqs" />
1330    <mkdir dir="${docbook.html.out}/appendix" />
1331       
1332    <mkdir dir="${build}/docbook/html" />
1333    <delete description="Delete existing documents">
1334      <fileset dir="${build}/docbook" defaultexcludes="no" />
1335      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1336    </delete>
1337    <delete file="data/helptexts.xml" />
1338    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1339      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1340      <property name="docbook.xml.dir" location="${docbook.src}" />
1341      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1342      <property name="distribution.dir" location="${docbook.html.out}" />
1343      <property name="build.dir" location="${build}/docbook/html" />
1344      <property name="base.version" value="${base.version}"/>
1345    </ant>
1346     <copy todir="${docbook.html.out}">
1347         <fileset dir="${docbook.src}" includes="css/*.*" />
1348         <fileset dir="${docbook.src}" includes="script/*.*" />
1349     </copy>
1350   
1351    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1352    <path id="ant-extensions">
1353        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1354        <pathelement path="${lib}/docbook/ant-extensions" />
1355      </path>
1356   
1357    <xmlcatalog id="dtdcatalog">
1358          <catalogpath>
1359              <fileset file="${catalog.location}"/>
1360          </catalogpath>
1361      </xmlcatalog>
1362
1363      <xslt
1364          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1365          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1366          out     = "data/helptexts.xml"
1367          processor = "${xslt.processor}"
1368          >
1369          <xmlcatalog refid="dtdcatalog"/>
1370          <classpath refid="ant-extensions" />
1371
1372          <param name="xsltproc.catalog" expression="${catalog.location}" />
1373          <param name="xsltproc.option.--nonet"  expression="" />
1374      </xslt>
1375
1376    <replaceregexp 
1377      file="data/helptexts.xml"
1378      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1379      replace="&amp;lt;\$1&amp;gt;"
1380      flags="sg"
1381    />
1382  </target>
1383 
1384  <target 
1385    name="doc.docbook.pdf"
1386    depends="dev.init,doc.init"
1387    >
1388    <!-- Generate a pdf file from the documentation source -->
1389    <mkdir dir="${build}/docbook/pdf" />
1390    <echo>Generate pdf file</echo>
1391    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1392      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1393      <property name="docbook.xml.dir" location="${docbook.src}" />
1394      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1395      <property name="distribution.dir" location="${docbook.pdf.out}" />
1396      <property name="build.dir" location="${build}/docbook/pdf" />
1397      <property name="pdf.name" value="base.pdf" />
1398      <property name="base.version" value="${base.version}"/>
1399    </ant>
1400  </target>
1401 
1402  <target 
1403    name="doc.dist"
1404    description="Copy documentation to the binary distribution"
1405    >
1406    <mkdir dir="dist/doc" />
1407    <copy todir="dist/doc">
1408      <!--fileset dir="doc" includes="admin/**/*" /-->
1409      <!--fileset dir="doc" includes="development/**/*" /-->
1410      <fileset dir="doc" includes="licenses/**/*" />
1411      <fileset dir="doc" includes="historical/**/*" />
1412      <fileset dir="doc" includes="test/**/*" />
1413      <!--fileset dir="doc" includes="user/**/*" /-->
1414      <fileset dir="doc" includes="*.*" />
1415    </copy>
1416  </target>
1417
1418  <target name="xsltprocessor">
1419      <property environment="env"/>
1420
1421      <condition  property="executable.file.extension"
1422                  value=".exe">
1423              <os family="windows"/>
1424      </condition>
1425      <condition  property="executable.file.extension"
1426                  value="">
1427              <os family="unix"/>
1428      </condition>
1429     
1430      <condition  property="tmp:xsltproc.available"
1431                  value="xsltproc${executable.file.extension}">
1432          <or>
1433              <and>
1434                  <os family="windows"/>
1435                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1436              </and>
1437              <and>
1438                  <os family="unix"/>
1439                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1440              </and>
1441          </or>
1442      </condition>
1443     
1444      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1445          <and>
1446              <isset property="tmp:xsltproc.available" />
1447              <not>
1448                  <isset property="disable.xsltproc" />
1449              </not>
1450          </and>
1451      </condition>
1452     
1453      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1454          <not>
1455              <isset property="disable.saxon" />
1456          </not>
1457      </condition>
1458
1459      <condition property="xslt.processor" value="trax">
1460          <not>
1461          <and>
1462                  <isset property="tmp:xsltproc.available" />
1463                  <not>
1464                      <isset property="disable.xsltproc" />
1465                  </not>
1466          </and>
1467          </not>
1468      </condition>
1469
1470    </target>
1471 
1472  <!--package targets -->
1473  <target
1474    name="package.bin"
1475    depends="dist"
1476    description="Create binary distribution package"
1477    >
1478    <mkdir dir="${package}" />
1479    <tar
1480      destfile="${package}/base-${base.version}.tar.gz"
1481      longfile="gnu"
1482      compression="gzip"
1483      >
1484      <tarfileset
1485        dir="${dist}"
1486        mode="755"
1487        prefix="base-${base.version}"
1488        preserveLeadingSlashes="true"
1489        >
1490        <include name="**/*.sh" />
1491      </tarfileset>
1492      <tarfileset
1493        dir="${dist}"
1494        prefix="base-${base.version}"
1495        preserveLeadingSlashes="true"
1496        >
1497        <exclude name="**/*.sh" />
1498      </tarfileset>
1499    </tar>
1500    <checksum file="${package}/base-${base.version}.tar.gz" />
1501  </target>
1502 
1503  <target
1504    name="package.src"
1505    depends="svn.revision"
1506    description="Create source distribution package"
1507    >
1508    <property name="tempdir" location="base-${base.version}-src" />
1509    <delete dir="${tempdir}" failonerror="false"/>
1510    <svn>
1511      <export srcPath="." destPath="${tempdir}" />
1512    </svn>
1513    <replaceregexp 
1514      file="${tempdir}/build.xml"
1515      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1516      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1517      flags="s"
1518    />
1519    <replace file="${tempdir}/build.xml"
1520      description="Remove references to package.src">
1521      <replacefilter 
1522        token="package.bin,package.src"
1523        value="package.bin"
1524      />
1525    </replace>
1526    <replaceregexp 
1527      file="${tempdir}/build.xml"
1528      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1529      replace=""
1530      flags="s"
1531      description="Remove package.src target"
1532    />
1533    <mkdir dir="${package}" />
1534      <tar
1535      destfile="${package}/base-${base.version}-src.tar.gz"
1536      longfile="gnu"
1537      compression="gzip"
1538      >
1539      <tarfileset
1540        dir="${tempdir}"
1541        mode="755"
1542        prefix="base-${base.version}-src"
1543        preserveLeadingSlashes="true"
1544        >
1545        <include name="**/*.sh" />
1546      </tarfileset>
1547      <tarfileset
1548        dir="${tempdir}"
1549        prefix="base-${base.version}-src"
1550        preserveLeadingSlashes="true"
1551        >
1552        <exclude name="**/*.sh" />
1553      </tarfileset>
1554    </tar>
1555    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1556    <delete dir="${tempdir}" />
1557  </target>
1558   
1559  <target 
1560    name="svn.update"
1561    description="Issues an 'svn update' command to check out the latest revision from subversion"
1562    >
1563    <svn>
1564      <update dir="." />
1565    </svn>
1566  </target>
1567 
1568  <target
1569    name="svn.diff"
1570    depends="svn.revision"
1571    description="Issues an 'svn diff' command to generate a patch with local changes"
1572    >
1573    <echo>NOTE! New files must be added to svn with 'svn add' or they will not be added to the patch.</echo>
1574    <property name="patchfile" value="patch-${base.build}.diff" />
1575    <pathconvert property="patchdir" dirsep="/" >
1576      <path location="." />
1577    </pathconvert>
1578    <svn>
1579      <diff oldpath="." outfile="${patchfile}"/>
1580    </svn>
1581    <replaceregexp file="${patchfile}" match="${patchdir}/" replace="" flags="g" />
1582    <echo>Generated patch file: ${patchfile}</echo>
1583  </target>
1584   
1585</project>
Note: See TracBrowser for help on using the repository browser.