source: trunk/build.xml @ 4508

Last change on this file since 4508 was 4508, checked in by Jari Häkkinen, 13 years ago

Addresses #1106. Missed to change reference wherefrom retrive GPLv3 license text. And some other changes.

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