source: trunk/build.xml @ 3196

Last change on this file since 3196 was 3196, checked in by Nicklas Nordborg, 16 years ago

Moved docbook images to figures directory.

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