source: trunk/build.xml @ 4045

Last change on this file since 4045 was 4045, checked in by Jari Häkkinen, 14 years ago

Preparing release 2.5

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