source: trunk/build.xml @ 5607

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

References #1593: Extension system for the core API

References #1592: Unified installation procedure for plug-ins, extensions and more...

Added tags for min/max BASE version that an extension is working with. Switched to use numbers instead of strings in version information and added an extra suffix "-dev" used for development versions.

Also fixes problems with error handling in the startup of the extensions system and problems with re-scanning updated extensions that had an error before or got an error after the update.

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