source: branches/webservices/build.xml @ 3006

Last change on this file since 3006 was 3006, checked in by Nicklas Nordborg, 17 years ago

First go at a webservices framework.

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