source: branches/3.3-stable/build.xml @ 6599

Last change on this file since 6599 was 6599, checked in by Nicklas Nordborg, 8 years ago

Changes for future release 3.3.4

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