source: trunk/build.xml @ 3937

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

References #492: Web services

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