source: branches/2.8-stable/build.xml @ 4501

Last change on this file since 4501 was 4501, checked in by Nicklas Nordborg, 13 years ago

Changes for future release 2.8.2

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 48.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 4501 2008-09-10 09:32:14Z nicklas $
4
5    Copyright (C) 2005 Samuel Andersson, Johan Enell, Jari Hakkinen, Nicklas Nordborg, Gregory Vincic
6    Copyright (C) 2006, 2007 Johan Enell, Jari Hakkinen, Nicklas Nordborg, Martin Svensson
7
8    This file is part of BASE - BioArray Software Environment.
9    Available at http://base.thep.lu.se/
10
11    BASE is free software; you can redistribute it and/or modify it
12    under the terms of the GNU General Public License as published by
13    the Free Software Foundation; either version 3 of the License, or
14    (at your option) any later version.
15
16    BASE is distributed in the hope that it will be useful, but
17    WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24    02111-1307, USA.
25-->
26
27<project
28  name="BASE"
29  default="dev"
30  basedir="."
31  >
32  <description>
33    Build file for BASE. The main targets are ('dev' is default):
34
35    Clean up:
36    clean:        Remove all generated files
37
38    Compiling code
39    core:         Build core for local use
40    coreplugins:  Build core plugins for local use
41    dev:          Build everything for local use
42    dist:         Build everything (except test) for distribution (put in 'dist'
43                  subdirectory)
44    installprg:   Build installation programs for local use
45    jobagent:     Build jobagent for local use
46    migrate:      Build migration tool for local use
47    webservices:  Build webservices for local use
48    test:         Build test programs
49    web:          Build web client application for local use
50   
51    Documentation:
52    doc:          Build documentation for local use
53    doc.javadoc:  Build javadoc for local use
54    doc.docbook:  Build docbook documentation for local use
55    helptext:     Generate help text import file from the docbook documentation
56
57    Packaging:
58    package:          Create *.tar.gz files with binary, source and exampele distributions
59    package.bin       Create binary distribution only
60    package.src       Create source distribution only
61  </description>
62
63  <!-- set BASE version
64    Use numerical versions for bugfix (maintenance) releases starting
65    with "1". Use "0" for the first release of a new trunk version.  Add
66    "pre" to unreleased versions.  Examples: 2.1.1pre, 2.1.1,
67    2.1.2pre, 2.2.2, 2.2.0pre, 2.2.0, 2.2.1pre, 2.2.1
68  -->
69  <property name="base.majorversion" value="2" />
70  <property name="base.minorversion" value="8" />
71  <property name="base.maintenanceversion" value="2pre" />
72  <property name="base.version" 
73    value="${base.majorversion}.${base.minorversion}.${base.maintenanceversion}" />
74 
75  <!-- set other global properties for this build -->
76  <property name="javac.arg" value="-Xlint:unchecked" 
77    description="Extra arguments sent to Java compiler" />
78  <property name="javac.source" value="1.5"
79    description="Default value for the 'source' attribute when compiling java code" />
80  <property name="javac.target" value="1.5"
81    description="Default value for the 'target' attribute when compiling java code" />
82  <property name="javac.encoding" value="ISO-8859-1"
83    description="Default value for the 'encoding' attribute when compiling java code" />
84  <property name="src" location="src" description="Location of source files" />
85  <property name="build" location="build" description="Location of compiled files" />
86  <property name="dist" location="dist" description="Directory where distribution should be created" />
87  <property name="package" location="package" description="Directory where packaged distribution files are created"/>
88  <property name="lib" location="lib" description="Location of 3rd-party JAR files" />
89  <property name="config.dist" location="config/dist" 
90    description="Location of default configuration files" />
91  <property name="config.local" location="config/local" 
92    description="Location of local configuration files" />
93 
94  <!-- classpaths to library files -->
95  <path id="lib.dist.classpath">
96    <fileset dir="${lib}/dist">
97      <include name="**/*.jar"/>
98    </fileset>
99  </path>
100
101  <path id="lib.webservices.classpath">
102    <fileset dir="${lib}/webservices">
103      <include name="**/*.jar"/>
104    </fileset>
105  </path>
106 
107  <path id="lib.svn.classpath">
108    <fileset dir="${lib}/svn">
109      <include name="**/*.jar"/>
110    </fileset>
111  </path>
112 
113  <path id="lib.hibernatedoclet.classpath">
114    <fileset dir="${lib}/hibernatedoclet">
115      <include name="**/*.jar"/>
116    </fileset>
117  </path>
118 
119  <path id="lib.servlet.classpath">
120    <fileset dir="${lib}/servlet">
121      <include name="**/*.jar"/>
122    </fileset>
123  </path>
124 
125  <!-- pattern for configuration files use by copy.config -->
126  <patternset id="config.files">
127    <include name="**/*.*" />
128    <exclude name="web.xml" />
129    <exclude name="readme.txt" />
130  </patternset>
131 
132  <!-- task definitions -->
133  <taskdef
134    name="hibernatedoclet"
135    classname="xdoclet.modules.hibernate.HibernateDocletTask"
136    description="Task for generating Hibernate mapping files from XDoclet tags"
137    >
138    <classpath>
139      <path refid="lib.hibernatedoclet.classpath" />
140    </classpath>
141  </taskdef>
142
143  <taskdef
144    name="svn"
145    classname="org.tigris.subversion.svnant.SvnTask"
146    description="Task for interacting with subversion"
147    >
148    <classpath>
149      <path refid="lib.svn.classpath" />
150    </classpath>
151  </taskdef>
152 
153  <taskdef
154    name="java2WSDL"
155    classname="org.apache.ws.java2wsdl.Java2WSDLTask"
156    description="Task for creating wsdl files for the web services"
157    >
158    <classpath>
159      <path refid="lib.dist.classpath" />
160      <path refid="lib.webservices.classpath" />
161      <pathelement location="config/local" />
162      <pathelement location="config/dist" />
163    </classpath>
164  </taskdef>
165 
166  <!-- main targets -->
167  <target
168    name="clean"
169    description="Remove all generated files and backup files" >
170    <delete failonerror="false" includeemptydirs="true">
171      <fileset dir="${build}" defaultexcludes="no" />
172      <fileset dir="${dist}" defaultexcludes="no" />
173      <fileset dir="${package}" defaultexcludes="no" />
174      <fileset dir="bin/jar" defaultexcludes="no" />
175      <fileset dir="misc/wsdl" defaultexcludes="no" />
176      <fileset dir="www/WEB-INF/lib" defaultexcludes="no" />
177      <fileset dir="www/WEB-INF/classes" defaultexcludes="no" />
178      <fileset dir="www/WEB-INF/conf" defaultexcludes="no" />
179      <fileset dir="www/WEB-INF/services" defaultexcludes="no" />
180      <fileset dir="www/WEB-INF" includes="web.xml" defaultexcludes="no" />
181      <fileset dir="doc/api" defaultexcludes="no" />
182      <fileset dir="doc/html" defaultexcludes="no" />
183      <fileset file="doc/base.pdf" />
184      <fileset file="data/helptexts.xml" />
185    </delete>
186  </target>
187 
188  <target
189    name="dist"
190    depends="clean,dist.init,core.jar,coreplugins.jar,web.jar,xjspcompiler,webservices.jar,webservices.wsdl,
191      installprg.jar,jobagent.jar,migrate.jar,copy.config,copy.jar,doc,doc.dist"
192    description="Create everything needed for distribution"
193    >
194    <copy file="${config.dist}/web.xml" todir="${config}/.." description="Default web.xml" />
195    <copy todir="${dist}/www" description="JSP files, etc.">
196      <fileset dir="www" />
197    </copy>
198    <copy todir="${dist}/data" description="Additional data files">
199      <fileset dir="data" />
200    </copy>
201    <copy todir="${dist}/bin" description="Scripts, etc.">
202      <fileset dir="bin" />
203    </copy>
204    <copy todir="${dist}/misc" description="Other files">
205      <fileset dir="misc">
206        <include name="sql/**/*" />
207        <include name="config/**/*" />
208        <include name="wsdl/**/*" />
209      </fileset>
210    </copy>
211    <copy todir="${dist}" description="License and creadits">
212      <fileset file="base2.license.txt" />
213      <fileset file="credits.txt" />
214    </copy>
215    <chmod dir="." includes="**/*.sh" perm="a+x" description="Make all scripts executable" />
216  </target>
217
218  <target
219    name="package"
220    depends="package.bin,package.src"
221    description="Generate tar.gz files for the binary and source distribution"
222    >
223  </target>
224 
225  <target
226    name="dev"
227    depends="dev.init,core,coreplugins,web,webservices,installprg,jobagent,migrate,test"
228    description="Create a runnable local installation"
229  />
230 
231  <target
232    name="core"
233    depends="dev.init,core.jar"
234    description="Build the core for local use"
235  />
236
237  <target
238    name="coreplugins"
239    depends="core,coreplugins.jar"
240    description="Build the core plugins for local use"
241  />
242 
243  <target
244    name="test"
245    depends="test.jar,core.hibernate"
246    description="Compile the test programs for local use"
247    >
248    <mkdir dir="${test.build}/data" />
249    <copy todir="${test.build}/data" description="Test-data files">
250      <fileset dir="${test.src}/data">
251        <include name="**/*" />
252      </fileset>
253    </copy>
254    <copy todir="${test.build}" description="Script files, etc.">
255      <fileset dir="${test.src}">
256        <include name="**/*" />
257        <exclude name="**/*.java" />
258      </fileset>
259    </copy>
260    <chmod dir="${test.build}" includes="*.sh" perm="a+x"/>
261  </target>
262 
263  <target
264    name="web"
265    depends="core,coreplugins,web.jar,xjspcompiler,copy.config,copy.jar"
266    description="Build web client application for local use"
267    >
268  </target>
269 
270  <target
271    name="webservices"
272    depends="core,web,webservices.jar,webservices.wsdl"
273    description="Build webservices for local use"
274  />
275 
276  <target
277    name="installprg"
278    depends="core,web,installprg.jar"
279    description="Build installation programs for local use"
280  />
281 
282  <target
283    name="jobagent"
284    depends="core,web,jobagent.jar"
285    description="Build job agent for local use"
286  />
287 
288  <target
289    name="migrate"
290    depends="core,web,migrate.jar"
291    description="Build migration tool for local use"
292  />
293 
294  <target
295    name="doc"
296    depends="doc.javadoc,doc.docbook"
297    description="Generate documentation (javadoc and docbook) for local use and distribution"
298  />
299 
300  <!-- init targets -->
301  <target
302    name="init"
303    depends="svn.revision"
304    description="Initialise things"
305    >
306  </target>
307 
308  <target
309    name="dist.init"
310    depends="init"
311    unless="isDev"
312    >
313    <property name="isDist" value="1" />
314    <property name="jar" location="${dist}/www/WEB-INF/lib" />
315    <property name="config" location="${dist}/www/WEB-INF/classes" />
316    <property name="bin" location="${dist}/bin" />
317    <property name="doc" location="${dist}/doc" />
318    <property name="plugins" location="${dist}/plugins" />
319    <mkdir dir="${jar}" />
320    <mkdir dir="${config}" />
321    <mkdir dir="${bin}" />
322    <mkdir dir="${bin}/jar" />
323    <mkdir dir="${dist}/data" />
324    <mkdir dir="${dist}/doc" />
325    <mkdir dir="${dist}/misc" />
326  </target>
327 
328  <target
329    name="dev.init"
330    depends="init"
331    unless="isDist"
332    >
333    <property name="isDev" value="1" />
334    <property name="jar" location="www/WEB-INF/lib" />
335    <property name="config" location="www/WEB-INF/classes" />
336    <property name="bin" location="bin" />
337    <property name="doc" location="doc" />
338    <property name="plugins" location="plugins" />
339    <mkdir dir="${bin}/jar" />
340    <mkdir dir="${jar}" />
341    <mkdir dir="${config}" />
342  </target>
343 
344  <target 
345    name="svn.revision"
346    description="Get the current revision number in the subversion and put the
347      value into the base.build property; replaced by constant expression in source distributions"
348    >
349    <svn>
350      <status path="." lastChangedRevisionProperty="base.build" />
351    </svn>
352    <echo message="Build #${base.build}" />
353  </target>
354 
355  <!-- configuration targets -->
356  <target
357    name="copy.config"
358    depends="copy.config.local,copy.config.dist"
359    description="Copies configuration files to the appropriate folder"
360    >
361    <!-- move axis2.xml to the correct place -->
362    <mkdir dir="${config}/../conf" />
363    <move file="${config}/axis2.xml" todir="${config}/../conf" overwrite="true" />
364  </target>
365   
366  <target
367    name="copy.config.dist"
368    >
369    <copy todir="${config}" description="Default configuration files">
370      <fileset dir="${config.dist}">
371        <patternset refid="config.files" />
372        <present present="srconly" targetdir="${config}" />
373      </fileset>
374    </copy>
375    <copy todir="${config}/.."  description="Default web.xml">
376      <fileset dir="${config.dist}">
377        <include name="web.xml" />
378        <present present="srconly" targetdir="${config}/.." />
379      </fileset>
380    </copy>
381  </target>
382 
383  <target
384    name="copy.config.local"
385    if="isDev"
386    unless="isDist"
387    >
388    <copy todir="${config}" description="Local configuration files">
389      <fileset dir="${config.local}">
390        <patternset refid="config.files" />
391      </fileset>
392    </copy>
393    <copy todir="${config}/.."  description="Local web.xml">
394      <fileset dir="${config.local}">
395        <include name="web.xml" />
396      </fileset>
397    </copy>
398  </target>
399 
400  <target
401    name="copy.jar"
402    description="Copy required jar files to the appropriate folder"
403    >
404    <copy todir="${jar}" description="3rd-party JAR files">
405      <fileset dir="${lib}/dist">
406        <include name="**/*" />
407      </fileset>
408      <fileset dir="${lib}/webservices">
409        <include name="**/*" />
410      </fileset>
411    </copy>
412  </target>
413
414  <!-- info targets -->
415  <target 
416    name="info.init"
417    >
418    <property name="info.src" location="${src}/info" 
419      description="Location of info.* source files" />
420    <property name="info.build" location="${build}/info" 
421      description="Location of compiled info.* files" />
422  </target>
423 
424  <target 
425    name="info.compile"
426    depends="info.init"
427    description="Compile the info.* classes"
428    >
429    <mkdir dir="${info.build}"/>
430    <javac
431      srcdir="${info.src}"
432      destdir="${info.build}"
433      encoding="${javac.encoding}"
434      debug="true"
435      deprecation="true"
436      source="${javac.source}"
437      target="${javac.target}"
438      >
439      <compilerarg value="${javac.arg}" />
440    </javac>
441  </target>
442 
443  <!-- core targets -->
444  <target
445    name="core.init"
446    depends="dev.init,info.init"
447    >
448    <property name="core.src" location="${src}/core" 
449      description="Location of core source files" />
450    <property name="core.build" location="${build}/core" 
451      description="Location of compiled core files" />
452    <path id="core.classpath">
453      <path refid="lib.dist.classpath" />
454      <pathelement location="${info.build}" />
455    </path>
456  </target>
457 
458  <target
459    name="core.compile"
460    depends="core.init,info.compile"
461    description="Compile the core"
462    >
463    <mkdir dir="${core.build}"/>
464    <javac
465      srcdir="${core.src}"
466      destdir="${core.build}"
467      classpathref="core.classpath"
468      encoding="${javac.encoding}"
469      debug="true"
470      deprecation="true"
471      source="${javac.source}"
472      target="${javac.target}"
473      >
474      <compilerarg value="${javac.arg}" />
475    </javac>
476    <copy todir="${core.build}" 
477      description="Resource files needed by the core; excludes documentation and source files">
478      <fileset dir="${core.src}">
479        <include name="**/*" />
480        <exclude name="**/*.java" />
481        <exclude name="**/doc-files/" />
482        <exclude name="**/package.html" />
483      </fileset>
484    </copy>
485    <replace file="${core.build}/base.version">
486      <replacefilter 
487        token="@MAJOR@"
488        value="${base.majorversion}"
489      />
490      <replacefilter 
491        token="@MINOR@"
492        value="${base.minorversion}"
493      />
494      <replacefilter 
495        token="@MAINTENANCE@"
496        value="${base.maintenanceversion}"
497      />
498      <replacefilter 
499        token="@BUILD@"
500        value="${base.build}"
501      />
502    </replace>
503  </target>
504
505  <target
506    name="check.hibernate"
507    depends="core.init"
508    >
509    <uptodate
510      property="nohibernate"
511      >
512      <srcfiles dir="${core.src}/net/sf/basedb/core/data" includes="**/*.java">
513        <contains text="@hibernate.class" />
514      </srcfiles>
515      <mapper type="glob" from="*.java" to="${core.build}/net/sf/basedb/core/data/*.hbm.xml" />
516    </uptodate>
517    <condition property="hibernate.message" 
518      value="up to date; skipping" 
519      >
520      <istrue value="${nohibernate}" />
521    </condition>
522    <condition property="hibernate.message" 
523      value="not up to date; generating new" 
524      >
525      <isfalse value="${nohibernate}" />
526    </condition>
527    <echo>Hibernate mapping files are ${hibernate.message}</echo>
528  </target>
529 
530  <target
531    name="core.hibernate"
532    depends="core.init,core.compile,check.hibernate"
533    description="Generates Hibernate mapping files from the source code"
534    unless="nohibernate"
535    >
536    <delete>
537      <fileset dir="${core.build}" includes="**/*.hbm.xml" />
538    </delete>
539    <copy todir="${core.build}" 
540      description="Hardcoded *.hbm.xml files">
541      <fileset dir="${core.src}" includes="**/*.hbm.xml" />
542    </copy>
543    <hibernatedoclet
544      destdir="${core.build}"
545      excludedtags="@version,@author,@todo"
546      mergedir="${core.build}"
547      verbose="${xdoclet.verbose}">
548      <fileset dir="${core.src}">
549        <include name="**/*.java"/>
550      </fileset>
551      <hibernate version="2.0"/>
552    </hibernatedoclet>
553   
554    <replace
555      dir="${core.build}"
556      >
557      <include name="**/*.hbm.xml"/>
558      <replacefilter 
559        token="2.0//EN"
560        value="3.0//EN"
561      />
562      <replacefilter 
563        token="2.0.dtd"
564        value="3.0.dtd"
565      />
566      <replacefilter
567        token="outer-join=&#34;false&#34;"
568        value="fetch=&#34;select&#34;"
569      />
570      <replacefilter
571        token="outer-join=&#34;true&#34;"
572        value="fetch=&#34;join&#34;"
573      />
574      <replacefilter
575        token="index-many-to-many"
576        value="map-key-many-to-many"
577      />
578      <replacefilter
579        token="&lt;index&gt;"
580        value="&lt;list-index&gt;"
581      />
582      <replacefilter
583        token="&lt;/index&gt;"
584        value="&lt;/list-index&gt;"
585      />
586      <replacefilter
587        token="composite-index"
588        value="composite-map-key"
589      />
590    </replace>
591  </target>
592 
593  <target
594    name="core.jar"
595    depends="core.init,core.compile,core.hibernate"
596    description="Create the core jar file: BASE2Core.jar"
597    >
598    <jar
599      basedir="${core.build}"
600      jarfile="${jar}/BASE2Core.jar"
601    />
602  </target>
603
604  <!-- core plugin targets -->
605  <target
606    name="coreplugins.init"
607    depends="core.init"
608    >
609    <property name="coreplugins.src" location="${src}/plugins/core" 
610      description="Location of source files" />
611    <property name="coreplugins.build" location="${build}/plugins/core" 
612      description="Location of compiled files" />
613    <path id="coreplugins.classpath" description="Class path for compiling plugins">
614      <path refid="core.classpath"/>
615      <pathelement location="${core.build}"/>
616    </path>
617  </target>
618 
619  <target
620    name="coreplugins.compile"
621    depends="core.compile,coreplugins.init"
622    description="Compile the core plugins"
623    >
624    <mkdir dir="${coreplugins.build}" />
625    <javac
626      srcdir="${coreplugins.src}"
627      destdir="${coreplugins.build}"
628      classpathref="coreplugins.classpath"
629      encoding="${javac.encoding}"
630      debug="true"
631      deprecation="true"
632      source="${javac.source}"
633      target="${javac.target}"
634      >
635      <compilerarg value="${javac.arg}" />
636    </javac>
637  </target>
638 
639  <target
640    name="coreplugins.jar"
641    depends="coreplugins.compile"
642    description="Create the plugin jar file: BASE2CorePlugins.jar"
643    >
644    <jar
645      basedir="${coreplugins.build}"
646      jarfile="${jar}/BASE2CorePlugins.jar"
647    />
648  </target>
649 
650  <!-- test targets -->
651  <target
652    name="test.init"
653    depends="core.init,coreplugins.init,jobagent.init,webservices.init"
654    >
655    <property name="test.src" location="${src}/test" 
656      description="Location of source files" />
657    <property name="test.build" location="${build}/test" 
658      description="Location of compiled files" />
659    <path id="test.classpath" description="Class path for compiling">
660      <path refid="core.classpath"/>
661      <path refid="lib.webservices.classpath" />
662      <pathelement location="${core.build}" />
663      <pathelement location="${coreplugins.build}" />
664      <pathelement location="${jobagent.build}" />
665      <pathelement location="${webservices.build}/server" />
666      <pathelement location="${webservices.build}/client" />
667    </path>
668  </target>
669 
670  <target
671    name="test.compile"
672    depends="test.init,core.compile,coreplugins.compile,jobagent.compile,webservices.compile"
673    description="Compile the test programs"
674    >
675    <mkdir dir="${test.build}" />
676    <javac
677      srcdir="${test.src}"
678      destdir="${test.build}"
679      classpathref="test.classpath"
680      encoding="${javac.encoding}"
681      debug="true"
682      deprecation="true"
683      source="${javac.source}"
684      target="${javac.target}"
685      >
686      <compilerarg value="${javac.arg}" />
687    </javac>
688  </target>
689 
690  <target
691    name="test.jar"
692    depends="test.compile"
693    description="Create a JAR file used by the test programs; Delete corresponding .class files"
694    >
695    <jar 
696      jarfile="${test.build}/JarPluginAbout.jar" 
697      basedir="${test.build}" 
698      includes="JarPluginAbout.class" 
699    />
700    <jar 
701      jarfile="${test.build}/JarPlugin.jar" 
702      basedir="${test.build}" 
703      includes="JarPlugin*,NullPlugin*,Base1*"
704      excludes="JarPlugin.jar,JarPluginAbout.*"
705      manifest="${test.src}/data/JarPluginManifest.txt"
706      >
707      <metainf file="${test.src}/base-plugins.xml"></metainf>
708       <metainf file="${test.src}/base-configurations.xml"></metainf>
709    </jar>
710    <delete>
711      <fileset dir="${test.build}" includes="JarPlugin*.class" />
712    </delete>
713  </target>
714
715  <!-- web targets -->
716  <target
717    name="web.init"
718    depends="core.init,coreplugins.init"
719    >
720    <property name="web.src" location="${src}/clients/web" 
721      description="Location of source files" />
722    <property name="xjspcompiler.src" location="${src}/misc/compiler" />   
723    <property name="web.build" location="${build}/clients/web" 
724      description="Location of compiled files" />
725    <property name="web.inf" location="www/WEB-INF" 
726      description="Location of the WEB-INF folder" />
727    <path id="web.classpath" description="Class path for compiling web client">
728      <path refid="core.classpath"/>
729      <pathelement location="${core.build}"/>
730      <pathelement location="${coreplugins.build}" />
731      <path refid="lib.servlet.classpath" />
732    </path>
733  </target>
734 
735  <target
736    name="web.compile"
737    depends="web.init,core.compile,coreplugins.compile"
738    description="Compile the web client application"
739    >
740    <mkdir dir="${web.build}" />
741    <javac
742      srcdir="${web.src}"
743      destdir="${web.build}"
744      classpathref="web.classpath"
745      encoding="${javac.encoding}"
746      debug="true"
747      deprecation="true"
748      source="${javac.source}"
749      target="${javac.target}"
750      >
751      <compilerarg value="${javac.arg}" />
752    </javac>
753    <copy todir="${web.build}" 
754      description="Resource files needed by the web client; excludes documentation and source files">
755      <fileset dir="${web.src}">
756        <include name="**/*" />
757        <exclude name="**/*.java" />
758        <exclude name="**/doc-files/" />
759        <exclude name="**/package.html" />
760      </fileset>
761    </copy>
762  </target>
763 
764  <target
765    name="web.jar"
766    depends="web.compile"
767    description="Create the web client jar file: BASE2Webclient.jar"
768    >
769    <jar
770      basedir="${web.build}"
771      jarfile="${jar}/BASE2Webclient.jar"
772    />
773  </target>
774 
775  <target 
776    name="web.jsp"
777    depends="web"
778    description="Compile all JSP pages to a temporary directory; used for checking only"
779    >
780    <property name="jsp.build" location="${build}/jsp" />
781    <property environment="env" />
782    <mkdir dir="${jsp.build}/src" />
783    <mkdir dir="${jsp.build}/classes" />
784   
785    <path id="jsp.precompile.classpath">
786      <pathelement location="${java.home}/../lib/tools.jar" />
787      <fileset dir="${env.CATALINA_HOME}">
788        <include name="**/lib/*.jar" />
789        <exclude name="webapps/**" />
790      </fileset>
791      <fileset dir="${env.CATALINA_HOME}/bin">
792        <include name="*.jar" />
793      </fileset>
794    </path>
795   
796    <path id="jsp.compile.classpath">
797      <path refid="jsp.precompile.classpath" />
798      <fileset dir="${web.inf}/lib">
799        <include name="*.jar" />
800      </fileset>
801      <pathelement location="${info.build}" />
802    </path>
803
804    <taskdef
805      classname="org.apache.jasper.JspC" 
806      name="jasper2"
807      classpathref="jsp.precompile.classpath"
808    />
809    <jasper2
810      validateXml="false"
811      uriroot="www"
812      webXmlFragment="${jsp.build}/generated_web.xml"
813      outputdir="${jsp.build}/src"
814    />
815    <javac
816      destdir="${jsp.build}/classes"
817      srcdir="${jsp.build}/src"
818      debug="true"
819      classpathref="jsp.compile.classpath"
820      memoryinitialsize="256m"
821      memorymaximumsize="512m"
822      fork="true"
823      source="${javac.source}"
824      target="${javac.target}"
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      >
1198      <group title="Public API">
1199        <package name="net.sf.basedb.info" />
1200        <package name="net.sf.basedb.core" />
1201        <package name="net.sf.basedb.core.plugin" />
1202        <package name="net.sf.basedb.core.query" />
1203        <package name="net.sf.basedb.core.signal" />
1204        <package name="net.sf.basedb.util*" />
1205        <package name="net.sf.basedb.clients.web.taglib*" />
1206        <package name="net.sf.basedb.plugins*" />
1207        <package name="net.sf.basedb.core.authentication" />
1208        <package name="net.sf.basedb.ws.client" />
1209        <package name="net.sf.basedb.core.filehandler" />
1210        <package name="net.sf.basedb.clients.web.extensions*" />
1211      </group>
1212      <group title="Mixed Public and Internal API">
1213        <package name="net.sf.basedb.core.data" />
1214        <package name="net.sf.basedb.clients.web" />
1215        <package name="net.sf.basedb.clients.web.util" />
1216      </group>
1217      <group title="Extension API">
1218        <package name="net.sf.basedb.core.dbengine" />
1219        <package name="net.sf.basedb.clients.jobagent" />
1220        <package name="net.sf.basedb.ws.server*" />
1221      </group>
1222      <group title="Internal API">
1223        <package name="net.sf.basedb.core.data.keyring" />
1224        <package name="net.sf.basedb.clients.jobagent.*" />
1225        <package name="net.sf.basedb.clients.migrate*" />
1226        <package name="net.sf.basedb.clients.web.*" />
1227        <package name="net.sf.basedb.core.hibernate" />
1228      </group>
1229     
1230      <header><![CDATA[${base.version}: ${TODAY}]]></header>
1231      <link href="http://java.sun.com/javase/6/docs/api"/>
1232      <link href="http://www.hibernate.org/hib_docs/v3/api"/>
1233      <link href="http://www.jdom.org/docs/apidocs/" />
1234      <link href="http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/" />
1235      <link href="http://java.sun.com/products/jsp/2.1/docs/jsp-2_1-pfd2/" />
1236      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1237      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1238      <link href="http://logging.apache.org/log4j/docs/api/" />
1239      <link href="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/" />
1240      <link href="http://tomcat.apache.org/tomcat-6.0-doc/api/" />
1241      <tag name="base.developer" description="Developer info" />
1242      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1243      <tag name="base.modified" description="Last modified" />
1244      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1245      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1246      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1247      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1248      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1249      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1250      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1251      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1252      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1253      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1254      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1255      <tag name="hibernate.array" description="Hibernate: array" scope="methods" />
1256      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1257      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1258      <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" />
1259      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1260      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1261      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1262      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1263      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1264      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1265      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1266      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1267      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1268      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1269      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1270      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1271    </javadoc>
1272  </target>
1273 
1274  <target
1275    name="doc.docbook"
1276    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1277    description="Generate docbook user and admin documentation."
1278    >
1279  </target>
1280   
1281  <target 
1282    name="doc.docbook.html"
1283    depends="dev.init,doc.init,xsltprocessor"
1284    >
1285    <mkdir dir="${docbook.html.out}" />
1286    <!--Create subdirectories to store the chunked files in-->
1287    <mkdir dir="${docbook.html.out}/admindoc"/>
1288    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1289    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1290    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1291    <mkdir dir="${docbook.html.out}/admindoc/extensions"/>
1292    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1293    <mkdir dir="${docbook.html.out}/developerdoc"/>
1294    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1295    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1296    <mkdir dir="${docbook.html.out}/developerdoc/extensions"/>
1297    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1298    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1299    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1300    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1301    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1302    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1303    <mkdir dir="${docbook.html.out}/overviewdoc/features"/>
1304    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1305    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1306    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1307    <mkdir dir="${docbook.html.out}/userdoc"/>
1308    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1309    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1310    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1311    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1312    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1313    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1314    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1315    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1316    <mkdir dir="${docbook.html.out}/userdoc/import"/>
1317    <mkdir dir="${docbook.html.out}/userdoc/export"/>
1318    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1319    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1320    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1321    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1322    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1323    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1324    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1325    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1326    <mkdir dir="${docbook.html.out}/faqsdoc" />
1327    <mkdir dir="${docbook.html.out}/faqsdoc/faqs" />
1328    <mkdir dir="${docbook.html.out}/appendix" />
1329       
1330    <mkdir dir="${build}/docbook/html" />
1331    <delete description="Delete existing documents">
1332      <fileset dir="${build}/docbook" defaultexcludes="no" />
1333      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1334    </delete>
1335    <delete file="data/helptexts.xml" />
1336    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1337      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1338      <property name="docbook.xml.dir" location="${docbook.src}" />
1339      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1340      <property name="distribution.dir" location="${docbook.html.out}" />
1341      <property name="build.dir" location="${build}/docbook/html" />
1342      <property name="base.version" value="${base.version}"/>
1343    </ant>
1344     <copy todir="${docbook.html.out}">
1345         <fileset dir="${docbook.src}" includes="css/*.*" />
1346         <fileset dir="${docbook.src}" includes="script/*.*" />
1347     </copy>
1348   
1349    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1350    <path id="ant-extensions">
1351        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1352        <pathelement path="${lib}/docbook/ant-extensions" />
1353      </path>
1354   
1355    <xmlcatalog id="dtdcatalog">
1356          <catalogpath>
1357              <fileset file="${catalog.location}"/>
1358          </catalogpath>
1359      </xmlcatalog>
1360
1361      <xslt
1362          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1363          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1364          out     = "data/helptexts.xml"
1365          processor = "${xslt.processor}"
1366          >
1367          <xmlcatalog refid="dtdcatalog"/>
1368          <classpath refid="ant-extensions" />
1369
1370          <param name="xsltproc.catalog" expression="${catalog.location}" />
1371          <param name="xsltproc.option.--nonet"  expression="" />
1372      </xslt>
1373
1374    <replaceregexp 
1375      file="data/helptexts.xml"
1376      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1377      replace="&amp;lt;\$1&amp;gt;"
1378      flags="sg"
1379    />
1380  </target>
1381 
1382  <target 
1383    name="doc.docbook.pdf"
1384    depends="dev.init,doc.init"
1385    >
1386    <!-- Generate a pdf file from the documentation source -->
1387    <mkdir dir="${build}/docbook/pdf" />
1388    <echo>Generate pdf file</echo>
1389    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1390      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1391      <property name="docbook.xml.dir" location="${docbook.src}" />
1392      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1393      <property name="distribution.dir" location="${docbook.pdf.out}" />
1394      <property name="build.dir" location="${build}/docbook/pdf" />
1395      <property name="pdf.name" value="base.pdf" />
1396      <property name="base.version" value="${base.version}"/>
1397    </ant>
1398  </target>
1399 
1400  <target 
1401    name="doc.dist"
1402    description="Copy documentation to the binary distribution"
1403    >
1404    <mkdir dir="dist/doc" />
1405    <copy todir="dist/doc">
1406      <!--fileset dir="doc" includes="admin/**/*" /-->
1407      <!--fileset dir="doc" includes="development/**/*" /-->
1408      <fileset dir="doc" includes="licenses/**/*" />
1409      <fileset dir="doc" includes="specifications/**/*" />
1410      <!--fileset dir="doc" includes="user/**/*" /-->
1411      <fileset dir="doc" includes="*.*" />
1412    </copy>
1413  </target>
1414
1415  <target name="xsltprocessor">
1416      <property environment="env"/>
1417
1418      <condition  property="executable.file.extension"
1419                  value=".exe">
1420              <os family="windows"/>
1421      </condition>
1422      <condition  property="executable.file.extension"
1423                  value="">
1424              <os family="unix"/>
1425      </condition>
1426     
1427      <condition  property="tmp:xsltproc.available"
1428                  value="xsltproc${executable.file.extension}">
1429          <or>
1430              <and>
1431                  <os family="windows"/>
1432                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1433              </and>
1434              <and>
1435                  <os family="unix"/>
1436                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1437              </and>
1438          </or>
1439      </condition>
1440     
1441      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1442          <and>
1443              <isset property="tmp:xsltproc.available" />
1444              <not>
1445                  <isset property="disable.xsltproc" />
1446              </not>
1447          </and>
1448      </condition>
1449     
1450      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1451          <not>
1452              <isset property="disable.saxon" />
1453          </not>
1454      </condition>
1455
1456      <condition property="xslt.processor" value="trax">
1457          <not>
1458          <and>
1459                  <isset property="tmp:xsltproc.available" />
1460                  <not>
1461                      <isset property="disable.xsltproc" />
1462                  </not>
1463          </and>
1464          </not>
1465      </condition>
1466
1467    </target>
1468 
1469  <!--package targets -->
1470  <target
1471    name="package.bin"
1472    depends="dist"
1473    description="Create binary distribution package"
1474    >
1475    <mkdir dir="${package}" />
1476    <tar
1477      destfile="${package}/base-${base.version}.tar.gz"
1478      longfile="gnu"
1479      compression="gzip"
1480      >
1481      <tarfileset
1482        dir="${dist}"
1483        mode="755"
1484        prefix="base-${base.version}"
1485        preserveLeadingSlashes="true"
1486        >
1487        <include name="**/*.sh" />
1488      </tarfileset>
1489      <tarfileset
1490        dir="${dist}"
1491        prefix="base-${base.version}"
1492        preserveLeadingSlashes="true"
1493        >
1494        <exclude name="**/*.sh" />
1495      </tarfileset>
1496    </tar>
1497    <checksum file="${package}/base-${base.version}.tar.gz" />
1498  </target>
1499 
1500  <target
1501    name="package.src"
1502    depends="svn.revision"
1503    description="Create source distribution package"
1504    >
1505    <property name="tempdir" location="base-${base.version}-src" />
1506    <delete dir="${tempdir}" failonerror="false"/>
1507    <svn>
1508      <export srcPath="." destPath="${tempdir}" />
1509    </svn>
1510    <replaceregexp 
1511      file="${tempdir}/build.xml"
1512      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1513      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1514      flags="s"
1515    />
1516    <replace file="${tempdir}/build.xml"
1517      description="Remove references to package.src">
1518      <replacefilter 
1519        token="package.bin,package.src"
1520        value="package.bin"
1521      />
1522    </replace>
1523    <replaceregexp 
1524      file="${tempdir}/build.xml"
1525      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1526      replace=""
1527      flags="s"
1528      description="Remove package.src target"
1529    />
1530    <mkdir dir="${package}" />
1531      <tar
1532      destfile="${package}/base-${base.version}-src.tar.gz"
1533      longfile="gnu"
1534      compression="gzip"
1535      >
1536      <tarfileset
1537        dir="${tempdir}"
1538        mode="755"
1539        prefix="base-${base.version}-src"
1540        preserveLeadingSlashes="true"
1541        >
1542        <include name="**/*.sh" />
1543      </tarfileset>
1544      <tarfileset
1545        dir="${tempdir}"
1546        prefix="base-${base.version}-src"
1547        preserveLeadingSlashes="true"
1548        >
1549        <exclude name="**/*.sh" />
1550      </tarfileset>
1551    </tar>
1552    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1553    <delete dir="${tempdir}" />
1554  </target>
1555   
1556  <target 
1557    name="svn.update"
1558    description="Issues an 'svn update' command to check out the latest revision from subversion"
1559    >
1560    <svn>
1561      <update dir="." />
1562    </svn>
1563  </target>
1564 
1565</project>
Note: See TracBrowser for help on using the repository browser.