source: trunk/build.xml @ 3910

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

References #809 Updated javadoc

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