source: branches/2.17-stable/build.xml @ 6953

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

Changes for future release 2.17.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 50.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 5660 2011-06-17 06:52:00Z 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="17" />
69  <property name="base.maintenanceversion" value="3pre" />
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    <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="-//Hibernate/Hibernate Mapping DTD 2.0//EN"
564        value="-//Hibernate/Hibernate Mapping DTD 3.0//EN"
565      />
566      <replacefilter 
567        token="http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"
568        value="http://www.hibernate.org/dtd/hibernate-mapping-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   
596    <!--
597      Move the mappings files for all Extendable classes
598      because we are going to add more tags to them at runtime
599    -->
600    <!--
601    <move
602      todir="${core.build}/net/sf/basedb/core/templates"
603      >
604      <fileset dir="${core.build}/net/sf/basedb/core/data">
605        <include name="ReporterData.hbm.xml"/>
606        <include name="UserData.hbm.xml"/>
607      </fileset>
608      <mapper type="glob" from="*.hbm.xml" to="hibernate-properties-*.xml" />
609    </move>
610    -->
611  </target>
612 
613  <target
614    name="core.jar"
615    depends="core.init,core.compile,core.hibernate"
616    description="Create the core jar file: BASE2Core.jar"
617    >
618    <jar
619      basedir="${core.build}"
620      jarfile="${jar}/BASE2Core.jar"
621    />
622  </target>
623
624  <!-- core plugin targets -->
625  <target
626    name="coreplugins.init"
627    depends="core.init"
628    >
629    <property name="coreplugins.src" location="${src}/plugins/core" 
630      description="Location of source files" />
631    <property name="coreplugins.build" location="${build}/plugins/core" 
632      description="Location of compiled files" />
633    <path id="coreplugins.classpath" description="Class path for compiling plugins">
634      <path refid="core.classpath"/>
635      <pathelement location="${core.build}"/>
636    </path>
637  </target>
638 
639  <target
640    name="coreplugins.compile"
641    depends="core.compile,coreplugins.init"
642    description="Compile the core plugins"
643    >
644    <mkdir dir="${coreplugins.build}" />
645    <javac
646      srcdir="${coreplugins.src}"
647      destdir="${coreplugins.build}"
648      classpathref="coreplugins.classpath"
649      encoding="${javac.encoding}"
650      debug="true"
651      deprecation="true"
652      source="${javac.source}"
653      target="${javac.target}"
654      includeantruntime="false"
655      >
656      <compilerarg value="${javac.arg}" />
657    </javac>
658  </target>
659 
660  <target
661    name="coreplugins.jar"
662    depends="coreplugins.compile"
663    description="Create the plugin jar file: BASE2CorePlugins.jar"
664    >
665    <jar
666      basedir="${coreplugins.build}"
667      jarfile="${jar}/BASE2CorePlugins.jar"
668    />
669  </target>
670 
671  <!-- test targets -->
672  <target
673    name="test.init"
674    depends="core.init,coreplugins.init,jobagent.init,webservices.init"
675    >
676    <property name="test.src" location="${src}/test" 
677      description="Location of source files" />
678    <property name="test.build" location="${build}/test" 
679      description="Location of compiled files" />
680    <path id="test.classpath" description="Class path for compiling">
681      <path refid="core.classpath"/>
682      <path refid="lib.webservices.classpath" />
683      <pathelement location="${core.build}" />
684      <pathelement location="${coreplugins.build}" />
685      <pathelement location="${jobagent.build}" />
686      <pathelement location="${webservices.build}/server" />
687      <pathelement location="${webservices.build}/client" />
688    </path>
689  </target>
690 
691  <target
692    name="test.compile"
693    depends="test.init,core.compile,coreplugins.compile,jobagent.compile,webservices.compile"
694    description="Compile the test programs"
695    >
696    <mkdir dir="${test.build}" />
697    <javac
698      srcdir="${test.src}"
699      destdir="${test.build}"
700      classpathref="test.classpath"
701      encoding="${javac.encoding}"
702      debug="true"
703      deprecation="true"
704      source="${javac.source}"
705      target="${javac.target}"
706      includeantruntime="false"
707      >
708      <compilerarg value="${javac.arg}" />
709    </javac>
710  </target>
711 
712  <target
713    name="test.jar"
714    depends="test.compile"
715    description="Create a JAR file used by the test programs; Delete corresponding .class files"
716    >
717    <jar 
718      jarfile="${test.build}/JarPluginAbout.jar" 
719      basedir="${test.build}" 
720      includes="JarPluginAbout.class" 
721    />
722    <jar 
723      jarfile="${test.build}/JarPlugin.jar" 
724      basedir="${test.build}" 
725      includes="JarPlugin*,NullPlugin*,Base1*"
726      excludes="JarPlugin.jar,JarPluginAbout.*"
727      manifest="${test.src}/data/JarPluginManifest.txt"
728      >
729      <metainf file="${test.src}/base-plugins.xml"></metainf>
730       <metainf file="${test.src}/base-configurations.xml"></metainf>
731    </jar>
732    <delete>
733      <fileset dir="${test.build}" includes="JarPlugin*.class" />
734    </delete>
735  </target>
736
737  <!-- web targets -->
738  <target
739    name="web.init"
740    depends="core.init,coreplugins.init"
741    >
742    <property name="web.src" location="${src}/clients/web" 
743      description="Location of source files" />
744    <property name="xjspcompiler.src" location="${src}/misc/compiler" />   
745    <property name="web.build" location="${build}/clients/web" 
746      description="Location of compiled files" />
747    <property name="web.inf" location="www/WEB-INF" 
748      description="Location of the WEB-INF folder" />
749    <path id="web.classpath" description="Class path for compiling web client">
750      <path refid="core.classpath"/>
751      <pathelement location="${core.build}"/>
752      <pathelement location="${coreplugins.build}" />
753      <path refid="lib.servlet.classpath" />
754    </path>
755  </target>
756 
757  <target
758    name="web.compile"
759    depends="web.init,core.compile,coreplugins.compile"
760    description="Compile the web client application"
761    >
762    <mkdir dir="${web.build}" />
763    <javac
764      srcdir="${web.src}"
765      destdir="${web.build}"
766      classpathref="web.classpath"
767      encoding="${javac.encoding}"
768      debug="true"
769      deprecation="true"
770      source="${javac.source}"
771      target="${javac.target}"
772      includeantruntime="false"
773      >
774      <compilerarg value="${javac.arg}" />
775    </javac>
776    <copy todir="${web.build}" 
777      description="Resource files needed by the web client; excludes documentation and source files">
778      <fileset dir="${web.src}">
779        <include name="**/*" />
780        <exclude name="**/*.java" />
781        <exclude name="**/doc-files/" />
782        <exclude name="**/package.html" />
783      </fileset>
784    </copy>
785  </target>
786 
787  <target
788    name="web.jar"
789    depends="web.compile"
790    description="Create the web client jar file: BASE2Webclient.jar"
791    >
792    <jar
793      basedir="${web.build}"
794      jarfile="${jar}/BASE2Webclient.jar"
795    />
796  </target>
797 
798  <target 
799    name="web.jsp"
800    depends="web"
801    description="Compile all JSP pages to a temporary directory; used for checking only"
802    >
803    <property name="jsp.build" location="${build}/jsp" />
804    <property environment="env" />
805    <delete dir="${jsp.build}" />
806    <mkdir dir="${jsp.build}/src" />
807    <mkdir dir="${jsp.build}/classes" />
808    <path id="jsp.precompile.classpath">
809      <pathelement location="${java.home}/../lib/tools.jar" />
810      <fileset dir="${env.CATALINA_HOME}">
811        <include name="lib/*.jar" />
812      </fileset>
813      <fileset dir="${env.CATALINA_HOME}/bin">
814        <include name="*.jar" />
815      </fileset>
816    </path>
817   
818    <path id="jsp.compile.classpath">
819      <path refid="jsp.precompile.classpath" />
820      <fileset dir="${web.inf}/lib">
821        <include name="*.jar" />
822      </fileset>
823      <pathelement location="${info.build}" />
824    </path>
825
826    <taskdef
827      classname="org.apache.jasper.JspC" 
828      name="jasper2"
829      classpathref="jsp.precompile.classpath"
830    />
831    <jasper2
832      validateXml="false"
833      uriroot="www"
834      webXmlFragment="${jsp.build}/generated_web.xml"
835      outputdir="${jsp.build}/src"
836      javaencoding="${javac.encoding}"
837     
838    />
839    <javac
840      destdir="${jsp.build}/classes"
841      srcdir="${jsp.build}/src"
842      debug="true"
843      classpathref="jsp.compile.classpath"
844      memoryinitialsize="256m"
845      memorymaximumsize="512m"
846      fork="true"
847      source="${javac.source}"
848      target="${javac.target}"
849      encoding="${javac.encoding}"
850      includeantruntime="false"
851      >
852    </javac>
853  </target>
854 
855  <!-- XJsp compiler targets -->
856  <target
857    name="xjspcompiler"
858    depends="web.compile,core.compile"
859    description="Compile the XJsp compiler and put JAR in ./bin/jar"
860    >
861    <mkdir dir="${build}/misc/compiler" />
862    <javac
863      srcdir="${xjspcompiler.src}"
864      destdir="${build}/misc/compiler"
865      classpathref="web.classpath"
866      encoding="${javac.encoding}"
867      debug="true"
868      deprecation="true"
869      source="${javac.source}"
870      target="${javac.target}"
871      includeantruntime="false"
872      >
873      <compilerarg value="${javac.arg}" />
874    </javac>
875    <jar
876      basedir="${build}/misc/compiler"
877      jarfile="${bin}/jar/base2-xjsp-compiler.jar"
878    />
879  </target> 
880 
881  <!-- webservices targets -->
882  <target
883    name="webservices.init"
884    depends="core.init,coreplugins.init,web.init"
885    >
886    <property name="webservices.src" location="${src}/webservices" 
887      description="Location of source files" />
888    <property name="webservices.build" location="${build}/webservices" 
889      description="Location of compiled files" />
890    <property name="webservices.wsdlpath" location="misc/wsdl"
891      description="Location of created wsdl-files" />
892    <path id="webservices.server.classpath" 
893      description="Class path for compiling server part of webservices"
894      >
895      <path refid="lib.webservices.classpath" />
896      <path refid="core.classpath"/>
897      <pathelement location="${core.build}"/>
898      <pathelement location="${coreplugins.build}"/>
899      <pathelement location="${web.build}"/>
900    </path>
901    <path id="webservices.client.classpath" 
902      description="Class path for compiling client part of webservices"
903      >
904      <path refid="lib.webservices.classpath" />
905      <pathelement location="${info.build}"/>
906    </path>
907  </target>
908
909  <target
910    name="check.wsdl"
911    depends="webservices.init"
912    >
913    <uptodate
914      property="nowsdl"
915      >
916      <srcfiles dir="${webservices.src}/server" includes="**/*.java" />
917      <mapper type="merge" to="${webservices.wsdlpath}/SessionService.wsdl" />
918    </uptodate>
919    <condition property="wsdl.message" 
920      value="WSDL files are up to date; skipping" 
921      >
922      <istrue value="${nowsdl}" />
923    </condition>
924    <condition property="wsdl.message" 
925      value="WSDL files may not be up to date; generating new" 
926      >
927      <isfalse value="${nowsdl}" />
928    </condition>
929    <echo>${wsdl.message}</echo>
930  </target> 
931 
932  <target
933    name="webservices.compile"
934    depends="webservices.server.compile,webservices.client.compile"
935    description="Compile the core web services"
936    >
937  </target>
938 
939  <target
940    name="webservices.server.compile"
941    description="Compile the server part of webservices"
942    depends="webservices.init,core.compile,coreplugins.compile,web.compile"
943    >
944    <mkdir dir="${webservices.build}/server" />
945    <javac
946      destdir="${webservices.build}/server"
947      classpathref="webservices.server.classpath"
948      encoding="${javac.encoding}"
949      debug="true"
950      deprecation="true"
951      source="${javac.source}"
952      target="${javac.target}"
953      includeantruntime="false"
954      >
955      <src path="${webservices.src}/server" />
956      <compilerarg value="${javac.arg}" />
957    </javac>
958    <copy todir="${webservices.build}/server" 
959      description="Resource files needed by the webservices; excludes documentation and source files"
960      includeEmptyDirs="false"
961      >
962      <fileset dir="${webservices.src}/server">
963        <include name="**/*" />
964        <exclude name="**/*.java" />
965        <exclude name="**/doc-files/" />
966        <exclude name="**/package.html" />
967      </fileset>
968    </copy>
969  </target>
970
971  <target
972    name="webservices.client.compile"
973    description="Compile the client part of webservices"
974    depends="webservices.init,info.compile"
975    >
976    <mkdir dir="${webservices.build}/client" />
977    <javac
978      destdir="${webservices.build}/client"
979      classpathref="webservices.client.classpath"
980      encoding="${javac.encoding}"
981      debug="true"
982      deprecation="true"
983      source="${javac.source}"
984      target="${javac.target}"
985      includeantruntime="false"
986      >
987      <src path="${webservices.src}/client/java" />
988      <compilerarg value="${javac.arg}" />
989    </javac>
990  </target>
991 
992  <target 
993    name="webservices.wsdl"
994    description="Generate WSDL files for webservices"
995    depends="check.wsdl,webservices.compile"
996    unless="nowsdl"
997    >
998    <mkdir dir="${webservices.wsdlpath}" />
999    <webservices.wsdl serviceClassName="ArrayDesignService"/>
1000    <webservices.wsdl serviceClassName="BioAssaySetService"/>
1001    <webservices.wsdl serviceClassName="ExperimentService"/>
1002    <webservices.wsdl serviceClassName="ProjectService"/>
1003    <webservices.wsdl serviceClassName="RawBioAssayService"/>
1004    <webservices.wsdl serviceClassName="SessionService"/>
1005    <webservices.wsdl serviceClassName="ReporterService"/>
1006    <webservices.wsdl serviceClassName="AnnotationTypeService"/>
1007  </target>
1008 
1009  <!-- Creates a WSDL file for a Webservice class -->
1010    <macrodef name="webservices.wsdl">
1011        <attribute name="serviceClassName"/>
1012        <sequential>
1013          <java2WSDL
1014        classpath="${webservices.build}/server;${info.build};${core.build}:${web.build}"
1015        className="net.sf.basedb.ws.server.@{serviceClassName}"
1016        outputLocation="${webservices.wsdlpath}"     
1017        serviceName="@{serviceClassName}"
1018        outputFileName="@{serviceClassName}.wsdl"
1019        >   
1020      </java2WSDL>   
1021        </sequential>
1022    </macrodef>
1023 
1024  <target
1025    name="webservices.jar"
1026    depends="webservices.compile"
1027    description="Create the core webservices aar file and client jar"
1028    >
1029    <mkdir dir="${config}/../services" />
1030    <!-- server side: core.aar -->
1031    <jar
1032      basedir="${webservices.build}/server"
1033      jarfile="${config}/../services/core.aar"
1034    />
1035    <!-- client side: BASE2WSClient.jar -->
1036    <jar
1037      jarfile="${jar}/BASE2WSClient.jar"
1038      >
1039      <fileset dir="${webservices.build}/client" />
1040      <fileset dir="${info.build}" />
1041    </jar>
1042  </target>
1043 
1044  <!-- installprg targets -->
1045  <target
1046    name="installprg.init"
1047    depends="core.init,coreplugins.init,web.init"
1048    >
1049    <property name="installprg.src" location="${src}/install" 
1050      description="Location of source files" />
1051    <property name="installprg.build" location="${build}/install" 
1052      description="Location of compiled files" />
1053    <path id="installprg.classpath" description="Class path for compiling installation programs">
1054      <path refid="core.classpath"/>
1055      <pathelement location="${core.build}"/>
1056      <pathelement location="${coreplugins.build}"/>
1057      <pathelement location="${web.build}"/>
1058    </path>
1059  </target>
1060  <target
1061    name="installprg.compile"
1062    depends="installprg.init,core.compile"
1063    description="Compile the installation programs"
1064    >
1065    <mkdir dir="${installprg.build}" />
1066    <javac
1067      srcdir="${installprg.src}"
1068      destdir="${installprg.build}"
1069      classpathref="installprg.classpath"
1070      encoding="${javac.encoding}"
1071      debug="true"
1072      deprecation="true"
1073      source="${javac.source}"
1074      target="${javac.target}"
1075      includeantruntime="false"
1076      >
1077      <compilerarg value="${javac.arg}" />
1078    </javac>
1079  </target>
1080 
1081  <target
1082    name="installprg.jar"
1083    depends="installprg.compile"
1084    description="Create the installation jar file: BASE2Install.jar"
1085    >
1086    <jar
1087      basedir="${installprg.build}"
1088      jarfile="${bin}/jar/BASE2Install.jar"
1089    />
1090  </target>
1091
1092  <!-- jobagent targets -->
1093  <target
1094    name="jobagent.init"
1095    depends="core.init,coreplugins.init,web.init"
1096    >
1097    <property name="jobagent.src" location="${src}/clients/jobagent" 
1098      description="Location of source files" />
1099    <property name="jobagent.build" location="${build}/clients/jobagent" 
1100      description="Location of compiled files" />
1101    <path id="jobagent.classpath" description="Class path for compiling jobagent">
1102      <path refid="core.classpath"/>
1103      <pathelement location="${core.build}"/>
1104    </path>
1105  </target>
1106  <target
1107    name="jobagent.compile"
1108    depends="jobagent.init,core.compile"
1109    description="Compile the job agent application"
1110    >
1111    <mkdir dir="${jobagent.build}" />
1112    <javac
1113      srcdir="${jobagent.src}"
1114      destdir="${jobagent.build}"
1115      classpathref="jobagent.classpath"
1116      encoding="${javac.encoding}"
1117      debug="true"
1118      deprecation="true"
1119      source="${javac.source}"
1120      target="${javac.target}"
1121      includeantruntime="false"
1122      >
1123      <compilerarg value="${javac.arg}" />
1124    </javac>
1125  </target>
1126 
1127  <target
1128    name="jobagent.jar"
1129    depends="jobagent.compile"
1130    description="Create the job agent jar file: JobAgent.jar"
1131    >
1132    <jar
1133      basedir="${jobagent.build}"
1134      jarfile="${bin}/jar/JobAgent.jar"
1135    />
1136  </target>
1137
1138  <!-- migrate targets -->
1139  <target
1140    name="migrate.init"
1141    depends="core.init,coreplugins.init,web.init"
1142    >
1143    <property name="migrate.src" location="${src}/clients/migrate" 
1144      description="Location of source files" />
1145    <property name="migrate.build" location="${build}/clients/migrate" 
1146      description="Location of compiled files" />
1147    <path id="migrate.classpath" description="Class path for compiling migration tool">
1148      <path refid="core.classpath"/>
1149      <pathelement location="${core.build}"/>
1150    </path>
1151  </target>
1152  <target
1153    name="migrate.compile"
1154    depends="migrate.init,core.compile"
1155    description="Compile the migration tool"
1156    >
1157    <mkdir dir="${migrate.build}" />
1158    <javac
1159      srcdir="${migrate.src}"
1160      destdir="${migrate.build}"
1161      classpathref="migrate.classpath"
1162      encoding="${javac.encoding}"
1163      debug="true"
1164      deprecation="true"
1165      source="${javac.source}"
1166      target="${javac.target}"
1167      includeantruntime="false"
1168      >
1169      <compilerarg value="${javac.arg}" />
1170    </javac>
1171  </target>
1172 
1173  <target
1174    name="migrate.jar"
1175    depends="migrate.compile"
1176    description="Create the migration tool jar file: Migrate.jar"
1177    >
1178    <jar
1179      basedir="${migrate.build}"
1180      jarfile="${bin}/jar/Migrate.jar"
1181    />
1182  </target>
1183 
1184  <!-- documentation targets -->
1185  <target
1186    name="doc.init"
1187    depends="core.init"
1188    >
1189    <property name="javadoc.src" location="doc/src/javadoc" 
1190      description="Location of javadoc source files" />
1191    <property name="docbook.src" location="doc/src/docbook" 
1192      description="Location of docbook source XML files" />
1193    <path id="javadoc.classpath" description="Class path for generating javadoc">
1194      <path refid="core.classpath" />
1195      <path refid="lib.servlet.classpath" />
1196      <path refid="lib.webservices.classpath" />
1197    </path>
1198    <property name="docbook.html.out" location="${doc}/html" />
1199    <property name="docbook.pdf.out" location="${doc}" />
1200  </target>
1201 
1202  <target
1203    name="doc.javadoc"
1204    depends="doc.init,core.init,coreplugins.init,web.init,jobagent.init,webservices.init"
1205    description="Generate JavaDoc of entire API"
1206    >
1207    <!-- Create the time stamp -->
1208    <tstamp>
1209      <format property="TODAY" pattern="yyyy-MM-dd"/>
1210    </tstamp>
1211    <delete dir="${doc}/api" />
1212    <mkdir dir="${doc}/api"/>
1213
1214    <javadoc
1215      packagenames="net.sf.basedb.*"
1216      sourcepath="${info.src}:${core.src}:${coreplugins.src}:${web.src}:${xjspcompiler.src}:${jobagent.src}:${webservices.src}/server:${webservices.src}/client/java"
1217      destdir="${doc}/api"
1218      author="true"
1219      version="true"
1220      use="false"
1221      private="true"
1222      windowtitle="BASE ${base.version} API documentation"
1223      stylesheetfile="${javadoc.src}/javadoc.css"
1224      classpathref="javadoc.classpath"
1225      linksource="false"
1226      breakiterator="yes"
1227      encoding="${javac.encoding}"
1228      overview="${javadoc.src}/overview.html"
1229      maxmemory="256M"
1230      >
1231      <group title="Public API">
1232        <package name="net.sf.basedb.info" />
1233        <package name="net.sf.basedb.core" />
1234        <package name="net.sf.basedb.core.plugin" />
1235        <package name="net.sf.basedb.core.query" />
1236        <package name="net.sf.basedb.core.signal" />
1237        <package name="net.sf.basedb.util*" />
1238        <package name="net.sf.basedb.clients.web.taglib*" />
1239        <package name="net.sf.basedb.plugins*" />
1240        <package name="net.sf.basedb.core.authentication" />
1241        <package name="net.sf.basedb.ws.client" />
1242        <package name="net.sf.basedb.core.filehandler" />
1243        <package name="net.sf.basedb.clients.web.extensions*" />
1244      </group>
1245      <group title="Mixed Public and Internal API">
1246        <package name="net.sf.basedb.core.data" />
1247        <package name="net.sf.basedb.clients.web" />
1248        <package name="net.sf.basedb.clients.web.util" />
1249        <package name="net.sf.basedb.util.overview" />
1250      </group>
1251      <group title="Extension API">
1252        <package name="net.sf.basedb.core.dbengine" />
1253        <package name="net.sf.basedb.clients.jobagent" />
1254        <package name="net.sf.basedb.ws.server*" />
1255      </group>
1256      <group title="Internal API">
1257        <package name="net.sf.basedb.core.data.keyring" />
1258        <package name="net.sf.basedb.clients.jobagent.*" />
1259        <package name="net.sf.basedb.clients.web.*" />
1260        <package name="net.sf.basedb.core.hibernate" />
1261      </group>
1262     
1263      <header><![CDATA[${base.version}: ${TODAY}]]></header>
1264      <link href="http://download.oracle.com/javase/6/docs/api"/>
1265      <link href="http://docs.jboss.org/hibernate/stable/core/api/"/>
1266      <link href="http://www.jdom.org/docs/apidocs/" />
1267      <link href="http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/" />
1268      <link href="http://download.oracle.com/docs/cd/E17802_01/products/products/jsp/2.1/docs/jsp-2_1-pfd2/" />
1269      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1270      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1271      <link href="http://logging.apache.org/log4j/docs/api/" />
1272      <link href="http://download.oracle.com/docs/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/" />
1273      <link href="http://tomcat.apache.org/tomcat-6.0-doc/api/" />
1274      <tag name="base.developer" description="Developer info" />
1275      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1276      <tag name="base.modified" description="Last modified" />
1277      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1278      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1279      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1280      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1281      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1282      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1283      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1284      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1285      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1286      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1287      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1288      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1289      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1290      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1291      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1292      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1293      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1294      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1295      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1296      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1297      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1298      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1299      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1300      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1301      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1302    </javadoc>
1303  </target>
1304 
1305  <target
1306    name="doc.docbook"
1307    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1308    description="Generate docbook user and admin documentation."
1309    >
1310  </target>
1311   
1312  <target 
1313    name="doc.docbook.html"
1314    depends="dev.init,doc.init,xsltprocessor"
1315    >
1316    <mkdir dir="${docbook.html.out}" />
1317    <!--Create subdirectories to store the chunked files in-->
1318    <mkdir dir="${docbook.html.out}/admindoc"/>
1319    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1320    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1321    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1322    <mkdir dir="${docbook.html.out}/admindoc/extensions"/>
1323    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1324    <mkdir dir="${docbook.html.out}/developerdoc"/>
1325    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1326    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1327    <mkdir dir="${docbook.html.out}/developerdoc/extensions"/>
1328    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1329    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1330    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1331    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1332    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1333    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1334    <mkdir dir="${docbook.html.out}/overviewdoc/features"/>
1335    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1336    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1337    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1338    <mkdir dir="${docbook.html.out}/userdoc"/>
1339    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1340    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1341    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1342    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1343    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1344    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1345    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1346    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1347    <mkdir dir="${docbook.html.out}/userdoc/import"/>
1348    <mkdir dir="${docbook.html.out}/userdoc/export"/>
1349    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1350    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1351    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1352    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1353    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1354    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1355    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1356    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1357    <mkdir dir="${docbook.html.out}/faqsdoc" />
1358    <mkdir dir="${docbook.html.out}/faqsdoc/faqs" />
1359    <mkdir dir="${docbook.html.out}/appendix" />
1360       
1361    <mkdir dir="${build}/docbook/html" />
1362    <delete description="Delete existing documents">
1363      <fileset dir="${build}/docbook" defaultexcludes="no" />
1364      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1365    </delete>
1366    <delete file="data/helptexts.xml" />
1367    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1368      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1369      <property name="docbook.xml.dir" location="${docbook.src}" />
1370      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1371      <property name="distribution.dir" location="${docbook.html.out}" />
1372      <property name="build.dir" location="${build}/docbook/html" />
1373      <property name="base.version" value="${base.version}"/>
1374    </ant>
1375     <copy todir="${docbook.html.out}">
1376         <fileset dir="${docbook.src}" includes="css/*.*" />
1377         <fileset dir="${docbook.src}" includes="script/*.*" />
1378     </copy>
1379   
1380    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1381    <path id="ant-extensions">
1382        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1383        <pathelement path="${lib}/docbook/ant-extensions" />
1384      </path>
1385   
1386    <xmlcatalog id="dtdcatalog">
1387          <catalogpath>
1388              <fileset file="${catalog.location}"/>
1389          </catalogpath>
1390      </xmlcatalog>
1391
1392      <xslt
1393          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1394          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1395          out     = "data/helptexts.xml"
1396          processor = "${xslt.processor}"
1397          >
1398          <xmlcatalog refid="dtdcatalog"/>
1399          <classpath refid="ant-extensions" />
1400
1401          <param name="xsltproc.catalog" expression="${catalog.location}" />
1402          <param name="xsltproc.option.--nonet"  expression="" />
1403      </xslt>
1404
1405    <replaceregexp 
1406      file="data/helptexts.xml"
1407      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1408      replace="&amp;lt;\$1&amp;gt;"
1409      flags="sg"
1410    />
1411  </target>
1412 
1413  <target 
1414    name="doc.docbook.pdf"
1415    depends="dev.init,doc.init"
1416    >
1417    <!-- Generate a pdf file from the documentation source -->
1418    <mkdir dir="${build}/docbook/pdf" />
1419    <echo>Generate pdf file</echo>
1420    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1421      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1422      <property name="docbook.xml.dir" location="${docbook.src}" />
1423      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1424      <property name="distribution.dir" location="${docbook.pdf.out}" />
1425      <property name="build.dir" location="${build}/docbook/pdf" />
1426      <property name="pdf.name" value="base.pdf" />
1427      <property name="base.version" value="${base.version}"/>
1428    </ant>
1429  </target>
1430 
1431  <target 
1432    name="doc.dist"
1433    description="Copy documentation to the binary distribution"
1434    >
1435    <mkdir dir="dist/doc" />
1436    <copy todir="dist/doc">
1437      <!--fileset dir="doc" includes="admin/**/*" /-->
1438      <!--fileset dir="doc" includes="development/**/*" /-->
1439      <fileset dir="doc" includes="licenses/**/*" />
1440      <fileset dir="doc" includes="historical/**/*" />
1441      <fileset dir="doc" includes="test/**/*" />
1442      <!--fileset dir="doc" includes="user/**/*" /-->
1443      <fileset dir="doc" includes="*.*" />
1444    </copy>
1445  </target>
1446
1447  <target name="xsltprocessor">
1448      <property environment="env"/>
1449
1450      <condition  property="executable.file.extension"
1451                  value=".exe">
1452              <os family="windows"/>
1453      </condition>
1454      <condition  property="executable.file.extension"
1455                  value="">
1456              <os family="unix"/>
1457      </condition>
1458     
1459      <condition  property="tmp:xsltproc.available"
1460                  value="xsltproc${executable.file.extension}">
1461          <or>
1462              <and>
1463                  <os family="windows"/>
1464                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1465              </and>
1466              <and>
1467                  <os family="unix"/>
1468                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1469              </and>
1470          </or>
1471      </condition>
1472     
1473      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1474          <and>
1475              <isset property="tmp:xsltproc.available" />
1476              <not>
1477                  <isset property="disable.xsltproc" />
1478              </not>
1479          </and>
1480      </condition>
1481     
1482      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1483          <not>
1484              <isset property="disable.saxon" />
1485          </not>
1486      </condition>
1487
1488      <condition property="xslt.processor" value="trax">
1489          <not>
1490          <and>
1491                  <isset property="tmp:xsltproc.available" />
1492                  <not>
1493                      <isset property="disable.xsltproc" />
1494                  </not>
1495          </and>
1496          </not>
1497      </condition>
1498
1499    </target>
1500 
1501  <!--package targets -->
1502  <target
1503    name="package.bin"
1504    depends="dist"
1505    description="Create binary distribution package"
1506    >
1507    <mkdir dir="${package}" />
1508    <tar
1509      destfile="${package}/base-${base.version}.tar.gz"
1510      longfile="gnu"
1511      compression="gzip"
1512      >
1513      <tarfileset
1514        dir="${dist}"
1515        mode="755"
1516        prefix="base-${base.version}"
1517        preserveLeadingSlashes="true"
1518        >
1519        <include name="**/*.sh" />
1520      </tarfileset>
1521      <tarfileset
1522        dir="${dist}"
1523        prefix="base-${base.version}"
1524        preserveLeadingSlashes="true"
1525        >
1526        <exclude name="**/*.sh" />
1527      </tarfileset>
1528    </tar>
1529    <checksum file="${package}/base-${base.version}.tar.gz" />
1530  </target>
1531 
1532  <target
1533    name="package.src"
1534    depends="svn.revision"
1535    description="Create source distribution package"
1536    >
1537    <property name="tempdir" location="base-${base.version}-src" />
1538    <delete dir="${tempdir}" failonerror="false"/>
1539    <svn>
1540      <export srcPath="." destPath="${tempdir}" />
1541    </svn>
1542    <replaceregexp 
1543      file="${tempdir}/build.xml"
1544      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1545      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1546      flags="s"
1547    />
1548    <replace file="${tempdir}/build.xml"
1549      description="Remove references to package.src">
1550      <replacefilter 
1551        token="package.bin,package.src"
1552        value="package.bin"
1553      />
1554    </replace>
1555    <replaceregexp 
1556      file="${tempdir}/build.xml"
1557      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1558      replace=""
1559      flags="s"
1560      description="Remove package.src target"
1561    />
1562    <mkdir dir="${package}" />
1563      <tar
1564      destfile="${package}/base-${base.version}-src.tar.gz"
1565      longfile="gnu"
1566      compression="gzip"
1567      >
1568      <tarfileset
1569        dir="${tempdir}"
1570        mode="755"
1571        prefix="base-${base.version}-src"
1572        preserveLeadingSlashes="true"
1573        >
1574        <include name="**/*.sh" />
1575      </tarfileset>
1576      <tarfileset
1577        dir="${tempdir}"
1578        prefix="base-${base.version}-src"
1579        preserveLeadingSlashes="true"
1580        >
1581        <exclude name="**/*.sh" />
1582      </tarfileset>
1583    </tar>
1584    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1585    <delete dir="${tempdir}" />
1586  </target>
1587   
1588  <target 
1589    name="svn.update"
1590    description="Issues an 'svn update' command to check out the latest revision from subversion"
1591    >
1592    <svn>
1593      <update dir="." />
1594    </svn>
1595  </target>
1596 
1597  <target
1598    name="svn.diff"
1599    depends="svn.revision"
1600    description="Issues an 'svn diff' command to generate a patch with local changes"
1601    >
1602    <echo>NOTE! New files must be added to svn with 'svn add' or they will not be added to the patch.</echo>
1603    <property name="patchfile" value="patch-${base.build}.diff" />
1604    <pathconvert property="patchdir" dirsep="/" >
1605      <path location="." />
1606    </pathconvert>
1607    <svn>
1608      <diff oldpath="." outfile="${patchfile}"/>
1609    </svn>
1610    <replaceregexp file="${patchfile}" match="${patchdir}/" replace="" flags="g" />
1611    <echo>Generated patch file: ${patchfile}</echo>
1612  </target>
1613   
1614</project>
Note: See TracBrowser for help on using the repository browser.