source: branches/3.0-stable/build.xml @ 5863

Last change on this file since 5863 was 5863, checked in by Nicklas Nordborg, 10 years ago

Changes for future release 3.0.2

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