source: trunk/build.xml @ 4009

Last change on this file since 4009 was 3994, checked in by Johan Enell, 14 years ago

Merged patch release 2.4.6 to the trunk. Delta 2.4.6 - 2.5

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 50.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 3994 2007-11-22 13:46:53Z enell $
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="0beta" />
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}/server/lib">
904        <include name="*.jar" />
905      </fileset>
906      <fileset dir="${env.CATALINA_HOME}/common/lib">
907        <include name="*.jar" />
908      </fileset>
909      <fileset dir="${env.CATALINA_HOME}/bin">
910        <include name="*.jar" />
911      </fileset>
912    </path>
913   
914    <path id="jsp.compile.classpath">
915      <path refid="web.classpath" />
916      <pathelement location="${java.home}/../lib/tools.jar" />
917      <fileset dir="${env.CATALINA_HOME}/common/lib">
918        <include name="*.jar" />
919      </fileset>
920      <fileset dir="${env.CATALINA_HOME}/shared/lib">
921        <include name="*.jar" />
922      </fileset>
923      <fileset dir="${web.inf}/lib">
924        <include name="*.jar" />
925      </fileset>
926    </path>
927
928    <taskdef
929      classname="org.apache.jasper.JspC" 
930      name="jasper2"
931      classpathref="jsp.precompile.classpath"
932    />
933    <jasper2
934      validateXml="false"
935      uriroot="www"
936      webXmlFragment="${jsp.build}/generated_web.xml"
937      outputdir="${jsp.build}/src"
938    />
939    <javac
940      destdir="${jsp.build}/classes"
941      srcdir="${jsp.build}/src"
942      debug="true"
943      classpathref="jsp.compile.classpath"
944      memoryinitialsize="256m"
945      memorymaximumsize="512m"
946      fork="true"
947      >
948    </javac>
949  </target>
950 
951  <!-- webservices targets -->
952  <target
953    name="webservices.init"
954    depends="core.init,coreplugins.init"
955    >
956    <property name="webservices.src" location="${src}/webservices" 
957      description="Location of source files" />
958    <property name="webservices.build" location="${build}/webservices" 
959      description="Location of compiled files" />
960    <property name="webservices.wsdlpath" location="misc/wsdl"
961      description="Location of created wsdl-files" />
962    <path id="webservices.server.classpath" 
963      description="Class path for compiling server part of webservices"
964      >
965      <path refid="lib.webservices.classpath" />
966      <path refid="core.classpath"/>
967      <pathelement location="${core.build}"/>
968      <pathelement location="${coreplugins.build}"/>
969      <pathelement location="${web.build}"/>
970    </path>
971    <path id="webservices.client.classpath" 
972      description="Class path for compiling client part of webservices"
973      >
974      <path refid="lib.webservices.classpath" />
975      <pathelement location="${info.build}"/>
976    </path>
977  </target>
978
979  <target
980    name="check.wsdl"
981    depends="webservices.init"
982    >
983    <uptodate
984      property="nowsdl"
985      >
986      <srcfiles dir="${webservices.src}/server" includes="**/*.java" />
987      <mapper type="merge" to="${webservices.wsdlpath}/SessionService.wsdl" />
988    </uptodate>
989    <condition property="wsdl.message" 
990      value="WSDL files are up to date; skipping" 
991      >
992      <istrue value="${nowsdl}" />
993    </condition>
994    <condition property="wsdl.message" 
995      value="WSDL files may not be up to date; generating new" 
996      >
997      <isfalse value="${nowsdl}" />
998    </condition>
999    <echo>${wsdl.message}</echo>
1000  </target> 
1001 
1002  <target
1003    name="webservices.compile"
1004    depends="webservices.server.compile,webservices.client.compile"
1005    description="Compile the core web services"
1006    >
1007  </target>
1008 
1009  <target
1010    name="webservices.server.compile"
1011    description="Compile the server part of webservices"
1012    depends="webservices.init,core.compile,coreplugins.compile"
1013    >
1014    <mkdir dir="${webservices.build}/server" />
1015    <javac
1016      destdir="${webservices.build}/server"
1017      classpathref="webservices.server.classpath"
1018      encoding="ISO-8859-1"
1019      debug="true"
1020      deprecation="true"
1021      >
1022      <src path="${webservices.src}/server" />
1023      <compilerarg value="${javac.arg}" />
1024    </javac>
1025    <copy todir="${webservices.build}/server" 
1026      description="Resource files needed by the webservices; excludes documentation and source files"
1027      includeEmptyDirs="false"
1028      >
1029      <fileset dir="${webservices.src}/server">
1030        <include name="**/*" />
1031        <exclude name="**/*.java" />
1032        <exclude name="**/doc-files/" />
1033        <exclude name="**/package.html" />
1034      </fileset>
1035    </copy>
1036  </target>
1037
1038  <target
1039    name="webservices.client.compile"
1040    description="Compile the client part of webservices"
1041    depends="webservices.init,info.compile"
1042    >
1043    <mkdir dir="${webservices.build}/client" />
1044    <javac
1045      destdir="${webservices.build}/client"
1046      classpathref="webservices.client.classpath"
1047      encoding="ISO-8859-1"
1048      debug="true"
1049      deprecation="true"
1050      >
1051      <src path="${webservices.src}/client/java" />
1052      <compilerarg value="${javac.arg}" />
1053    </javac>
1054  </target>
1055 
1056  <target 
1057    name="webservices.wsdl"
1058    description="Generate WSDL files for webservices"
1059    depends="check.wsdl,webservices.compile"
1060    unless="nowsdl"
1061    >
1062    <webservices.wsdl serviceClassName="ArrayDesignService"/>
1063    <webservices.wsdl serviceClassName="BioAssaySetService"/>
1064    <webservices.wsdl serviceClassName="ExperimentService"/>
1065    <webservices.wsdl serviceClassName="ProjectService"/>
1066    <webservices.wsdl serviceClassName="RawBioAssayService"/>
1067    <webservices.wsdl serviceClassName="SessionService"/>
1068    <webservices.wsdl serviceClassName="ReporterService"/>
1069    <webservices.wsdl serviceClassName="AnnotationTypeService"/>
1070  </target>
1071 
1072  <!-- Creates a WSDL file for a Webservice class -->
1073    <macrodef name="webservices.wsdl">
1074        <attribute name="serviceClassName"/>
1075        <sequential>
1076          <java2WSDL
1077        classpath="${webservices.build}/server;${info.build};${core.build}"
1078        className="net.sf.basedb.ws.server.@{serviceClassName}"
1079        outputLocation="${webservices.wsdlpath}"     
1080        serviceName="@{serviceClassName}"
1081        outputFileName="@{serviceClassName}.wsdl"
1082        >   
1083      </java2WSDL>   
1084        </sequential>
1085    </macrodef>
1086 
1087  <target
1088    name="webservices.jar"
1089    depends="webservices.compile"
1090    description="Create the core webservices aar file and client jar"
1091    >
1092    <mkdir dir="${config}/../services" />
1093    <!-- server side: core.aar -->
1094    <jar
1095      basedir="${webservices.build}/server"
1096      jarfile="${config}/../services/core.aar"
1097    />
1098    <!-- client side: BASE2WSClient.jar -->
1099    <jar
1100      jarfile="${jar}/BASE2WSClient.jar"
1101      >
1102      <fileset dir="${webservices.build}/client" />
1103      <fileset dir="${info.build}" />
1104    </jar>
1105  </target>
1106 
1107  <!-- installprg targets -->
1108  <target
1109    name="installprg.init"
1110    depends="core.init,coreplugins.init,web.init"
1111    >
1112    <property name="installprg.src" location="${src}/install" 
1113      description="Location of source files" />
1114    <property name="installprg.build" location="${build}/install" 
1115      description="Location of compiled files" />
1116    <path id="installprg.classpath" description="Class path for compiling installation programs">
1117      <path refid="core.classpath"/>
1118      <pathelement location="${core.build}"/>
1119      <pathelement location="${coreplugins.build}"/>
1120      <pathelement location="${web.build}"/>
1121    </path>
1122  </target>
1123  <target
1124    name="installprg.compile"
1125    depends="installprg.init,core.compile"
1126    description="Compile the installation programs"
1127    >
1128    <mkdir dir="${installprg.build}" />
1129    <javac
1130      srcdir="${installprg.src}"
1131      destdir="${installprg.build}"
1132      classpathref="installprg.classpath"
1133      encoding="ISO-8859-1"
1134      debug="true"
1135      deprecation="true"
1136      >
1137      <compilerarg value="${javac.arg}" />
1138    </javac>
1139  </target>
1140 
1141  <target
1142    name="installprg.jar"
1143    depends="installprg.compile"
1144    description="Create the installation jar file: BASE2Install.jar"
1145    >
1146    <jar
1147      basedir="${installprg.build}"
1148      jarfile="${bin}/jar/BASE2Install.jar"
1149    />
1150  </target>
1151
1152  <!-- jobagent targets -->
1153  <target
1154    name="jobagent.init"
1155    depends="core.init,coreplugins.init,web.init"
1156    >
1157    <property name="jobagent.src" location="${src}/clients/jobagent" 
1158      description="Location of source files" />
1159    <property name="jobagent.build" location="${build}/clients/jobagent" 
1160      description="Location of compiled files" />
1161    <path id="jobagent.classpath" description="Class path for compiling jobagent">
1162      <path refid="core.classpath"/>
1163      <pathelement location="${core.build}"/>
1164    </path>
1165  </target>
1166  <target
1167    name="jobagent.compile"
1168    depends="jobagent.init,core.compile"
1169    description="Compile the job agent application"
1170    >
1171    <mkdir dir="${jobagent.build}" />
1172    <javac
1173      srcdir="${jobagent.src}"
1174      destdir="${jobagent.build}"
1175      classpathref="jobagent.classpath"
1176      encoding="ISO-8859-1"
1177      debug="true"
1178      deprecation="true"
1179      >
1180      <compilerarg value="${javac.arg}" />
1181    </javac>
1182  </target>
1183 
1184  <target
1185    name="jobagent.jar"
1186    depends="jobagent.compile"
1187    description="Create the job agent jar file: JobAgent.jar"
1188    >
1189    <jar
1190      basedir="${jobagent.build}"
1191      jarfile="${bin}/jar/JobAgent.jar"
1192    />
1193  </target>
1194
1195  <!-- migrate targets -->
1196  <target
1197    name="migrate.init"
1198    depends="core.init,coreplugins.init,web.init"
1199    >
1200    <property name="migrate.src" location="${src}/clients/migrate" 
1201      description="Location of source files" />
1202    <property name="migrate.build" location="${build}/clients/migrate" 
1203      description="Location of compiled files" />
1204    <path id="migrate.classpath" description="Class path for compiling migration tool">
1205      <path refid="core.classpath"/>
1206      <pathelement location="${core.build}"/>
1207    </path>
1208  </target>
1209  <target
1210    name="migrate.compile"
1211    depends="migrate.init,core.compile"
1212    description="Compile the migration tool"
1213    >
1214    <mkdir dir="${migrate.build}" />
1215    <javac
1216      srcdir="${migrate.src}"
1217      destdir="${migrate.build}"
1218      classpathref="migrate.classpath"
1219      encoding="ISO-8859-1"
1220      debug="true"
1221      deprecation="true"
1222      >
1223      <compilerarg value="${javac.arg}" />
1224    </javac>
1225  </target>
1226 
1227  <target
1228    name="migrate.jar"
1229    depends="migrate.compile"
1230    description="Create the migration tool jar file: Migrate.jar"
1231    >
1232    <jar
1233      basedir="${migrate.build}"
1234      jarfile="${bin}/jar/Migrate.jar"
1235    />
1236  </target>
1237 
1238  <!-- documentation targets -->
1239  <target
1240    name="doc.init"
1241    depends="core.init"
1242    >
1243    <property name="javadoc.src" location="doc/src/javadoc" 
1244      description="Location of javadoc source files" />
1245    <property name="docbook.src" location="doc/src/docbook" 
1246      description="Location of docbook source XML files" />
1247    <path id="javadoc.classpath" description="Class path for generating javadoc">
1248      <path refid="core.classpath" />
1249      <path refid="lib.servlet.classpath" />
1250      <path refid="lib.webservices.classpath" />
1251    </path>
1252    <property name="docbook.html.out" location="${doc}/html" />
1253    <property name="docbook.pdf.out" location="${doc}" />
1254  </target>
1255 
1256  <target
1257    name="doc.javadoc"
1258    depends="doc.init,core.init,coreplugins.init,web.init,migrate.init,jobagent.init,webservices.init"
1259    description="Generate JavaDoc of entire API"
1260    >
1261    <!-- Create the time stamp -->
1262    <tstamp>
1263      <format property="TODAY" pattern="yyyy-MM-dd"/>
1264    </tstamp>
1265    <delete dir="${doc}/api" />
1266    <mkdir dir="${doc}/api"/>
1267
1268    <javadoc
1269      packagenames="net.sf.basedb.*"
1270      sourcepath="${info.src}:${core.src}:${coreplugins.src}:${web.src}:${migrate.src}:${jobagent.src}:${webservices.src}/server:${webservices.src}/client/java"
1271      destdir="${doc}/api"
1272      author="true"
1273      version="true"
1274      use="false"
1275      private="true"
1276      windowtitle="BASE ${base.version} API documentation"
1277      stylesheetfile="${javadoc.src}/javadoc.css"
1278      classpathref="javadoc.classpath"
1279      linksource="false"
1280      breakiterator="yes"
1281      encoding="iso-8859-1"
1282      overview="${javadoc.src}/overview.html"
1283      >
1284      <group title="Public API"
1285        packages="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"
1286      />
1287      <group title="Mixed Public and Internal API"
1288        packages="net.sf.basedb.core.data:net.sf.basedb.clients.web:net.sf.basedb.clients.web.util"
1289      />
1290      <group title="Extension API"
1291        packages="net.sf.basedb.core.dbengine:net.sf.basedb.clients.jobagent:net.sf.basedb.ws.server*"
1292      />
1293      <group title="Internal API"
1294        packages="net.sf.basedb.core.data.keyring:net.sf.basedb.clients.jobagent.*:net.sf.basedb.clients.migrate*:net.sf.basedb.clients.web.*"
1295      />
1296     
1297      <header><![CDATA[${base.version}: ${TODAY}]]></header>
1298      <link href="http://java.sun.com/j2se/1.5/docs/api"/>
1299      <link href="http://www.hibernate.org/hib_docs/v3/api"/>
1300      <link href="http://www.jdom.org/docs/apidocs/" />
1301      <link href="http://java.sun.com/products/servlet/2.2/javadoc/" />
1302      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1303      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1304      <link href="http://logging.apache.org/log4j/docs/api/" />
1305      <link href="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/" />
1306      <tag name="base.developer" description="Developer info" />
1307      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1308      <tag name="base.modified" description="Last modified" />
1309      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1310      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1311      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1312      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1313      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1314      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1315      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1316      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1317      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1318      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1319      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1320      <tag name="hibernate.array" description="Hibernate: array" scope="methods" />
1321      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1322      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1323      <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" />
1324      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1325      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1326      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1327      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1328      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1329      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1330      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1331      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1332      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1333      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1334      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1335      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1336    </javadoc>
1337  </target>
1338 
1339  <target
1340    name="doc.docbook"
1341    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1342    description="Generate docbook user and admin documentation."
1343    >
1344  </target>
1345   
1346  <target 
1347    name="doc.docbook.html"
1348    depends="dev.init,doc.init,xsltprocessor"
1349    >
1350    <mkdir dir="${docbook.html.out}" />
1351    <!--Create subdirectories to store the chunked files in-->
1352    <mkdir dir="${docbook.html.out}/admindoc"/>
1353    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1354    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1355    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1356    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1357    <mkdir dir="${docbook.html.out}/developerdoc"/>
1358    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1359    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1360    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1361    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1362    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1363    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1364    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1365    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1366    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1367    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1368    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1369    <mkdir dir="${docbook.html.out}/userdoc"/>
1370    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1371    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1372    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1373    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1374    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1375    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1376    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1377    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1378    <mkdir dir="${docbook.html.out}/userdoc/import_export"/>
1379    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1380    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1381    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1382    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1383    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1384    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1385    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1386    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1387    <mkdir dir="${docbook.html.out}/faqs" />
1388    <mkdir dir="${docbook.html.out}/appendix" />
1389       
1390    <mkdir dir="${build}/docbook/html" />
1391    <delete description="Delete existing documents">
1392      <fileset dir="${build}/docbook" defaultexcludes="no" />
1393      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1394    </delete>
1395    <delete file="data/helptexts.xml" />
1396    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
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.html.out}" />
1401      <property name="build.dir" location="${build}/docbook/html" />
1402      <property name="base.version" value="${base.version}"/>
1403    </ant>
1404     <copy todir="${docbook.html.out}">
1405         <fileset dir="${docbook.src}" includes="css/*.*" />
1406         <fileset dir="${docbook.src}" includes="script/*.*" />
1407     </copy>
1408   
1409    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1410    <path id="ant-extensions">
1411        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1412        <pathelement path="${lib}/docbook/ant-extensions" />
1413      </path>
1414   
1415    <xmlcatalog id="dtdcatalog">
1416          <catalogpath>
1417              <fileset file="${catalog.location}"/>
1418          </catalogpath>
1419      </xmlcatalog>
1420
1421      <xslt
1422          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1423          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1424          out     = "data/helptexts.xml"
1425          processor = "${xslt.processor}"
1426          >
1427          <xmlcatalog refid="dtdcatalog"/>
1428          <classpath refid="ant-extensions" />
1429
1430          <param name="xsltproc.catalog" expression="${catalog.location}" />
1431          <param name="xsltproc.option.--nonet"  expression="" />
1432      </xslt>
1433
1434    <replaceregexp 
1435      file="data/helptexts.xml"
1436      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1437      replace="&amp;lt;\$1&amp;gt;"
1438      flags="sg"
1439    />
1440  </target>
1441 
1442  <target 
1443    name="doc.docbook.pdf"
1444    depends="dev.init,doc.init"
1445    >
1446    <!-- Generate a pdf file from the documentation source -->
1447    <mkdir dir="${build}/docbook/pdf" />
1448    <echo>Generate pdf file</echo>
1449    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1450      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1451      <property name="docbook.xml.dir" location="${docbook.src}" />
1452      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1453      <property name="distribution.dir" location="${docbook.pdf.out}" />
1454      <property name="build.dir" location="${build}/docbook/pdf" />
1455      <property name="pdf.name" value="base.pdf" />
1456      <property name="base.version" value="${base.version}"/>
1457    </ant>
1458  </target>
1459 
1460  <target 
1461    name="doc.dist"
1462    description="Copy documentation to the binary distribution"
1463    >
1464    <mkdir dir="dist/doc" />
1465    <copy todir="dist/doc">
1466      <!--fileset dir="doc" includes="admin/**/*" /-->
1467      <!--fileset dir="doc" includes="development/**/*" /-->
1468      <fileset dir="doc" includes="licenses/**/*" />
1469      <fileset dir="doc" includes="specifications/**/*" />
1470      <!--fileset dir="doc" includes="user/**/*" /-->
1471      <fileset dir="doc" includes="*.*" />
1472    </copy>
1473  </target>
1474
1475  <target name="xsltprocessor">
1476      <property environment="env"/>
1477
1478      <condition  property="executable.file.extension"
1479                  value=".exe">
1480              <os family="windows"/>
1481      </condition>
1482      <condition  property="executable.file.extension"
1483                  value="">
1484              <os family="unix"/>
1485      </condition>
1486     
1487      <condition  property="tmp:xsltproc.available"
1488                  value="xsltproc${executable.file.extension}">
1489          <or>
1490              <and>
1491                  <os family="windows"/>
1492                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1493              </and>
1494              <and>
1495                  <os family="unix"/>
1496                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1497              </and>
1498          </or>
1499      </condition>
1500     
1501      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1502          <and>
1503              <isset property="tmp:xsltproc.available" />
1504              <not>
1505                  <isset property="disable.xsltproc" />
1506              </not>
1507          </and>
1508      </condition>
1509     
1510      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1511          <not>
1512              <isset property="disable.saxon" />
1513          </not>
1514      </condition>
1515
1516      <condition property="xslt.processor" value="trax">
1517          <not>
1518          <and>
1519                  <isset property="tmp:xsltproc.available" />
1520                  <not>
1521                      <isset property="disable.xsltproc" />
1522                  </not>
1523          </and>
1524          </not>
1525      </condition>
1526
1527    </target>
1528 
1529  <!--package targets -->
1530  <target
1531    name="package.bin"
1532    depends="dist"
1533    description="Create binary distribution package"
1534    >
1535    <mkdir dir="${package}" />
1536    <tar
1537      destfile="${package}/base-${base.version}.tar.gz"
1538      longfile="gnu"
1539      compression="gzip"
1540      >
1541      <tarfileset
1542        dir="${dist}"
1543        mode="755"
1544        prefix="base-${base.version}"
1545        preserveLeadingSlashes="true"
1546        >
1547        <include name="**/*.sh" />
1548      </tarfileset>
1549      <tarfileset
1550        dir="${dist}"
1551        prefix="base-${base.version}"
1552        preserveLeadingSlashes="true"
1553        >
1554        <exclude name="**/*.sh" />
1555      </tarfileset>
1556    </tar>
1557    <checksum file="${package}/base-${base.version}.tar.gz" />
1558  </target>
1559 
1560  <target
1561    name="package.src"
1562    depends="svn.revision"
1563    description="Create source distribution package"
1564    >
1565    <property name="tempdir" location="base-${base.version}-src" />
1566    <delete dir="${tempdir}" failonerror="false"/>
1567    <svn>
1568      <export srcPath="." destPath="${tempdir}" />
1569    </svn>
1570    <replaceregexp 
1571      file="${tempdir}/build.xml"
1572      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1573      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1574      flags="s"
1575    />
1576    <replace file="${tempdir}/build.xml"
1577      description="Remove references to package.src">
1578      <replacefilter 
1579        token="package.bin,package.src"
1580        value="package.bin"
1581      />
1582    </replace>
1583    <replaceregexp 
1584      file="${tempdir}/build.xml"
1585      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1586      replace=""
1587      flags="s"
1588      description="Remove package.src target"
1589    />
1590    <mkdir dir="${package}" />
1591      <tar
1592      destfile="${package}/base-${base.version}-src.tar.gz"
1593      longfile="gnu"
1594      compression="gzip"
1595      >
1596      <tarfileset
1597        dir="${tempdir}"
1598        mode="755"
1599        prefix="base-${base.version}-src"
1600        preserveLeadingSlashes="true"
1601        >
1602        <include name="**/*.sh" />
1603      </tarfileset>
1604      <tarfileset
1605        dir="${tempdir}"
1606        prefix="base-${base.version}-src"
1607        preserveLeadingSlashes="true"
1608        >
1609        <exclude name="**/*.sh" />
1610      </tarfileset>
1611    </tar>
1612    <checksum file="${package}/base-${base.version}-src.tar.gz"/>
1613    <delete dir="${tempdir}" />
1614  </target>
1615 
1616  <target 
1617    name="package.examples"
1618    depends="package.examples.plugins,package.examples.webservices"
1619  />
1620 
1621  <target
1622    name="package.examples.plugins"
1623    depends="examples.plugins"
1624    description="Create a downloadable tar file with the example plugins"
1625    >
1626    <mkdir dir="${package}" />
1627    <tar
1628      destfile="${package}/exampleplugins.tar.gz"
1629      compression="gzip"
1630      >
1631      <tarfileset
1632        dir="${examples}/plugins"
1633        preserveLeadingSlashes="true"
1634      />
1635    </tar>
1636  </target>
1637 
1638  <target
1639    name="package.examples.webservices"
1640    depends="examples.webservices"
1641    description="Create a downloadable tar file with the webservices example"
1642    >
1643    <mkdir dir="${package}" />
1644    <tar
1645      destfile="${package}/examplewebservices.tar.gz"
1646      compression="gzip"
1647      >
1648      <tarfileset
1649        dir="${examples}/webservices"
1650        preserveLeadingSlashes="true"
1651      />
1652    </tar>
1653  </target>
1654 
1655</project>
Note: See TracBrowser for help on using the repository browser.