source: trunk/build.xml @ 5591

Last change on this file since 5591 was 5591, checked in by Nicklas Nordborg, 13 years ago

References #1589: Delete deprecated classes and methods

Removed BASE 1.2 -> BASE 2 migration program.

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