source: tags/2.2.2/build.xml @ 3187

Last change on this file since 3187 was 3186, checked in by Jari Häkkinen, 15 years ago

Bumped version number.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 31.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    $Id: build.xml 3186 2007-03-12 19:38:33Z jari $
4
5    Copyright (C) 2005-2006
6    Samuel Andersson, Jari H&auml;kkinen, Nicklas Nordborg, Gregory Vincic
7
8    This file is part of BASE - BioArray Software Environment.
9    Available at http://base.thep.lu.se/
10
11    BASE is free software; you can redistribute it and/or modify it
12    under the terms of the GNU General Public License as published by
13    the Free Software Foundation; either version 2 of the License, or
14    (at your option) any later version.
15
16    BASE is distributed in the hope that it will be useful, but
17    WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24    02111-1307, USA.
25-->
26
27<project
28  name="BASE2"
29  default="dev"
30  basedir="."
31  >
32  <description>
33    Build file for BASE 2. The main targets are ('dev' is default):
34    dev:          Build everything for local use
35    dist:         Build everything (except test) for distribution (put in 'dist') subdirectory
36    package:      Create *.tar.gz files with binary and source distributions
37    clean:        Remove all generated files
38    core:         Build core for local use
39    coreplugins:  Build core plugins for local use
40    web:          Build web client application for local use
41    installprg:   Build installation programs for local use
42    jobagent:     Build jobagent for local use
43    migrate:      Build migration tool for local use
44    test:         Build test programs
45    doc:          Build documentation for local use
46  </description>
47
48  <!-- set BASE version
49    Use numerical versions for bugix (maintenance) releases starting
50    with "1". Use "0" for the first release of a new trunk version.  Add
51    "pre" to unreleased versions.  Examples: 2.1.1pre, 2.1.1,
52    2.1.2pre, 2.2.2, 2.2.0pre, 2.2.0, 2.2.1pre, 2.2.1
53  -->
54  <property name="base.majorversion" value="2" />
55  <property name="base.minorversion" value="2" />
56  <property name="base.maintenanceversion" value="2" />
57  <property name="base.version" 
58    value="${base.majorversion}.${base.minorversion}.${base.maintenanceversion}" />
59 
60  <!-- set other global properties for this build -->
61  <property name="javac.arg" value="-Xlint:unchecked" 
62    description="Extra arguments sent to Java compiler" />
63  <property name="src" location="src" description="Location of source files" />
64  <property name="build" location="build" description="Location of compiled files" />
65  <property name="dist" location="dist" description="Directory where distribution should be created" />
66  <property name="lib" location="lib" description="Location of 3rd-party JAR files" />
67  <property name="config.dist" location="config/dist" 
68    description="Location of default configuration files" />
69  <property name="config.local" location="config/local" 
70    description="Location of local configuration files" />
71 
72  <!-- main class path for compilation -->
73  <path id="core.classpath" 
74    description="Main classpath to all 3rd-party JAR files required for compilation">
75    <fileset dir="${lib}/dist">
76      <include name="**/*.jar"/>
77    </fileset>
78  </path>
79
80  <!-- pattern for configuration files use by copy.config -->
81  <patternset id="config.files">
82    <include name="*.*" />
83    <exclude name="web.xml" />
84    <exclude name="readme.txt" />
85  </patternset>
86 
87  <!-- task definitions -->
88  <taskdef
89    name="hibernatedoclet"
90    classname="xdoclet.modules.hibernate.HibernateDocletTask"
91    description="Task for generating Hibernate mapping files from XDoclet tags"
92    >
93    <classpath>
94      <fileset dir="${lib}/hibernatedoclet">
95        <include name="**/*.jar"/>
96      </fileset>
97    </classpath>
98  </taskdef>
99
100  <taskdef
101    name="svn"
102    classname="org.tigris.subversion.svnant.SvnTask"
103    description="Task for interacting with subversion"
104    >
105    <classpath>
106      <fileset dir="${lib}/svn">
107        <include name="**/*.jar"/>
108      </fileset>
109    </classpath>
110  </taskdef>
111 
112  <!-- main targets -->
113  <target
114    name="clean"
115    description="Remove all generated files and backup files" >
116    <delete failonerror="false" includeemptydirs="true">
117      <fileset dir="${build}" defaultexcludes="no" />
118      <fileset dir="${dist}" defaultexcludes="no" />
119      <fileset dir="bin/jar" defaultexcludes="no" />
120      <fileset dir="www/WEB-INF/lib" defaultexcludes="no" />
121      <fileset dir="www/WEB-INF/classes" defaultexcludes="no" />
122      <fileset dir="www/WEB-INF" includes="web.xml" defaultexcludes="no" />
123      <fileset dir="doc/api" defaultexcludes="no" />
124      <fileset file="doc/development/plugins/exampleplugins.tar.gz" />
125    </delete>
126  </target>
127 
128  <target
129    name="dist"
130    depends="clean,dist.init,core.jar,coreplugins.jar,web.jar,installprg.jar,
131      jobagent.jar,migrate.jar,copy.config,copy.jar,doc,doc.dist"
132    description="Create everything needed for distribution"
133    >
134    <copy file="${config.dist}/web.xml" todir="${config}/.." description="Default web.xml" />
135    <copy todir="${dist}/www" description="JSP files, etc.">
136      <fileset dir="www" />
137    </copy>
138    <copy todir="${dist}/data" description="Additional data files">
139      <fileset dir="data" />
140    </copy>
141    <copy todir="${dist}/bin" description="Scripts, etc.">
142      <fileset dir="bin" />
143    </copy>
144    <copy todir="${dist}/misc" description="Other files">
145      <fileset dir="misc">
146        <include name="sql/**/*" />
147        <include name="config/**/*" />
148      </fileset>
149    </copy>
150    <copy todir="${dist}" description="License and creadits">
151      <fileset file="base2.license.txt" />
152      <fileset file="credits.txt" />
153    </copy>
154    <chmod dir="." includes="**/*.sh" perm="a+x" description="Make all scripts executable" />
155  </target>
156
157  <target
158    name="package"
159    depends="package.bin,package.src"
160    description="Generate tar.gz files for the binary and source distribution"
161    >
162  </target>
163 
164  <target
165    name="dev"
166    depends="dev.init,core,coreplugins,web,installprg,jobagent,migrate,test"
167    description="Create a runnable local installation"
168  />
169 
170  <target
171    name="core"
172    depends="dev.init,core.jar"
173    description="Build the core for local use"
174  />
175
176  <target
177    name="coreplugins"
178    depends="core,coreplugins.jar"
179    description="Build the core plugins for local use"
180  />
181 
182  <target
183    name="exampleplugins"
184    depends="core,exampleplugins.jar"
185    description="Build the example plugins for local use"
186  />
187 
188  <target
189    name="test"
190    depends="test.jar,core.hibernate"
191    description="Compile the test programs for local use"
192    >
193    <mkdir dir="${test.build}/data" />
194    <copy todir="${test.build}/data" description="Test-data files">
195      <fileset dir="${test.src}/data">
196        <include name="**/*" />
197      </fileset>
198    </copy>
199    <copy todir="${test.build}" description="Script files, etc.">
200      <fileset dir="${test.src}">
201        <include name="**/*" />
202        <exclude name="**/*.java" />
203      </fileset>
204    </copy>
205    <chmod dir="${test.build}" includes="*.sh" perm="a+x"/>
206  </target>
207 
208  <target
209    name="web"
210    depends="core,coreplugins,web.jar,copy.config,copy.jar"
211    description="Build web client application for local use"
212    >
213  </target>
214 
215  <target
216    name="installprg"
217    depends="web,installprg.jar"
218    description="Build installation programs for local use"
219  />
220 
221  <target
222    name="jobagent"
223    depends="web,jobagent.jar"
224    description="Build job agent for local use"
225  />
226 
227  <target
228    name="migrate"
229    depends="web,migrate.jar"
230    description="Build migration tool for local use"
231  />
232 
233  <target
234    name="doc"
235    depends="doc.javadoc,exampleplugins.tar"
236    description="Generate documentation for local use"
237  />
238 
239  <!-- init targets -->
240  <target
241    name="init"
242    depends="svn.revision"
243    description="Initialise things"
244    >
245  </target>
246 
247  <target
248    name="dist.init"
249    depends="init"
250    unless="isDev"
251    >
252    <property name="isDist" value="1" />
253    <property name="jar" location="${dist}/www/WEB-INF/lib" />
254    <property name="config" location="${dist}/www/WEB-INF/classes" />
255    <property name="bin" location="${dist}/bin" />
256    <property name="doc" location="${dist}/doc" />
257    <mkdir dir="${jar}" />
258    <mkdir dir="${config}" />
259    <mkdir dir="${bin}" />
260    <mkdir dir="${bin}/jar" />
261    <mkdir dir="${dist}/data" />
262    <mkdir dir="${dist}/doc" />
263    <mkdir dir="${dist}/misc" />
264  </target>
265 
266  <target
267    name="dev.init"
268    depends="init"
269    unless="isDist"
270    >
271    <property name="isDev" value="1" />
272    <property name="jar" location="www/WEB-INF/lib" />
273    <property name="config" location="www/WEB-INF/classes" />
274    <property name="bin" location="bin" />
275    <property name="doc" location="doc" />
276    <mkdir dir="${bin}/jar" />
277    <mkdir dir="${jar}" />
278    <mkdir dir="${config}" />
279  </target>
280 
281  <target 
282    name="svn.revision"
283    description="Get the current revision number in the subversion and put the
284      value into the base.build property; replaced by constant expression in source distributions"
285    >
286    <svn>
287      <status path="." lastChangedRevisionProperty="base.build" />
288    </svn>
289    <echo message="Build #${base.build}" />
290  </target>
291 
292  <!-- configuration targets -->
293  <target
294    name="copy.config"
295    depends="copy.config.local,copy.config.dist"
296    description="Copies configuration files to the appropriate folder"
297    >
298  </target>
299   
300  <target
301    name="copy.config.dist"
302    >
303    <copy todir="${config}" description="Default configuration files">
304      <fileset dir="${config.dist}">
305        <patternset refid="config.files" />
306        <present present="srconly" targetdir="${config}" />
307      </fileset>
308    </copy>
309    <copy todir="${config}/.."  description="Default web.xml">
310      <fileset dir="${config.dist}">
311        <include name="web.xml" />
312        <present present="srconly" targetdir="${config}/.." />
313      </fileset>
314    </copy>
315  </target>
316 
317  <target
318    name="copy.config.local"
319    if="isDev"
320    unless="isDist"
321    >
322    <copy todir="${config}" description="Local configuration files">
323      <fileset dir="${config.local}">
324        <patternset refid="config.files" />
325      </fileset>
326    </copy>
327    <copy todir="${config}/.."  description="Local web.xml">
328      <fileset dir="${config.local}">
329        <include name="web.xml" />
330      </fileset>
331    </copy>
332  </target>
333 
334  <target
335    name="copy.jar"
336    description="Copy required jar files to the appropriate folder"
337    >
338    <copy todir="${jar}" description="3rd-party JAR files">
339      <fileset dir="${lib}/dist">
340        <include name="**/*" />
341      </fileset>
342    </copy>
343  </target>
344 
345  <!-- core targets -->
346  <target
347    name="core.init"
348    depends="dev.init"
349    >
350    <property name="core.src" location="${src}/core" 
351      description="Location of core source files" />
352    <property name="core.build" location="${build}/core" 
353      description="Location of compiled core files" />
354  </target>
355 
356  <target
357    name="core.compile"
358    depends="core.init"
359    description="Compile the core"
360    >
361    <mkdir dir="${core.build}"/>
362    <javac
363      srcdir="${core.src}"
364      destdir="${core.build}"
365      classpathref="core.classpath"
366      encoding="ISO-8859-1"
367      debug="true"
368      deprecation="true"
369      >
370      <compilerarg value="${javac.arg}" />
371    </javac>
372    <copy todir="${core.build}" 
373      description="Resource files needed by the core; excludes documentation and source files">
374      <fileset dir="${core.src}">
375        <include name="**/*" />
376        <exclude name="**/*.java" />
377        <exclude name="**/doc-files/" />
378        <exclude name="**/package.html" />
379      </fileset>
380    </copy>
381    <replace file="${core.build}/base.version">
382      <replacefilter 
383        token="@MAJOR@"
384        value="${base.majorversion}"
385      />
386      <replacefilter 
387        token="@MINOR@"
388        value="${base.minorversion}"
389      />
390      <replacefilter 
391        token="@MAINTENANCE@"
392        value="${base.maintenanceversion}"
393      />
394      <replacefilter 
395        token="@BUILD@"
396        value="${base.build}"
397      />
398    </replace>
399  </target>
400
401  <target
402    name="check.hibernate"
403    depends="core.init"
404    >
405    <uptodate
406      property="nohibernate"
407      >
408      <srcfiles dir="${core.src}/net/sf/basedb/core/data" includes="**/*.java">
409        <contains text="@hibernate.class" />
410      </srcfiles>
411      <mapper type="glob" from="*.java" to="${core.build}/net/sf/basedb/core/data/*.hbm.xml" />
412    </uptodate>
413    <condition property="hibernate.message" 
414      value="up to date; skipping" 
415      >
416      <istrue value="${nohibernate}" />
417    </condition>
418    <condition property="hibernate.message" 
419      value="not up to date; generating new" 
420      >
421      <isfalse value="${nohibernate}" />
422    </condition>
423    <echo>Hibernate mapping files are ${hibernate.message}</echo>
424  </target>
425 
426  <target
427    name="core.hibernate"
428    depends="core.init,core.compile,check.hibernate"
429    description="Generates Hibernate mapping files from the source code"
430    unless="nohibernate"
431    >
432    <delete>
433      <fileset dir="${core.build}" includes="**/*.hbm.xml" />
434    </delete>
435    <copy todir="${core.build}" 
436      description="Hardcoded *.hbm.xml files">
437      <fileset dir="${core.src}" includes="**/*.hbm.xml" />
438    </copy>
439    <hibernatedoclet
440      destdir="${core.build}"
441      excludedtags="@version,@author,@todo"
442      mergedir="${core.build}"
443      verbose="${xdoclet.verbose}">
444      <fileset dir="${core.src}">
445        <include name="**/*.java"/>
446      </fileset>
447      <hibernate version="2.0"/>
448    </hibernatedoclet>
449   
450    <replace
451      dir="${core.build}"
452      >
453      <include name="**/*.hbm.xml"/>
454      <replacefilter 
455        token="2.0//EN"
456        value="3.0//EN"
457      />
458      <replacefilter 
459        token="2.0.dtd"
460        value="3.0.dtd"
461      />
462      <replacefilter
463        token="outer-join=&#34;false&#34;"
464        value="fetch=&#34;select&#34;"
465      />
466      <replacefilter
467        token="outer-join=&#34;true&#34;"
468        value="fetch=&#34;join&#34;"
469      />
470      <replacefilter
471        token="index-many-to-many"
472        value="map-key-many-to-many"
473      />
474      <replacefilter
475        token="&lt;index&gt;"
476        value="&lt;list-index&gt;"
477      />
478      <replacefilter
479        token="&lt;/index&gt;"
480        value="&lt;/list-index&gt;"
481      />
482      <replacefilter
483        token="composite-index"
484        value="composite-map-key"
485      />
486    </replace>
487  </target>
488 
489  <target
490    name="core.jar"
491    depends="core.init,core.compile,core.hibernate"
492    description="Create the core jar file: BASE2Core.jar"
493    >
494    <jar
495      basedir="${core.build}"
496      jarfile="${jar}/BASE2Core.jar"
497    />
498  </target>
499
500  <!-- core plugin targets -->
501  <target
502    name="coreplugins.init"
503    depends="core.init"
504    >
505    <property name="coreplugins.src" location="${src}/plugins/core" 
506      description="Location of source files" />
507    <property name="coreplugins.build" location="${build}/plugins/core" 
508      description="Location of compiled files" />
509    <path id="coreplugins.classpath" description="Class path for compiling plugins">
510      <path refid="core.classpath"/>
511      <pathelement location="${core.build}"/>
512    </path>
513  </target>
514 
515  <target
516    name="coreplugins.compile"
517    depends="core.compile,coreplugins.init"
518    description="Compile the core plugins"
519    >
520    <mkdir dir="${coreplugins.build}" />
521    <javac
522      srcdir="${coreplugins.src}"
523      destdir="${coreplugins.build}"
524      classpathref="coreplugins.classpath"
525      encoding="ISO-8859-1"
526      debug="true"
527      deprecation="true"
528      >
529      <compilerarg value="${javac.arg}" />
530    </javac>
531  </target>
532 
533  <target
534    name="coreplugins.jar"
535    depends="coreplugins.compile"
536    description="Create the plugin jar file: BASE2CorePlugins.jar"
537    >
538    <jar
539      basedir="${coreplugins.build}"
540      jarfile="${jar}/BASE2CorePlugins.jar"
541    />
542  </target>
543 
544  <!-- example plugin targets -->
545  <target
546    name="exampleplugins.init"
547    depends="core.init"
548    >
549    <property name="exampledir" location="${src}/examples/plugins" />
550    <property name="exampleplugins.src" location="${exampledir}/src" 
551      description="Location of source files" />
552    <property name="exampleplugins.build" location="${build}/plugins/example" 
553      description="Location of compiled files" />
554    <path id="exampleplugins.classpath" description="Class path for compiling plugins">
555      <path refid="core.classpath"/>
556      <pathelement location="${core.build}"/>
557    </path>
558  </target>
559 
560  <target
561    name="exampleplugins.compile"
562    depends="core.compile,exampleplugins.init"
563    description="Compile the example plugins"
564    >
565    <mkdir dir="${exampleplugins.build}" />
566    <javac
567      srcdir="${exampleplugins.src}"
568      destdir="${exampleplugins.build}"
569      classpathref="exampleplugins.classpath"
570      encoding="ISO-8859-1"
571      debug="true"
572      deprecation="true"
573      >
574      <compilerarg value="${javac.arg}" />
575    </javac>
576  </target>
577 
578  <target
579    name="exampleplugins.jar"
580    depends="exampleplugins.compile"
581    description="Create the example plugins jar file: ExamplePlugins.jar"
582    >
583    <jar
584      basedir="${exampleplugins.build}"
585      jarfile="${jar}/ExamplePlugins.jar"
586      manifest="${exampledir}/MANIFEST.MF"
587    />
588  </target>
589
590  <target
591    name="exampleplugins.tar"
592    depends="exampleplugins.jar"
593    description="Create a downloadable tar file with the example plugins"
594    >
595    <mkdir dir="${doc}/development/plugins" />
596    <tar
597      destfile="${doc}/development/plugins/exampleplugins.tar.gz"
598      compression="gzip"
599      >
600      <tarfileset
601        dir="${exampledir}"
602        preserveLeadingSlashes="true"
603      />
604      <tarfileset
605        dir="${exampleplugins.build}"
606        prefix="bin"
607        preserveLeadingSlashes="true"
608      />
609    </tar>
610  </target>
611 
612  <!-- test targets -->
613  <target
614    name="test.init"
615    depends="core.init,coreplugins.init,jobagent.init"
616    >
617    <property name="test.src" location="${src}/test" 
618      description="Location of source files" />
619    <property name="test.build" location="${build}/test" 
620      description="Location of compiled files" />
621    <path id="test.classpath" description="Class path for compiling">
622      <path refid="core.classpath"/>
623      <pathelement location="${core.build}" />
624      <pathelement location="${coreplugins.build}" />
625      <pathelement location="${jobagent.build}" />
626    </path>
627  </target>
628 
629  <target
630    name="test.compile"
631    depends="test.init,core.compile,coreplugins.compile,jobagent.compile"
632    description="Compile the test programs"
633    >
634    <mkdir dir="${test.build}" />
635    <javac
636      srcdir="${test.src}"
637      destdir="${test.build}"
638      classpathref="test.classpath"
639      encoding="ISO-8859-1"
640      debug="true"
641      deprecation="true"
642      >
643      <compilerarg value="${javac.arg}" />
644    </javac>
645  </target>
646 
647  <target
648    name="test.jar"
649    depends="test.compile"
650    description="Create a JAR file used by the test programs; Delete corresponding .class files"
651    >
652    <jar 
653      jarfile="${test.build}/JarPluginAbout.jar" 
654      basedir="${test.build}" 
655      includes="JarPluginAbout.class" 
656    />
657    <jar 
658      jarfile="${test.build}/JarPlugin.jar" 
659      basedir="${test.build}" 
660      includes="JarPlugin*,NullPlugin*"
661      excludes="JarPlugin.jar,JarPluginAbout.*"
662      manifest="${test.src}/data/JarPluginManifest.txt"
663    />
664    <delete>
665      <fileset dir="${test.build}" includes="JarPlugin*.class" />
666    </delete>
667  </target>
668
669  <!-- web targets -->
670  <target
671    name="web.init"
672    depends="core.init,coreplugins.init"
673    >
674    <property name="web.src" location="${src}/clients/web" 
675      description="Location of source files" />
676    <property name="web.build" location="${build}/clients/web" 
677      description="Location of compiled files" />
678    <property name="web.inf" location="www/WEB-INF" 
679      description="Location of the WEB-INF folder" />
680    <path id="web.classpath" description="Class path for compiling web client">
681      <path refid="core.classpath"/>
682      <pathelement location="${core.build}"/>
683      <pathelement location="${coreplugins.build}" />
684      <fileset dir="${lib}/servlet">
685        <include name="**/*.jar"/>
686      </fileset>
687    </path>
688  </target>
689 
690  <target
691    name="web.compile"
692    depends="web.init,core.compile"
693    description="Compile the web client application"
694    >
695    <mkdir dir="${web.build}" />
696    <javac
697      srcdir="${web.src}"
698      destdir="${web.build}"
699      classpathref="web.classpath"
700      encoding="ISO-8859-1"
701      debug="true"
702      deprecation="true"
703      >
704      <compilerarg value="${javac.arg}" />
705    </javac>
706  </target>
707 
708  <target
709    name="web.jar"
710    depends="web.compile"
711    description="Create the web client jar file: BASE2Webclient.jar"
712    >
713    <jar
714      basedir="${web.build}"
715      jarfile="${jar}/BASE2Webclient.jar"
716    />
717  </target>
718 
719  <target 
720    name="web.jsp"
721    depends="web"
722    description="Compile all JSP pages to a temporary directory; used for checking only"
723    >
724    <property name="jsp.build" location="${build}/jsp" />
725    <property environment="env" />
726    <mkdir dir="${jsp.build}/src" />
727    <mkdir dir="${jsp.build}/classes" />
728   
729    <path id="jsp.precompile.classpath">
730      <pathelement location="${java.home}/../lib/tools.jar" />
731      <fileset dir="${env.CATALINA_HOME}/server/lib">
732        <include name="*.jar" />
733      </fileset>
734      <fileset dir="${env.CATALINA_HOME}/common/lib">
735        <include name="*.jar" />
736      </fileset>
737      <fileset dir="${env.CATALINA_HOME}/bin">
738        <include name="*.jar" />
739      </fileset>
740    </path>
741   
742    <path id="jsp.compile.classpath">
743      <path refid="web.classpath" />
744      <pathelement location="${java.home}/../lib/tools.jar" />
745      <fileset dir="${env.CATALINA_HOME}/common/lib">
746        <include name="*.jar" />
747      </fileset>
748      <fileset dir="${env.CATALINA_HOME}/shared/lib">
749        <include name="*.jar" />
750      </fileset>
751      <fileset dir="${web.inf}/lib">
752        <include name="*.jar" />
753      </fileset>
754    </path>
755
756    <taskdef
757      classname="org.apache.jasper.JspC" 
758      name="jasper2"
759      classpathref="jsp.precompile.classpath"
760    />
761    <jasper2
762      validateXml="false"
763      uriroot="www"
764      webXmlFragment="${jsp.build}/generated_web.xml"
765      outputdir="${jsp.build}/src"
766    />
767    <javac
768      destdir="${jsp.build}/classes"
769      srcdir="${jsp.build}/src"
770      debug="true"
771      classpathref="jsp.compile.classpath"
772      memoryinitialsize="256m"
773      memorymaximumsize="512m"
774      fork="true"
775      >
776    </javac>
777  </target>
778 
779  <!-- installprg targets -->
780  <target
781    name="installprg.init"
782    depends="core.init,coreplugins.init,web.init"
783    >
784    <property name="installprg.src" location="${src}/install" 
785      description="Location of source files" />
786    <property name="installprg.build" location="${build}/install" 
787      description="Location of compiled files" />
788    <path id="installprg.classpath" description="Class path for compiling installation programs">
789      <path refid="core.classpath"/>
790      <pathelement location="${core.build}"/>
791      <pathelement location="${coreplugins.build}"/>
792      <pathelement location="${web.build}"/>
793    </path>
794  </target>
795  <target
796    name="installprg.compile"
797    depends="installprg.init,core.compile"
798    description="Compile the installation programs"
799    >
800    <mkdir dir="${installprg.build}" />
801    <javac
802      srcdir="${installprg.src}"
803      destdir="${installprg.build}"
804      classpathref="installprg.classpath"
805      encoding="ISO-8859-1"
806      debug="true"
807      deprecation="true"
808      >
809      <compilerarg value="${javac.arg}" />
810    </javac>
811  </target>
812 
813  <target
814    name="installprg.jar"
815    depends="installprg.compile"
816    description="Create the installation jar file: BASE2Install.jar"
817    >
818    <jar
819      basedir="${installprg.build}"
820      jarfile="${bin}/jar/BASE2Install.jar"
821    />
822  </target>
823
824  <!-- jobagent targets -->
825  <target
826    name="jobagent.init"
827    depends="core.init,coreplugins.init,web.init"
828    >
829    <property name="jobagent.src" location="${src}/clients/jobagent" 
830      description="Location of source files" />
831    <property name="jobagent.build" location="${build}/clients/jobagent" 
832      description="Location of compiled files" />
833    <path id="jobagent.classpath" description="Class path for compiling jobagent">
834      <path refid="core.classpath"/>
835      <pathelement location="${core.build}"/>
836    </path>
837  </target>
838  <target
839    name="jobagent.compile"
840    depends="jobagent.init,core.compile"
841    description="Compile the job agent application"
842    >
843    <mkdir dir="${jobagent.build}" />
844    <javac
845      srcdir="${jobagent.src}"
846      destdir="${jobagent.build}"
847      classpathref="jobagent.classpath"
848      encoding="ISO-8859-1"
849      debug="true"
850      deprecation="true"
851      >
852      <compilerarg value="${javac.arg}" />
853    </javac>
854  </target>
855 
856  <target
857    name="jobagent.jar"
858    depends="jobagent.compile"
859    description="Create the job agent jar file: JobAgent.jar"
860    >
861    <jar
862      basedir="${jobagent.build}"
863      jarfile="${bin}/jar/JobAgent.jar"
864    />
865  </target>
866
867  <!-- migrate targets -->
868  <target
869    name="migrate.init"
870    depends="core.init,coreplugins.init,web.init"
871    >
872    <property name="migrate.src" location="${src}/clients/migrate" 
873      description="Location of source files" />
874    <property name="migrate.build" location="${build}/clients/migrate" 
875      description="Location of compiled files" />
876    <path id="migrate.classpath" description="Class path for compiling migration tool">
877      <path refid="core.classpath"/>
878      <pathelement location="${core.build}"/>
879    </path>
880  </target>
881  <target
882    name="migrate.compile"
883    depends="migrate.init,core.compile"
884    description="Compile the migration tool"
885    >
886    <mkdir dir="${migrate.build}" />
887    <javac
888      srcdir="${migrate.src}"
889      destdir="${migrate.build}"
890      classpathref="migrate.classpath"
891      encoding="ISO-8859-1"
892      debug="true"
893      deprecation="true"
894      >
895      <compilerarg value="${javac.arg}" />
896    </javac>
897  </target>
898 
899  <target
900    name="migrate.jar"
901    depends="migrate.compile"
902    description="Create the migration tool jar file: Migrate.jar"
903    >
904    <jar
905      basedir="${migrate.build}"
906      jarfile="${bin}/jar/Migrate.jar"
907    />
908  </target>
909 
910  <!-- documentation targets -->
911  <target
912    name="doc.init"
913    >
914    <path id="javadoc.classpath" description="Class path for generating javadoc">
915      <path refid="core.classpath" />
916      <fileset dir="${lib}/servlet">
917        <include name="**/*.jar"/>
918      </fileset>
919    </path>
920  </target>
921 
922  <target
923    name="doc.javadoc"
924    depends="doc.init,core.init,coreplugins.init,web.init,migrate.init,jobagent.init"
925    description="Generate JavaDoc of entire API"
926    >
927    <!-- Create the time stamp -->
928    <tstamp>
929      <format property="TODAY" pattern="yyyy-MM-dd"/>
930    </tstamp>
931    <delete dir="${doc}/api" />
932    <mkdir dir="${doc}/api"/>
933
934    <javadoc
935      packagenames="net.sf.basedb.*"
936      sourcepath="${core.src}:${coreplugins.src}:${web.src}:${migrate.src}:${jobagent.src}"
937      destdir="${doc}/api"
938      author="true"
939      version="true"
940      use="false"
941      private="true"
942      windowtitle="BASE ${base.version} API documentation"
943      stylesheetfile="doc/javadoc.css"
944      classpathref="javadoc.classpath"
945      linksource="false"
946      breakiterator="yes"
947      encoding="iso-8859-1"
948      >
949      <header><![CDATA[${base.version}: ${TODAY}]]></header>
950      <link href="http://java.sun.com/j2se/1.5/docs/api"/>
951      <link href="http://www.hibernate.org/hib_docs/v3/api"/>
952      <link href="http://www.jdom.org/docs/apidocs/" />
953      <link href="http://java.sun.com/products/servlet/2.2/javadoc/" />
954      <link href="http://www.singularsys.com/jep/doc/javadoc/" />
955      <link href="http://www.jfree.org/jfreechart/api/gjdoc/" />
956      <link href="http://logging.apache.org/log4j/docs/api/" />
957      <link href="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/" />
958      <tag name="base.internal" description="Developer info" />
959      <tag name="base.modified" description="Last modified" />
960      <tag name="hibernate.class" description="Hibernate: class" scope="types" />
961      <tag name="hibernate.subclass" description="Hibernate: subclass" scope="types" />
962      <tag name="hibernate.discriminator" description="Hibernate: discriminator" scope="types" />
963      <tag name="hibernate.id" description="Hibernate: id" scope="methods" />
964      <tag name="hibernate.generator-param" description="Hibernate: generator-param" scope="methods" />
965      <tag name="hibernate.version" description="Hibernate: version" scope="methods" />
966      <tag name="hibernate.property" description="Hibernate: property" scope="methods" />
967      <tag name="hibernate.column" description="Hibernate: column" scope="methods" />
968      <tag name="hibernate.map" description="Hibernate: map" scope="methods" />
969      <tag name="hibernate.set" description="Hibernate: set" scope="methods" />
970      <tag name="hibernate.list" description="Hibernate: list" scope="methods" />
971      <tag name="hibernate.array" description="Hibernate: array" scope="methods" />
972      <tag name="hibernate.one-to-one" description="Hibernate: one-to-one" scope="methods" />
973      <tag name="hibernate.many-to-one" description="Hibernate: many-to-one" scope="methods" />
974      <tag name="hibernate.many-to-many" description="Hibernate: many-to-many" scope="methods" />
975      <tag name="hibernate.index-many-to-many" description="Hibernate: index-many-to-many" scope="methods" />
976      <tag name="hibernate.collection-key" description="Hibernate: collection-key" scope="methods" />
977      <tag name="hibernate.collection-index" description="Hibernate: collection-index" scope="methods" />
978      <tag name="hibernate.collection-composite-index" description="Hibernate: collection-composite-index" scope="methods" />
979      <tag name="hibernate.collection-element" description="Hibernate: collection-element" scope="methods" />
980      <tag name="hibernate.collection-composite-element" description="Hibernate: collection-composite-element" scope="methods" />
981      <tag name="hibernate.collection-one-to-many" description="Hibernate: collection-one-to-many" scope="methods" />
982      <tag name="hibernate.collection-many-to-many" description="Hibernate: collection-many-to-many" scope="methods" />
983      <tag name="hibernate.bag" description="Hibernate: bag" scope="methods" />
984      <tag name="hibernate.many-to-any" description="Hibernate: many-to-any" scope="methods" />
985      <tag name="hibernate.many-to-any-column" description="Hibernate: many-to-any-column" scope="methods" />
986      <tag name="hibernate.component" description="Hibernate: component" scope="methods" />
987    </javadoc>
988  </target>
989 
990  <target 
991    name="doc.dist"
992    description="Copy documentation to the binary distribution"
993    >
994    <mkdir dir="dist/doc" />
995    <copy todir="dist/doc">
996      <fileset dir="doc" includes="admin/**/*" />
997      <fileset dir="doc" includes="development/**/*" />
998      <fileset dir="doc" includes="licenses/**/*" />
999      <fileset dir="doc" includes="specifications/**/*" />
1000      <fileset dir="doc" includes="user/**/*" />
1001      <fileset dir="doc" includes="*.*" />
1002    </copy>
1003  </target>
1004 
1005  <!--package targets -->
1006  <target
1007    name="package.bin"
1008    depends="dist"
1009    description="Create binary distribution package"
1010    >
1011    <tar
1012      destfile="base-${base.version}.tar.gz"
1013      longfile="gnu"
1014      compression="gzip"
1015      >
1016      <tarfileset
1017        dir="${dist}"
1018        mode="755"
1019        prefix="base-${base.version}"
1020        preserveLeadingSlashes="true"
1021        >
1022        <include name="**/*.sh" />
1023      </tarfileset>
1024      <tarfileset
1025        dir="${dist}"
1026        prefix="base-${base.version}"
1027        preserveLeadingSlashes="true"
1028        >
1029        <exclude name="**/*.sh" />
1030      </tarfileset>
1031    </tar>
1032    <checksum file="base-${base.version}.tar.gz" />
1033  </target>
1034 
1035  <target
1036    name="package.src"
1037    depends="svn.revision"
1038    description="Create source distribution package"
1039    >
1040    <property name="tempdir" location="base-${base.version}-src" />
1041    <delete dir="${tempdir}" failonerror="false"/>
1042    <svn>
1043      <export srcPath="." destPath="${tempdir}" />
1044    </svn>
1045    <replaceregexp 
1046      file="${tempdir}/build.xml"
1047      match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
1048      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
1049      flags="s"
1050    />
1051    <replace file="${tempdir}/build.xml"
1052      description="Remove references to package.src">
1053      <replacefilter 
1054        token="package.bin,package.src"
1055        value="package.bin"
1056      />
1057    </replace>
1058    <replaceregexp 
1059      file="${tempdir}/build.xml"
1060      match="&lt;target\s*?name=&#34;package.src&#34;.*?&lt;/target&gt;"
1061      replace=""
1062      flags="s"
1063      description="Remove package.src target"
1064    />
1065      <tar
1066      destfile="base-${base.version}-src.tar.gz"
1067      longfile="gnu"
1068      compression="gzip"
1069      >
1070      <tarfileset
1071        dir="${tempdir}"
1072        mode="755"
1073        prefix="base-${base.version}-src"
1074        preserveLeadingSlashes="true"
1075        >
1076        <include name="**/*.sh" />
1077      </tarfileset>
1078      <tarfileset
1079        dir="${tempdir}"
1080        prefix="base-${base.version}-src"
1081        preserveLeadingSlashes="true"
1082        >
1083        <exclude name="**/*.sh" />
1084      </tarfileset>
1085    </tar>
1086    <checksum file="base-${base.version}-src.tar.gz"/>
1087    <delete dir="${tempdir}" />
1088  </target>
1089
1090</project>
Note: See TracBrowser for help on using the repository browser.