source: trunk/build.xml @ 7512

Last change on this file since 7512 was 7512, checked in by Nicklas Nordborg, 3 years ago

References #2129: Preparations for Java 11 support

Adding extra JAR files that are required for running BASE with Java 11.

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