source: trunk/build.xml @ 3919

Last change on this file since 3919 was 3919, checked in by Martin Svensson, 15 years ago

References #492 Modified the download methods to eliminate the problems with hardcoded filenames. WSDL files are now generated in misc/wsdl.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 44.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 3919 2007-11-06 15:49:15Z martin $
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="0pre" />
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    </classpath>
137  </taskdef>
138 
139  <!-- main targets -->
140  <target
141    name="clean"
142    description="Remove all generated files and backup files" >
143    <delete failonerror="false" includeemptydirs="true">
144      <fileset dir="${build}" defaultexcludes="no" />
145      <fileset dir="${dist}" defaultexcludes="no" />
146      <fileset dir="bin/jar" defaultexcludes="no" />
147      <fileset dir="misc/wsdl" defaultexcludes="no" />
148      <fileset dir="www/WEB-INF/lib" defaultexcludes="no" />
149      <fileset dir="www/WEB-INF/classes" defaultexcludes="no" />
150      <fileset dir="www/WEB-INF/conf" defaultexcludes="no" />
151      <fileset dir="www/WEB-INF/services" defaultexcludes="no" />
152      <fileset dir="www/WEB-INF" includes="web.xml" defaultexcludes="no" />
153      <fileset dir="doc/api" defaultexcludes="no" />
154      <fileset dir="doc/html" defaultexcludes="no" />
155      <fileset file="doc/base.pdf" />
156      <fileset file="doc/download/exampleplugins.tar.gz" />
157    </delete>
158  </target>
159 
160  <target
161    name="dist"
162    depends="clean,dist.init,core.jar,coreplugins.jar,web.jar,webservices.aar,
163          installprg.jar,jobagent.jar,migrate.jar,copy.config,copy.jar,doc,doc.dist"
164    description="Create everything needed for distribution"
165    >
166    <copy file="${config.dist}/web.xml" todir="${config}/.." description="Default web.xml" />
167    <copy todir="${dist}/www" description="JSP files, etc.">
168      <fileset dir="www" />
169    </copy>
170    <copy todir="${dist}/data" description="Additional data files">
171      <fileset dir="data" />
172    </copy>
173    <copy todir="${dist}/bin" description="Scripts, etc.">
174      <fileset dir="bin" />
175    </copy>
176    <copy todir="${dist}/misc" description="Other files">
177      <fileset dir="misc">
178        <include name="sql/**/*" />
179        <include name="config/**/*" />
180      </fileset>
181      <fileset dir="${webservices.build}" description="Webservice WSDL files">
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"
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="webservices.compile"
865    depends="webservices.init,core.compile"
866    description="Compile the core web services"
867    >
868    <mkdir dir="${webservices.build}" />
869    <javac
870      destdir="${webservices.build}"
871      classpathref="webservices.classpath"
872      encoding="ISO-8859-1"
873      debug="true"
874      deprecation="true"
875      >
876      <src path="${webservices.src}/server" />
877      <src path="${webservices.src}/client/java" />
878      <compilerarg value="${javac.arg}" />
879    </javac>
880   
881    <!-- Create WSDL files for services -->
882    <webservices.wsdl serviceClassName="ArrayDesignService"/>
883    <webservices.wsdl serviceClassName="BioAssaySetService"/>
884    <webservices.wsdl serviceClassName="ExperimentService"/>
885    <webservices.wsdl serviceClassName="ProjectService"/>
886    <webservices.wsdl serviceClassName="RawBioAssayService"/>
887    <webservices.wsdl serviceClassName="SessionService"/>
888   
889    <copy todir="${webservices.build}" 
890      description="Resource files needed by the webservices; excludes documentation and source files"
891      includeEmptyDirs="false"
892      >
893      <fileset dir="${webservices.src}/server">
894        <include name="**/*" />
895        <exclude name="**/*.java" />
896        <exclude name="**/doc-files/" />
897        <exclude name="**/package.html" />
898      </fileset>
899    </copy>   
900  </target>
901 
902  <!-- Creates a WSDL file for a Webservice class -->
903    <macrodef name="webservices.wsdl">
904        <attribute name="serviceClassName"/>
905        <sequential>
906          <java2WSDL
907        classpath="${webservices.build};${core.build}"
908        className="net.sf.basedb.ws.server.@{serviceClassName}"
909        outputLocation="${webservices.wsdlpath}"     
910        serviceName="@{serviceClassName}"
911        outputFileName="@{serviceClassName}.wsdl"
912        >   
913      </java2WSDL>   
914        </sequential>
915    </macrodef>
916 
917  <target
918    name="webservices.aar"
919    depends="webservices.compile"
920    description="Create the core webservices aar file: core.aar"
921    >
922    <mkdir dir="${config}/../services" />
923    <jar
924      basedir="${webservices.build}"
925      jarfile="${config}/../services/core.aar"
926    />
927  </target>
928 
929  <!-- installprg targets -->
930  <target
931    name="installprg.init"
932    depends="core.init,coreplugins.init,web.init"
933    >
934    <property name="installprg.src" location="${src}/install" 
935      description="Location of source files" />
936    <property name="installprg.build" location="${build}/install" 
937      description="Location of compiled files" />
938    <path id="installprg.classpath" description="Class path for compiling installation programs">
939      <path refid="core.classpath"/>
940      <pathelement location="${core.build}"/>
941      <pathelement location="${coreplugins.build}"/>
942      <pathelement location="${web.build}"/>
943    </path>
944  </target>
945  <target
946    name="installprg.compile"
947    depends="installprg.init,core.compile"
948    description="Compile the installation programs"
949    >
950    <mkdir dir="${installprg.build}" />
951    <javac
952      srcdir="${installprg.src}"
953      destdir="${installprg.build}"
954      classpathref="installprg.classpath"
955      encoding="ISO-8859-1"
956      debug="true"
957      deprecation="true"
958      >
959      <compilerarg value="${javac.arg}" />
960    </javac>
961  </target>
962 
963  <target
964    name="installprg.jar"
965    depends="installprg.compile"
966    description="Create the installation jar file: BASE2Install.jar"
967    >
968    <jar
969      basedir="${installprg.build}"
970      jarfile="${bin}/jar/BASE2Install.jar"
971    />
972  </target>
973
974  <!-- jobagent targets -->
975  <target
976    name="jobagent.init"
977    depends="core.init,coreplugins.init,web.init"
978    >
979    <property name="jobagent.src" location="${src}/clients/jobagent" 
980      description="Location of source files" />
981    <property name="jobagent.build" location="${build}/clients/jobagent" 
982      description="Location of compiled files" />
983    <path id="jobagent.classpath" description="Class path for compiling jobagent">
984      <path refid="core.classpath"/>
985      <pathelement location="${core.build}"/>
986    </path>
987  </target>
988  <target
989    name="jobagent.compile"
990    depends="jobagent.init,core.compile"
991    description="Compile the job agent application"
992    >
993    <mkdir dir="${jobagent.build}" />
994    <javac
995      srcdir="${jobagent.src}"
996      destdir="${jobagent.build}"
997      classpathref="jobagent.classpath"
998      encoding="ISO-8859-1"
999      debug="true"
1000      deprecation="true"
1001      >
1002      <compilerarg value="${javac.arg}" />
1003    </javac>
1004  </target>
1005 
1006  <target
1007    name="jobagent.jar"
1008    depends="jobagent.compile"
1009    description="Create the job agent jar file: JobAgent.jar"
1010    >
1011    <jar
1012      basedir="${jobagent.build}"
1013      jarfile="${bin}/jar/JobAgent.jar"
1014    />
1015  </target>
1016
1017  <!-- migrate targets -->
1018  <target
1019    name="migrate.init"
1020    depends="core.init,coreplugins.init,web.init"
1021    >
1022    <property name="migrate.src" location="${src}/clients/migrate" 
1023      description="Location of source files" />
1024    <property name="migrate.build" location="${build}/clients/migrate" 
1025      description="Location of compiled files" />
1026    <path id="migrate.classpath" description="Class path for compiling migration tool">
1027      <path refid="core.classpath"/>
1028      <pathelement location="${core.build}"/>
1029    </path>
1030  </target>
1031  <target
1032    name="migrate.compile"
1033    depends="migrate.init,core.compile"
1034    description="Compile the migration tool"
1035    >
1036    <mkdir dir="${migrate.build}" />
1037    <javac
1038      srcdir="${migrate.src}"
1039      destdir="${migrate.build}"
1040      classpathref="migrate.classpath"
1041      encoding="ISO-8859-1"
1042      debug="true"
1043      deprecation="true"
1044      >
1045      <compilerarg value="${javac.arg}" />
1046    </javac>
1047  </target>
1048 
1049  <target
1050    name="migrate.jar"
1051    depends="migrate.compile"
1052    description="Create the migration tool jar file: Migrate.jar"
1053    >
1054    <jar
1055      basedir="${migrate.build}"
1056      jarfile="${bin}/jar/Migrate.jar"
1057    />
1058  </target>
1059 
1060  <!-- documentation targets -->
1061  <target
1062    name="doc.init"
1063    depends="core.init"
1064    >
1065    <property name="javadoc.src" location="doc/src/javadoc" 
1066      description="Location of javadoc source files" />
1067    <property name="docbook.src" location="doc/src/docbook" 
1068      description="Location of docbook source XML files" />
1069    <path id="javadoc.classpath" description="Class path for generating javadoc">
1070      <path refid="core.classpath" />
1071      <fileset dir="${lib}/servlet">
1072        <include name="**/*.jar"/>
1073      </fileset>
1074      <fileset dir="${lib}/webservices">
1075        <include name="**/*.jar"/>
1076      </fileset>
1077    </path>
1078    <property name="docbook.html.out" location="${doc}/html" />
1079    <property name="docbook.pdf.out" location="${doc}" />
1080  </target>
1081 
1082  <target
1083    name="doc.javadoc"
1084    depends="doc.init,core.init,coreplugins.init,web.init,migrate.init,jobagent.init,webservices.init"
1085    description="Generate JavaDoc of entire API"
1086    >
1087    <!-- Create the time stamp -->
1088    <tstamp>
1089      <format property="TODAY" pattern="yyyy-MM-dd"/>
1090    </tstamp>
1091    <delete dir="${doc}/api" />
1092    <mkdir dir="${doc}/api"/>
1093
1094    <javadoc
1095      packagenames="net.sf.basedb.*"
1096      sourcepath="${core.src}:${coreplugins.src}:${web.src}:${migrate.src}:${jobagent.src}:${webservices.src}/server:${webservices.src}/client/java"
1097      destdir="${doc}/api"
1098      author="true"
1099      version="true"
1100      use="false"
1101      private="true"
1102      windowtitle="BASE ${base.version} API documentation"
1103      stylesheetfile="${javadoc.src}/javadoc.css"
1104      classpathref="javadoc.classpath"
1105      linksource="false"
1106      breakiterator="yes"
1107      encoding="iso-8859-1"
1108      overview="${javadoc.src}/overview.html"
1109      >
1110      <group title="Public API"
1111        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"
1112      />
1113      <group title="Mixed Public and Internal API"
1114        packages="net.sf.basedb.core.data:net.sf.basedb.clients.web:net.sf.basedb.clients.web.util"
1115      />
1116      <group title="Extension API"
1117        packages="net.sf.basedb.core.dbengine:net.sf.basedb.clients.jobagent:net.sf.basedb.ws.server*"
1118      />
1119      <group title="Internal API"
1120        packages="net.sf.basedb.core.data.keyring:net.sf.basedb.clients.jobagent.*:net.sf.basedb.clients.migrate*:net.sf.basedb.clients.web.*"
1121      />
1122     
1123      <header><![CDATA[${base.version}: ${TODAY}]]></header>
1124      <link href="http://java.sun.com/j2se/1.5/docs/api"/>
1125      <link href="http://www.hibernate.org/hib_docs/v3/api"/>
1126      <link href="http://www.jdom.org/docs/apidocs/" />
1127      <link href="http://java.sun.com/products/servlet/2.2/javadoc/" />
1128      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
1129      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
1130      <link href="http://logging.apache.org/log4j/docs/api/" />
1131      <link href="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/" />
1132      <tag name="base.developer" description="Developer info" />
1133      <tag name="base.internal" description="This class/package is not part of the Public API" scope="overview,packages,types" />
1134      <tag name="base.modified" description="Last modified" />
1135      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
1136      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
1137      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
1138      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
1139      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
1140      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
1141      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
1142      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
1143      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
1144      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
1145      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
1146      <tag name="hibernate.array" description="Hibernate: array" scope="methods" />
1147      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
1148      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
1149      <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" />
1150      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
1151      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
1152      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
1153      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
1154      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
1155      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
1156      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
1157      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
1158      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
1159      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
1160      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
1161      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
1162    </javadoc>
1163  </target>
1164 
1165  <target
1166    name="doc.docbook"
1167    depends="doc.init,doc.docbook.html,doc.docbook.pdf"
1168    description="Generate docbook user and admin documentation."
1169    >
1170  </target>
1171   
1172  <target 
1173    name="doc.docbook.html"
1174    depends="dev.init,doc.init,xsltprocessor"
1175    >
1176    <mkdir dir="${docbook.html.out}" />
1177    <!--Create subdirectories to store the chunked files in-->
1178    <mkdir dir="${docbook.html.out}/admindoc"/>
1179    <mkdir dir="${docbook.html.out}/admindoc/user_administration"/>
1180    <mkdir dir="${docbook.html.out}/admindoc/installation_upgrade"/>
1181    <mkdir dir="${docbook.html.out}/admindoc/plugin_installation"/>
1182    <mkdir dir="${docbook.html.out}/admindoc/coreplugin_configuration"/>
1183    <mkdir dir="${docbook.html.out}/developerdoc"/>
1184    <mkdir dir="${docbook.html.out}/developerdoc/api"/>
1185    <mkdir dir="${docbook.html.out}/developerdoc/develop_overview"/>
1186    <mkdir dir="${docbook.html.out}/developerdoc/core_ref"/>
1187    <mkdir dir="${docbook.html.out}/developerdoc/javadoc"/>
1188    <mkdir dir="${docbook.html.out}/developerdoc/plugin_developer"/>
1189    <mkdir dir="${docbook.html.out}/developerdoc/webservices"/>
1190    <mkdir dir="${docbook.html.out}/developerdoc/write_doc"/>
1191    <mkdir dir="${docbook.html.out}/overviewdoc/overview"/>
1192    <mkdir dir="${docbook.html.out}/overviewdoc"/>
1193    <mkdir dir="${docbook.html.out}/overviewdoc/why_base"/>
1194    <mkdir dir="${docbook.html.out}/overviewdoc/resources"/>
1195    <mkdir dir="${docbook.html.out}/userdoc"/>
1196    <mkdir dir="${docbook.html.out}/userdoc/about"/>
1197    <mkdir dir="${docbook.html.out}/userdoc/annotations"/>
1198    <mkdir dir="${docbook.html.out}/userdoc/platforms"/>
1199    <mkdir dir="${docbook.html.out}/userdoc/array_lims"/>
1200    <mkdir dir="${docbook.html.out}/userdoc/biomaterials"/>
1201    <mkdir dir="${docbook.html.out}/userdoc/analysis"/>
1202    <mkdir dir="${docbook.html.out}/userdoc/filesystem"/>
1203    <mkdir dir="${docbook.html.out}/userdoc/hardware"/>
1204    <mkdir dir="${docbook.html.out}/userdoc/import_export"/>
1205    <mkdir dir="${docbook.html.out}/userdoc/jobs"/>
1206    <mkdir dir="${docbook.html.out}/userdoc/project_permission"/>
1207    <mkdir dir="${docbook.html.out}/userdoc/protocols"/>
1208    <mkdir dir="${docbook.html.out}/userdoc/reporters"/>
1209    <mkdir dir="${docbook.html.out}/userdoc/software"/>
1210    <mkdir dir="${docbook.html.out}/userdoc/trashcan"/>
1211    <mkdir dir="${docbook.html.out}/userdoc/webclient"/>
1212    <mkdir dir="${docbook.html.out}/userdoc/overview"/>
1213    <mkdir dir="${docbook.html.out}/faqs" />
1214    <mkdir dir="${docbook.html.out}/appendix" />
1215       
1216    <mkdir dir="${build}/docbook/html" />
1217    <delete description="Delete existing documents">
1218      <fileset dir="${build}/docbook" defaultexcludes="no" />
1219      <fileset dir="${docbook.html.out}" defaultexcludes="no" />
1220    </delete>
1221    <delete file="data/helptexts.xml" />
1222    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="html.chunked">
1223      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1224      <property name="docbook.xml.dir" location="${docbook.src}" />
1225      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1226      <property name="distribution.dir" location="${docbook.html.out}" />
1227      <property name="build.dir" location="${build}/docbook/html" />
1228      <property name="base.version" value="${base.version}"/>
1229    </ant>
1230     <copy todir="${docbook.html.out}">
1231         <fileset dir="${docbook.src}" includes="css/*.*" />
1232         <fileset dir="${docbook.src}" includes="script/*.*" />
1233     </copy>
1234   
1235    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
1236    <path id="ant-extensions">
1237        <fileset dir="${lib}/docbook/ant-extensions" includes="**/*.jar" />
1238        <pathelement path="${lib}/docbook/ant-extensions" />
1239      </path>
1240   
1241    <xmlcatalog id="dtdcatalog">
1242          <catalogpath>
1243              <fileset file="${catalog.location}"/>
1244          </catalogpath>
1245      </xmlcatalog>
1246
1247      <xslt
1248          in      = "${build}/docbook/html/docbook-ready-file.tmp"
1249          style   = "${lib}/docbook/preprocess/webclient_helptext.xsl"
1250          out     = "data/helptexts.xml"
1251          processor = "${xslt.processor}"
1252          >
1253          <xmlcatalog refid="dtdcatalog"/>
1254          <classpath refid="ant-extensions" />
1255
1256          <param name="xsltproc.catalog" expression="${catalog.location}" />
1257          <param name="xsltproc.option.--nonet"  expression="" />
1258      </xslt>
1259
1260    <replaceregexp 
1261      file="data/helptexts.xml"
1262      match="&lt;(?!/?name|/?description|/?helpitem|/?helptexts)(/?([a-z]+)[^>]*)&gt;"
1263      replace="&amp;lt;\$1&amp;gt;"
1264      flags="sg"
1265    />
1266  </target>
1267 
1268  <target 
1269    name="doc.docbook.pdf"
1270    depends="dev.init,doc.init"
1271    >
1272    <!-- Generate a pdf file from the documentation source -->
1273    <mkdir dir="${build}/docbook/pdf" />
1274    <echo>Generate pdf file</echo>
1275    <ant antfile="${lib}/docbook/ant-build-docbook.xml" inheritall="false" target="pdf.fop">
1276      <property name="ant.docbook.styler.dir" location="${lib}/docbook" />
1277      <property name="docbook.xml.dir" location="${docbook.src}" />
1278      <property name="docbook.resources.dir" location="${docbook.src}/figures" />
1279      <property name="distribution.dir" location="${docbook.pdf.out}" />
1280      <property name="build.dir" location="${build}/docbook/pdf" />
1281      <property name="pdf.name" value="base.pdf" />
1282      <property name="base.version" value="${base.version}"/>
1283    </ant>
1284  </target>
1285 
1286  <target 
1287    name="doc.dist"
1288    description="Copy documentation to the binary distribution"
1289    >
1290    <mkdir dir="dist/doc" />
1291    <copy todir="dist/doc">
1292      <!--fileset dir="doc" includes="admin/**/*" /-->
1293      <!--fileset dir="doc" includes="development/**/*" /-->
1294      <fileset dir="doc" includes="licenses/**/*" />
1295      <fileset dir="doc" includes="specifications/**/*" />
1296      <!--fileset dir="doc" includes="user/**/*" /-->
1297      <fileset dir="doc" includes="*.*" />
1298    </copy>
1299  </target>
1300
1301  <target name="xsltprocessor">
1302      <property environment="env"/>
1303
1304      <condition  property="executable.file.extension"
1305                  value=".exe">
1306              <os family="windows"/>
1307      </condition>
1308      <condition  property="executable.file.extension"
1309                  value="">
1310              <os family="unix"/>
1311      </condition>
1312     
1313      <condition  property="tmp:xsltproc.available"
1314                  value="xsltproc${executable.file.extension}">
1315          <or>
1316              <and>
1317                  <os family="windows"/>
1318                  <available file="xsltproc${executable.file.extension}" filepath="${env.Path}" />
1319              </and>
1320              <and>
1321                  <os family="unix"/>
1322                  <available file="xsltproc${executable.file.extension}" filepath="${env.PATH}" />
1323              </and>
1324          </or>
1325      </condition>
1326     
1327      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.XsltProcLiaison">
1328          <and>
1329              <isset property="tmp:xsltproc.available" />
1330              <not>
1331                  <isset property="disable.xsltproc" />
1332              </not>
1333          </and>
1334      </condition>
1335     
1336      <condition property="xslt.processor" value="com.dawidweiss.ant.taskdefs.SaxonLiaison">
1337          <not>
1338              <isset property="disable.saxon" />
1339          </not>
1340      </condition>
1341
1342      <condition property="xslt.processor" value="trax">
1343          <not>
1344          <and>
1345                  <isset property="tmp:xsltproc.available" />
1346                  <not>
1347                      <isset property="disable.xsltproc" />
1348                  </not>
1349          </and>
1350          </not>
1351      </condition>
1352
1353    </target>
1354 
1355  <!--package targets -->
1356  <target
1357    name="package.bin"
1358    depends="dist"
1359    description="Create binary distribution package"
1360    >
1361    <tar
1362      destfile="base-${base.version}.tar.gz"
1363      longfile="gnu"
1364      compression="gzip"
1365      >
1366      <tarfileset
1367        dir="${dist}"
1368        mode="755"
1369        prefix="base-${base.version}"
1370        preserveLeadingSlashes="true"
1371        >
1372        <include name="**/*.sh" />
1373      </tarfileset>
1374      <tarfileset
1375        dir="${dist}"
1376        prefix="base-${base.version}"
1377        preserveLeadingSlashes="true"
1378        >
1379        <exclude name="**/*.sh" />
1380      </tarfileset>
1381    </tar>
1382    <checksum file="base-${base.version}.tar.gz" />
1383  </target>
1384 
1385  <target
1386    name="package.src"
1387    depends="svn.revision"
1388    description="Create source distribution package"
1389    >
1390    <property name="tempdir" location="base-${base.version}-src" />
1391    <delete dir="${tempdir}" failonerror="false"/>
1392    <svn>
1393      <export srcPath="." destPath="${tempdir}" />
1394    </svn>
1395    <replaceregexp 
1396      file="${tempdir}/build.xml"
1397      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1398      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1399      flags="s"
1400    />
1401    <replace file="${tempdir}/build.xml"
1402      description="Remove references to package.src">
1403      <replacefilter 
1404        token="package.bin,package.src"
1405        value="package.bin"
1406      />
1407    </replace>
1408    <replaceregexp 
1409      file="${tempdir}/build.xml"
1410      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1411      replace=""
1412      flags="s"
1413      description="Remove package.src target"
1414    />
1415      <tar
1416      destfile="base-${base.version}-src.tar.gz"
1417      longfile="gnu"
1418      compression="gzip"
1419      >
1420      <tarfileset
1421        dir="${tempdir}"
1422        mode="755"
1423        prefix="base-${base.version}-src"
1424        preserveLeadingSlashes="true"
1425        >
1426        <include name="**/*.sh" />
1427      </tarfileset>
1428      <tarfileset
1429        dir="${tempdir}"
1430        prefix="base-${base.version}-src"
1431        preserveLeadingSlashes="true"
1432        >
1433        <exclude name="**/*.sh" />
1434      </tarfileset>
1435    </tar>
1436    <checksum file="base-${base.version}-src.tar.gz"/>
1437    <delete dir="${tempdir}" />
1438  </target>
1439 
1440</project>
Note: See TracBrowser for help on using the repository browser.