source: branches/2.16-stable/build.xml @ 5515

Last change on this file since 5515 was 5515, checked in by Nicklas Nordborg, 11 years ago

Preparing release 2.16.1

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