source: trunk/build.xml @ 5611

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

Change name of license file.

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