source: branches/3.10-stable/build.xml @ 7289

Last change on this file since 7289 was 7289, checked in by Nicklas Nordborg, 6 years ago

Changes for future release 3.10.1

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