source: trunk/build.xml @ 3967

Last change on this file since 3967 was 3967, checked in by Nicklas Nordborg, 15 years ago

References #492: Web services

axis2.xml is now installed in the correct folder.

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