root/greenstone3/trunk/build.xml @ 19911

Revision 19911, 67.2 KB (checked in by oranfry, 11 years ago)

minor simplification

Line 
1<?xml version="1.0"?>
2<!-- ======================================================================
3     March 2005                                                   
4
5     Greenstone3 build and install script
6                 
7     kjdon                                                               
8     ====================================================================== -->
9<project name="greenstone3" default="usage" basedir=".">
10
11  <!-- ============ classpath =================== -->
12  <path id="project.classpath">
13    <fileset dir="lib/java">
14      <include name="**/*.jar"/>
15    </fileset>
16  </path>
17 
18  <!-- ============ self defined tasks =================== -->
19  <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpathref="project.classpath"/>
20  <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpathref="project.classpath"/>
21  <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
22  <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
23  <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
24 
25  <!-- ===================== Property Definitions =========================== -->
26 
27  <!--
28
29  Each of the following properties are used in the build script.
30  Values for these properties are set by the first place they are
31  defined, from the following list:
32
33  * Definitions on the "ant" command line (ant -Dfoo=bar compile).
34
35  * Definitions from a "build.properties" file in the top level
36  source directory of this application.
37
38  * Definitions from a "build.properties" file in the user's
39  home directory.
40
41  * Default definitions in this build.xml file.
42
43  You will note below that property values can be composed based on the
44  contents of previously defined properties.  This is a powerful technique
45  that helps you minimize the number of changes required when your development
46  environment is modified.  Note that property composition is allowed within
47  "build.properties" files as well as in the "build.xml" script.
48
49  -->
50
51  <!-- create build.properties if it has not been created yet -->
52  <if>
53    <bool><not><available file="build.properties"/></not></bool>
54    <copy file="build.properties.in" tofile="build.properties"/>
55  </if>
56
57  <!-- create the packages dir if it has not been created yet -->
58  <mkdir dir="packages"/>
59 
60  <!--the first three properties have to be put on the top to be used by build.properties-->
61  <property name="gs2build.home" value="${basedir}/gs2build"/>
62  <property name="src.packages.home" value="${basedir}/src/packages"/>
63  <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
64
65  <property file="build.properties"/>
66  <if><bool><available file="${user.home}/build.properties"/></bool>
67    <property file="${user.home}/build.properties"/>
68  </if>
69
70  <!-- get properties from the environment -->
71  <property environment="env"/>
72
73   
74  <!-- version properties for external packages -->
75  <property name="tomcat.version" value="apache-tomcat-5.5.25"/>
76  <property name="axis.zip.version" value="axis-bin-1_2_1.zip"/>
77  <property name="axis.dir.version" value="axis-1_2_1"/>
78  <property name="sqlite.targz.version" value="sqlite-amalgamation-3.5.9.tar.gz"/>
79
80  <property name="build.home" value="${basedir}/build"/>
81  <property name="src.home" value="${basedir}/src/java"/>
82  <property name="packages.home" value="${basedir}/packages"/>
83  <!-- this may be set in build.properties, eg if you move the web dir to
84  tomcats webapps directory -->
85  <property name="web.home" value="${basedir}/web"/>
86  <!-- jar files needed by applets go here -->
87  <property name="web.applet" value="${web.home}/applet"/>
88  <!-- jar files needed by the servlet (and extra ones) go here -->
89  <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
90  <!-- other files needed by the servlet go here -->
91  <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
92  <!--- flax: the WordNet home -->
93  <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
94
95  <!-- jni libraries and java wrappers go here -->
96  <property name="lib.jni" value="${basedir}/lib/jni"/>
97
98  <!-- other jar files needed for installation (but not runtime) go here -->
99  <property name="lib.java" value="${basedir}/lib/java"/>
100 
101  <property name="javadocs" value="${basedir}/docs/javadoc"/>
102
103  <property name="app.name"      value="greenstone3"/>
104  <property name="app.path"      value="/${app.name}"/>
105
106   <property name="admin.dir"      value="${basedir}/admin"/>
107
108  <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
109  <property name="app.version" value="trunk"/>
110  <property name="branch.path" value="trunk"/>
111  <property name="branch.revision" value="HEAD"/>
112
113  <!--constants -->
114  <property name="svn.root" value="http://svn.greenstone.org"/>
115
116  <!-- catalina home is set to tomcat basedir if already installed, otherwise
117  use greenstone's tomcat -->
118  <condition property="catalina.home" value="${tomcat.installed.path}">
119    <and>
120      <isset property="tomcat.installed.path"/>
121      <not>
122      <equals arg1="" arg2="${tomcat.installed.path}"/>
123      </not>
124    </and>
125  </condition>
126 
127  <property name="catalina.home" value="${packages.home}/tomcat"/>
128
129  <property name="os.linux" value="Linux"/>
130  <property name="os.mac" value="Mac OS X"/>
131  <property name="os.solaris" value="SunOS"/>
132  <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
133  <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows 2003,Windows XP,Windows NT,Windows ME,Windows Vista"/> <!-- check this!!!-->
134
135  <!-- this is true for linux and macs -->
136  <condition property="current.os.isunix">
137    <os family="unix"/>
138  </condition>
139 
140  <condition property="current.os.isunixnotmac">
141    <and>
142      <os family="unix"/>
143      <not>
144  <os family="mac"/>
145      </not>
146    </and>
147  </condition>
148 
149  <condition property="current.os.ismac">
150    <os family="mac"/>
151  </condition>
152 
153  <condition property="current.os.iswindows">
154    <os family="windows"/>
155  </condition>
156
157  <condition property="collection.building.disabled">
158    <isset property="disable.collection.building"/>
159  </condition>
160
161  <condition property="collection.building.enabled">
162    <not>
163      <isset property="disable.collection.building"/>
164    </not>
165  </condition>
166 
167  <condition property="collection.building.enabled.windows">
168    <and>
169      <isset property="collection.building.enabled"/>
170      <isset property="current.os.iswindows"/>
171    </and>
172  </condition>
173 
174  <condition property="collection.building.enabled.unix">
175    <and>
176      <isset property="collection.building.enabled"/>
177      <isset property="current.os.isunix"/>
178    </and>
179  </condition>
180 
181  <!-- where is search4j tool -->
182  <condition property="search4j.exec" value="bin/search4j.exe">
183    <isset property="current.os.iswindows"/>
184  </condition>
185  <property name="search4j.exec" value="bin/search4j"/>
186
187 
188  <!-- ============= Base dirs for each package and component ============ -->
189  <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
190  <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
191  <property name="gli.home" value="${basedir}/gli"/>
192  <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
193 
194  <condition property="common.src.home" value="${gs2build.home}/common-src">
195    <not>
196      <isset property="disable.collection.building"/>
197    </not>
198  </condition>
199
200  <condition property="common.src.home" value="${basedir}/common-src">
201    <isset property="disable.collection.building"/>
202  </condition>
203
204  <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
205  <property name="mg.home" value="${common.src.home}/indexers/mg"/>
206  <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
207  <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
208
209  <!--  ==================== Compilation Control Options ==================== -->
210
211  <!--
212
213  These properties control option settings on the Javac compiler when it
214  is invoked using the <javac> task.
215
216  compile.debug        Should compilation include the debug option?
217
218  compile.deprecation  Should compilation include the deprecation option?
219
220  compile.optimize     Should compilation include the optimize option?
221
222  -->
223
224  <property name="compile.debug"       value="true"/>
225  <property name="compile.deprecation" value="true"/>
226  <property name="compile.optimize"    value="true"/>
227
228  <!--
229
230  Rather than relying on the CLASSPATH environment variable, Ant includes
231  features that makes it easy to dynamically construct the classpath you
232  need for each compilation.  The example below constructs the compile
233  classpath to include the servlet.jar file, as well as the other components
234  that Tomcat makes available to web applications automatically, plus anything
235  that you explicitly added.
236
237  -->
238
239  <path id="compile.classpath">
240    <!-- Include all jar files and libraries in our jni lib directory -->
241    <pathelement location="${lib.jni}"/>
242    <fileset dir="${lib.jni}">
243      <include name="*.jar"/>
244    </fileset>
245    <!-- Include all jar files in our web lib directory -->
246    <pathelement location="${web.lib}"/>
247    <fileset dir="${web.lib}">
248      <include name="*.jar"/>
249    </fileset>
250   
251    <pathelement location="${lib.java}"/>
252    <fileset dir="${lib.java}">
253      <include name="*.jar"/>
254    </fileset>
255   
256    <!-- include the jar files from the source packages -->
257    <!-- mg and mgpp get installed into lib/jni but they may not be there yet
258    so we add them in by name -->
259    <pathelement location="${lib.jni}/mg.jar"/>
260    <pathelement location="${lib.jni}/mgpp.jar"/>
261   
262    <!-- Include all elements that Tomcat exposes to applications -->
263    <pathelement location="${catalina.home}/common/classes"/>
264    <fileset dir="${catalina.home}/common/endorsed">
265      <include name="*.jar"/>
266    </fileset>
267    <fileset dir="${catalina.home}/common/lib">
268      <include name="*.jar"/>
269    </fileset>
270    <pathelement location="${catalina.home}/shared/classes"/>
271    <fileset dir="${catalina.home}/shared/lib">
272      <include name="*.jar"/>
273    </fileset>
274  </path>
275
276  <path id="local.tomcat.classpath">
277    <!-- explicitly include the jni java wrappers in the classpath -->
278    <pathelement location="${lib.jni}"/>
279    <fileset dir="${lib.jni}">
280      <include name="*.jar"/>
281    </fileset>
282  </path>
283 
284  <path id="local.tomcat.path">
285    <pathelement location="${basedir}/bin/script"/>
286    <pathelement location="${basedir}/bin"/>
287    <pathelement location="${lib.jni}"/>
288    <pathelement path="${env.PATH}"/>
289    <pathelement path="${env.Path}"/>
290    <pathelement path="${wn.home}/bin"/>
291  </path>
292
293  <target name="test-setup">
294    <echo>ant java version=${ant.java.version}</echo>
295    <echo>is unix : ${current.os.isunix}</echo>
296    <echo>is mac : ${current.os.ismac}</echo>
297    <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
298    <echo>is windows : ${current.os.iswindows}</echo>
299    <echo>os.unix: ${os.unix}</echo>
300  </target>
301
302
303  <!-- ==================== Primary and Global Targets ============================= -->
304
305  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
306    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this.">
307
308    <!-- make sure .sh files are executable -->
309    <chmod dir="${basedir}" perm="ugo+rx"
310      includes="*.sh"/>
311    <chmod dir="${basedir}/bin/script" perm="ugo+rx"
312      includes="*.sh,*.pl"/>
313  </target>
314
315  <!-- install-common-src and install-collection-building are mutually exclusive and either one or the other will be done depending on whether collection building is enabled or not -->
316  <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
317    description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
318
319  <target name="install-common-src" depends="init" if="collection.building.disabled"
320    description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2. This is only needed when not installing the collection building package." >
321    <antcall target="configure-common-src"/>
322    <antcall target="compile-common-src"/>
323    <antcall target="install-auxiliary-jar-files"/>
324    <antcall target="install-jni-files"/>
325  </target>
326
327  <target name="install-collection-building" depends="init" if="collection.building.enabled"
328    description="Install (configure, compile, install) the Greenstone 2 collection building package." >
329    <antcall target="configure-collection-building"/>
330    <antcall target="compile-collection-building"/>
331    <antcall target="install-auxiliary-jar-files"/>
332    <antcall target="install-jni-files"/>
333  </target>
334   
335
336  <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core"
337    description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
338   
339  <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
340    description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
341 
342  <target name="configure" depends="init,configure-tomcat,configure-web"
343    description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file."/>
344
345  <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building"
346    description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
347 
348  <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building"
349    description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
350 
351  <target name="update" depends="init,svnupdate,clean,install"
352    description="Update (thru Subversion) all the source (including common-src or collection-building, and runtime), then clean, and re-install. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
353
354  <target name="start" depends="init,start-tomcat"
355    description="Startup the Tomcat server." >
356    <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
357    <echo>Tomcat: ${catalina.home}</echo>
358    <echo>Java  : ${java.home}</echo>
359    <echo>URL   : http://${tomcat.server}:${tomcat.port}${app.path}/</echo>
360    <!-- assuming that index.html is not needed here -->   
361  </target>
362
363  <target name="stop" depends="init,stop-tomcat"
364    description="Shutdown the Tomcat server."/>
365 
366  <target name="restart" description="Shutdown and restart Tomcat"  depends="init,stop,start"/>
367
368
369  <!-- =========== Help targets ===================================  -->
370 
371  <property name="install-command" value="ant [options] prepare install"/>
372 
373  <target name="usage" description="Print a help message">
374    <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
375    <echo message="  Execute 'ant -help' for Ant help."/>
376    <echo>To install Greenstone3, run '${install-command}'.
377      There are properties defined in build.properties. The install process will ask you if these properties are set correctly. To avoid this prompt, use the '-Dproperties.accepted=yes' option.
378      To log the output, use the '-logfile build.log' option.
379      The README.txt file has more information about the ant targets and install process.
380    </echo>
381  </target>
382 
383  <target name="help" depends="usage" description="Print a help message"/>
384 
385  <target name="debug" depends="init" description="Display all the currently used properties">
386    <echoproperties/>
387  </target>
388
389  <!-- ====== initialization and setup targets ================== -->
390
391  <target name="accept-properties" unless="properties.accepted">
392    <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
393      tomcat.server=${tomcat.server}
394      tomcat.port=${tomcat.port}
395      tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
396      proxy.host=${proxy.host}
397      proxy.port=${proxy.port}
398      disable.collection.building=${disable.collection.building}
399      If these are not acceptable, please change them and rerun this target. Continue [y/n]?
400    </input>
401    <condition property="do.abort">
402      <equals arg1="n" arg2="${properties.ok}"/>
403    </condition>
404    <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
405  </target>
406
407
408  <!-- this sets up some initial properties -->
409  <target name="init">
410
411    <condition property="java.too.old">
412      <or>
413        <equals arg1="1.1" arg2="${ant.java.version}"/>
414        <equals arg1="1.2" arg2="${ant.java.version}"/>
415        <equals arg1="1.3" arg2="${ant.java.version}"/>
416      </or>
417    </condition>
418    <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
419   
420    <available file="${basedir}/gli" property="gli.present"/>
421    <available file="${basedir}/common-src" property="common.src.present"/>
422    <available file="${basedir}/gs2build" property="gs2build.present"/>
423
424    <condition property="tomcat.islocal">
425      <or>
426        <not><isset property="tomcat.installed.path"/></not>
427        <equals arg1="" arg2="${tomcat.installed.path}"/>
428      </or>
429    </condition>
430   
431    <echo>tomcat.port = ${tomcat.port}</echo>
432
433    <condition property="proxy.present">
434      <and>
435        <isset property="proxy.host"/>
436        <not><equals arg1="" arg2="${proxy.host}"/></not>
437      </and>
438    </condition>
439
440  </target>
441
442  <target name="setup-proxy" depends="init" if="proxy.present">
443    <condition property="ask.user">
444      <or>
445        <equals arg1="" arg2="${proxy.user}"/>
446        <equals arg1="" arg2="${proxy.password}"/>
447      </or>
448    </condition>
449   
450    <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
451    <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
452  </target>
453 
454  <!-- ========== Web app Targets ================================ -->
455 
456  <target name="prepare-web" depends="init,configure-java-version">
457    <mkdir dir="${web.home}/applet"/>
458    <mkdir dir="${web.home}/logs"/>
459  </target>
460 
461  <!-- if we are using java 1.5+, we need the xalan.jar file in web/WEB-INF/lib,  but if we are using java 1.4, we can't have it there -->
462  <target name="configure-java-version" depends="init"
463    description="Activates or deactivates some jar libraries as needed depending on your java version">
464
465    <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
466    <condition property="need.xalan.jar">
467      <or>
468        <equals arg1="1.5" arg2="${ant.java.version}"/>
469        <equals arg1="1.6" arg2="${ant.java.version}"/>
470      </or>
471    </condition>
472
473    <!-- if they have xalan.jar but dont need it -->
474    <if>
475      <bool>
476        <and>
477          <isset property="have.xalan.jar"/>
478          <not><isset property="need.xalan.jar"/></not>
479        </and>
480      </bool>
481      <antcall target="deactivate-xalan-jar"/>
482    </if>
483
484    <!-- if they need xalan.jar but dont have it -->
485    <if>
486      <bool>
487        <and>
488          <not><isset property="have.xalan.jar"/></not>
489          <isset property="need.xalan.jar"/>
490        </and>
491      </bool>
492      <antcall target="activate-xalan-jar"/>
493    </if>
494
495  </target>
496 
497  <target name="activate-xalan-jar">
498    <echo>activating xalan.jar</echo>
499    <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
500    <if><bool><isset property="current.os.ismac"/></bool>
501      <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
502    </if>
503  </target>
504
505  <!-- to delete -->
506  <target name="copy-xalan-for-mac"></target>
507
508  <target name="deactivate-xalan-jar">
509    <echo>deactivating xalan.jar</echo>
510    <delete file="${web.lib}/xalan.jar"/>
511  </target>
512
513
514  <target name="prepare-collections" depends="init">
515    <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
516    <property name="import.zip" value="import.zip"/>
517    <property name="metadata.zip" value="metadata.zip"/>
518    <property name="index.zip" value="index.zip"/>
519
520    <echo message="installing collections..."/>
521    <antcall target="gs2mgdemo-install"/>
522    <antcall target="gs2mgppdemo-install"/>
523    <antcall target="gberg-install"/>
524  </target>
525
526  <target name="gs2mgdemo-prepare" if="collect.dir">
527    <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
528
529    <condition property="gs2mgdemo.present">
530      <and>
531        <available file="${gs2mgdemo.dir}/${import.zip}"/>
532        <available file="${gs2mgdemo.dir}/${metadata.zip}"/>
533        <available file="${gs2mgdemo.dir}/${index.zip}"/>
534      </and>
535    </condition>
536  </target>
537
538  <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
539    <echo> installing gs2mgdemo</echo>
540    <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${import.zip}" />
541    <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${metadata.zip}" />
542    <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
543    <echo>collection gs2mgdemo installed</echo>
544  </target>
545
546  <target name="gs2mgppdemo-prepare" if="collect.dir">
547    <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
548 
549    <condition property="gs2mgppdemo.present">
550      <and>
551        <available file="${gs2mgppdemo.dir}/${import.zip}"/>
552        <available file="${gs2mgppdemo.dir}/${metadata.zip}"/>
553        <available file="${gs2mgppdemo.dir}/${index.zip}"/>
554      </and>
555    </condition>
556  </target>
557
558  <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
559    <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${import.zip}" />
560    <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${metadata.zip}" />
561    <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
562    <echo>collection gs2mgppdemo installed</echo>
563  </target>   
564
565  <target name="gberg-prepare" if="collect.dir">
566    <property name="gberg.dir" value="${collect.dir}/gberg"/>
567    <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
568  </target>
569
570  <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
571    <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
572    <echo>collection gberg installed</echo>
573  </target>
574
575  <target name="configure-web" depends="init"
576    description="Configure only the web app config files">
577    <!-- we want a unix path in the global.properties file -->
578    <pathconvert targetos="unix" property="src.gsdl3.home.unix">
579      <path path="${web.home}"/>
580    </pathconvert>
581    <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
582    <filter token="gsdl3version" value="${app.version}"/>
583    <filter token="tomcat.server" value="${tomcat.server}"/>
584    <filter token="tomcat.port" value="${tomcat.port}"/>
585    <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
586    <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
587    <chmod file="${web.classes}/global.properties" perm="600"/>
588    <chmod file="${web.classes}/log4j.properties" perm="600"/>
589  </target>
590
591  <target name="compile-web" depends="init">
592    <javac srcdir="${web.classes}"
593      destdir="${web.classes}"
594      debug="${compile.debug}"
595      deprecation="${compile.deprecation}"
596      optimize="${compile.optimize}">
597      <classpath><path refid="compile.classpath"/></classpath>
598    </javac>
599  </target>
600
601  <target name="svnupdate-web" unless="nosvn.mode">
602    <svn>
603      <update dir="${web.home}" revision="${branch.revision}"/>
604    </svn>
605  </target>
606
607  <target name="update-web" depends="init,svnupdate-web,configure-web"
608    description="update only the web stuff (config files)"/>
609
610  <!-- ======================= Tomcat Targets ========================== -->
611 
612  <!-- this target downloads and installs Tomcat -->
613  <!-- we download tomcat and the compat module - its needed for 1.4, and doesn't seem to harm 1.5 -->
614  <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
615
616    <if>
617      <bool>
618        <not><available file="${packages.home}/tomcat/.flagfile"/></not>
619      </bool>
620
621      <!-- check that packages dir is there -->
622      <mkdir dir="${packages.home}"/>
623      <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
624        dest="${packages.home}/${tomcat.version}.zip"
625        usetimestamp="true"/>
626      <unzip src="${packages.home}/${tomcat.version}.zip"
627        dest="${packages.home}"/>
628      <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
629        dest="${packages.home}/${tomcat.version}-compat.zip"
630        usetimestamp="true"/>
631      <unzip src="${packages.home}/${tomcat.version}-compat.zip"
632        dest="${packages.home}"/>
633      <!-- delete any existing tomcat -->
634      <delete dir="${packages.home}/tomcat"/>
635      <move todir="${packages.home}/tomcat">
636        <fileset dir="${packages.home}/${tomcat.version}"/>
637      </move>
638      <copy file="${basedir}/resources/tomcat/setclasspath.bat"
639        tofile="${packages.home}/tomcat/bin/setclasspath.bat"
640        overwrite="true"/>
641      <copy file="${basedir}/resources/tomcat/setclasspath.sh"
642        tofile="${packages.home}/tomcat/bin/setclasspath.sh"
643        overwrite="true"/>
644      <!-- make sure we have execute permission for the .sh files -->
645      <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
646        includes="*.sh"/>   
647
648      <echo file="${packages.home}/tomcat/.flagfile">
649        the timestamp of this file is the time that tomcat was extracted from the zip files.
650        it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
651      </echo>
652
653      <else>
654        <echo>Tomcat has been prepared, will not prepare</echo>
655        <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
656      </else>
657
658    </if>
659
660  </target>
661 
662  <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
663 
664  <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
665    <!-- re-setup the server.xml file -->
666    <copy file="${basedir}/resources/tomcat/server.xml" tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
667      <filterset>
668        <filter token="port" value="${tomcat.port}"/>
669        <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
670      </filterset>
671    </copy>
672    <!-- set up the greenstone3 context -->
673    <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
674      <filterset>
675        <filter token="gsdl3webhome" value="${web.home}"/>
676      </filterset>
677    </copy>
678  </target>
679
680  <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
681    <!-- re-setup the server.xml file -->
682    <!-- need to edit the config file, or do we get the user to do this???-->
683  </target>
684 
685  <target name="start-tomcat" description="Startup only Tomcat" depends="init,configure-java-version" if="tomcat.islocal">
686    <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
687    <property name="tomcat.path" refid="local.tomcat.path"/>
688    <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
689    <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
690      <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
691      <env key="GSDL3HOME" value="${basedir}"/>
692      <env key="PATH" path="${tomcat.path}"/>
693      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
694      <env key="CATALINA_HOME" value="${catalina.home}"/>
695      <env key="CLASSPATH" path="${tomcat.classpath}"/>
696      <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
697      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here??-->
698      <env key="WNHOME" path="${wn.home}"/>
699    </exec>
700    <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
701      <env key="GSDLOS" value="windows"/>
702      <env key="GSDL3HOME" value="${basedir}"/>
703      <env key="Path" path="${tomcat.path}"/>
704      <env key="PATH" path="${tomcat.path}"/>
705      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
706      <env key="CATALINA_HOME" value="${catalina.home}"/>
707      <env key="CLASSPATH" path="${tomcat.classpath}"/>
708    </exec>
709    <!-- wait for the server to startup in case other targets need it running -->
710    <waitfor maxwait="5" maxwaitunit="second">
711      <and>
712        <socket server="${tomcat.server}" port="${tomcat.port}"/>
713        <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
714      </and>
715    </waitfor>
716  </target>
717
718  <!-- windows: do we want to launch a webrowser?? -->
719  <!-- shouldn't this test whether anything is running first? -->
720  <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
721    <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
722      <env key="CATALINA_HOME" value="${catalina.home}"/>
723    </exec>
724    <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
725      <env key="CATALINA_HOME" value="${catalina.home}"/>
726    </exec>
727  </target>
728
729  <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
730
731  <target name="setup-catalina-ant-tasks">
732    <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
733    <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"
734      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
735    <taskdef name="list"      classname="org.apache.catalina.ant.ListTask"
736      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
737    <taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"
738      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
739    <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
740      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
741    <taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"
742      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
743    <taskdef name="start"     classname="org.apache.catalina.ant.StartTask"
744      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
745    <taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"
746      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
747    <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"
748      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
749  </target>
750
751
752  <!-- ======================= ant Targets ============================ -->
753  <target name="prepare-ant" depends="init">
754    <if>
755      <bool>
756        <not><available file="${packages.home}/ant/.flagfile"/></not>
757      </bool>
758
759      <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
760        dest="${packages.home}/apache-ant-1.7.0-bin.zip"
761        usetimestamp="true"/>
762      <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
763        dest="${packages.home}"/>
764      <move todir="${packages.home}/ant">
765        <fileset dir="${packages.home}/apache-ant-1.7.0"/>
766      </move>
767      <echo file="${packages.home}/ant/.flagfile">
768        the timestamp of this file is the time that ant was extracted from the zip files.
769        it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
770      </echo>
771
772      <else>
773        <echo>Ant has been prepared, will not prepare</echo>
774        <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
775      </else>
776
777    </if>
778  </target>
779
780  <!-- ======================= Axis Targets ============================ -->
781
782  <target name="prepare-axis" depends="init">
783
784    <if>
785      <bool>
786        <not><available file="${packages.home}/axis/.flagfile"/></not>
787      </bool>
788
789      <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
790        dest="${packages.home}/${axis.zip.version}"
791        usetimestamp="true"/>
792      <unzip src="${packages.home}/${axis.zip.version}"
793        dest="${packages.home}"/>
794      <move todir="${packages.home}/axis">
795        <fileset dir="${packages.home}/${axis.dir.version}"/>
796      </move>
797      <!-- install axis into greenstone web app -->
798      <copy todir="${web.lib}">
799        <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
800          <include name="*.jar"/>
801        </fileset>
802      </copy>
803      <copy todir="${web.home}">
804        <fileset dir="${packages.home}/axis/webapps/axis/">
805          <include name="*.jsp"/>
806          <include name="*.jws"/>
807        </fileset>
808      </copy>
809      <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
810      <copy todir="${web.classes}">
811        <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
812          <include name="*.properties"/>
813        </fileset>
814      </copy>
815      <echo file="${packages.home}/axis/.flagfile">
816        the timestamp of this file is the time that axis was extracted from the zip files.
817        it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
818      </echo>
819
820      <else>
821        <echo>Axis has been prepared, will not prepare</echo>
822        <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
823      </else>
824
825    </if>
826  </target>
827
828  <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
829    description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
830   
831    <target name="deploy-site">
832    <java classname="org.apache.axis.client.AdminClient">
833      <classpath refid="compile.classpath"/>
834      <arg value="-l"/>
835      <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
836      <arg file="${basedir}/resources/soap/deploy.wsdd"/>
837    </java>
838    <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
839  </target>
840 
841  <target name="soap-undeploy-site" depends="get-undeploy-service-name"
842    description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
843    <filter token="servicesname" value="${axis.undeploy.servicename}"/>
844    <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
845      tofile="${basedir}/resources/soap/undeploy.wsdd"
846      filtering="true"
847      overwrite="true"/>
848    <java classname="org.apache.axis.client.AdminClient">
849      <classpath refid="compile.classpath"/>
850      <arg value="-l"/>
851      <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
852      <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
853    </java>
854    <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
855  </target> 
856
857  <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
858  with the default servicename of localsite-->
859  <target name="deploy-localsite" depends="init"
860    description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
861    <antcall target="start-tomcat"/>
862    <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
863    <antcall target="create-deployment-files">
864      <param name="axis.sitename" value="localsite"/>
865      <param name="axis.servicesname" value="${base.webservice.name}"/>
866      <param name="axis.siteuri" value="localsite"/>
867    </antcall>
868    <antcall target="deploy-site">
869      <param name="axis.sitename" value="localsite"/>
870      <param name="axis.servicesname" value="${base.webservice.name}"/>
871      <param name="axis.siteuri" value="localsite"/>
872    </antcall>
873    <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
874  </target>
875   
876  <target name="get-sitename" unless="axis.sitename">
877    <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
878Press Enter for default:localsite</input>
879  </target>
880
881  <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
882    <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
883To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
884Or press Enter for undeploying the default:localsite /></input>
885     <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
886  </target>
887
888  <target name="get-webservices" unless="axis.servicesname">
889    <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
890Choose from: ${web.services.list}
891Or press Enter for default:${base.webservice.name} /></input>
892    <echo>${axis.servicesname}</echo>
893  </target>
894
895  <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
896    <input addproperty="axis.siteuri" defaultvalue="${axis.servicesname}${axis.sitename}">What name do you want the service to have? (Press Enter for default:${axis.servicesname}${axis.sitename})</input>
897    <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
898  </target>
899
900  <target name="set-soapmethod" description="Determines whether the service in the wsdd should have the style attribute set to message or the provider attribute set to java:RPC"  if="axis.servicesname">
901   <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
902      <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
903    </condition>
904   
905   <!--everything else defaults to java:RPC at present-->
906   <condition property="soap.method" value="provider='java:RPC'">
907     <not>
908      <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
909    </not>
910    </condition>
911  </target>
912   
913  <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
914    <filter token="sitename" value="${axis.sitename}"/>
915    <filter token="siteuri" value="${axis.siteuri}"/>
916    <filter token="servicesname" value="${axis.servicesname}"/>
917    <filter token="soapmethod" value="${soap.method}"/>
918    <copy file="${basedir}/resources/soap/site.wsdd.template"
919      tofile="${basedir}/resources/soap/deploy.wsdd"
920      filtering="true"
921      overwrite="true"/>
922    <!-- create the java files and compile them -->
923    <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
924      tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
925      filtering="true"
926      overwrite="true"/>
927    <mkdir dir="${build.home}"/>
928    <javac srcdir="${src.home}"
929      destdir="${build.home}"
930      debug="${compile.debug}"
931      deprecation="${compile.deprecation}"
932      optimize="${compile.optimize}">
933      <classpath refid="compile.classpath"/>
934      <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
935    </javac>
936    <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
937    <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
938      tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
939      overwrite="true" />
940  </target>
941 
942
943  <!-- ====================== Core targets ============================== -->
944  <!-- core targets refer to the core gsdl3 java src -->
945 
946  <target name="prepare-core"/>
947 
948  <target name="configure-core"/>
949
950  <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
951    description="Update only the Greenstone core" />
952 
953  <target name="svnupdate-core" unless="nosvn.mode">
954    <svn>
955      <update dir="." revision="${branch.revision}"/>
956    </svn>
957  </target>
958
959  <target name="clean-core"
960    description="Clean only the Greenstone core">
961    <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
962    <delete dir="${build.home}"/>
963  </target>
964
965  <target name="compile-core" depends="init"
966    description="Compile only the Greenstone core">
967    <mkdir dir="${build.home}"/>
968    <javac srcdir="${src.home}"
969      destdir="${build.home}"
970      debug="${compile.debug}"
971      deprecation="${compile.deprecation}"
972      optimize="${compile.optimize}">
973      <classpath>
974        <path refid="compile.classpath"/>
975      </classpath>
976    </javac>
977    <jar destfile="${build.home}/gsdl3.jar">
978      <fileset dir="${build.home}">
979        <include name="org/greenstone/gsdl3/**"/>
980        <include name="org/flax/**"/>
981        <exclude name="**/Test.class"/>
982      </fileset>
983      <manifest>
984        <attribute name="Built-By" value="${user.name}" />
985      </manifest>
986    </jar>
987    <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
988    <!-- copy the localsite server in case we need it -->
989    <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
990
991    <!-- Greenstone Administrator Interface -->
992    <jar destfile="${build.home}/GAI.jar">
993      <fileset dir="${build.home}">
994        <include name="org/greenstone/admin/**"/>
995      </fileset>
996      <manifest>
997        <attribute name="Built-By" value="${user.name}" />
998      </manifest>
999    </jar>
1000    <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
1001    <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
1002    <jar destfile="${build.home}/phind.jar">
1003      <fileset dir="${build.home}">
1004        <include name="org/greenstone/applet/phind/**"/>
1005      </fileset>
1006      <manifest>
1007        <attribute name="Built-By" value="${user.name}" />
1008      </manifest>
1009    </jar>
1010    <mkdir dir="${web.applet}"/>
1011    <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1012    <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
1013    <if>
1014      <bool><istrue value="${tomcat.islocal}"/></bool>
1015      <copy file="${packages.home}/tomcat/common/endorsed/xercesImpl.jar" todir="${web.applet}"/>
1016      <copy file="${packages.home}/tomcat/common/endorsed/xml-apis.jar" todir="${web.applet}"/>
1017    </if>
1018
1019
1020    <!-- skip anttasks for now
1021    <jar destfile="${build.home}/anttasks.jar">
1022      <fileset dir="${build.home}">
1023        <include name="org/greenstone/anttasks/**"/>
1024      </fileset>
1025      <manifest>
1026        <attribute name="Built-By" value="${user.name}" />
1027      </manifest>
1028    </jar>
1029    <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
1030    <jar destfile="${build.home}/gsdl3test.jar">
1031      <fileset dir="${build.home}">
1032        <include name="org/greenstone/gsdl3/**/*Test.class"/>
1033        <include name="org/greenstone/testing/**"/>
1034      </fileset>
1035      <manifest>
1036        <attribute name="Built-By" value="${user.name}" />
1037      </manifest>
1038    </jar>
1039    <jar destfile="${build.home}/server.jar">
1040      <fileset dir="${build.home}">
1041        <include name="org/greenstone/server/**"/>
1042      </fileset>
1043      <fileset file="${basedir}/resources/java/server.properties"/>
1044      <manifest>
1045        <attribute name="Built-By" value="${user.name}"/>
1046      </manifest>
1047    </jar>
1048    <copy file="${build.home}/server.jar" todir="${basedir}"/>
1049  </target>
1050 
1051  <!-- ================== Packages targets ================================ -->
1052  <!-- these targets refer to the greenstone source packages - these need
1053  updating less often, so are in  separate targets to the core -->
1054  <target name="prepare-packages" depends="init"/>
1055 
1056  <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
1057    description="Update only the source packages"/>
1058
1059  <target name="svnupdate-packages" unless="nosvn.mode">
1060    <svn>
1061      <update dir="${src.packages.home}" revision="${branch.revision}"/>
1062    </svn>
1063  </target>
1064 
1065  <target name="configure-packages" depends="init,configure-javagdbm"
1066    description="Configure only the packages."/>
1067 
1068  <target name="configure-javagdbm">
1069    <echo>
1070      Configuring JavaGDBM
1071    </echo>
1072   
1073    <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1074      <arg value="--prefix=${basedir}"/>
1075      <arg value="--libdir=${lib.jni}"/>
1076      <arg value="--with-gdbm=${gdbm.home}"/>
1077    </exec>   
1078  </target>
1079
1080  <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
1081
1082  <target name="clean-javagdbm" depends="init">
1083    <exec executable="make" os="${os.unix}"
1084      dir="${javagdbm.home}" failonerror="true">
1085      <arg value="clean"/>
1086    </exec>
1087  </target>
1088 
1089  <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
1090
1091  <target name="distclean-javagdbm" depends="init">
1092    <exec executable="make" os="${os.unix}"
1093      dir="${javagdbm.home}" failonerror="true">
1094      <arg value="distclean"/>
1095    </exec>
1096  </target>
1097 
1098  <target name="compile-packages" description="Compile only the source packages">
1099   
1100    <!-- unix: -->
1101    <echo>compile javagdbm</echo>
1102    <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
1103    <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1104      <arg value="install"/>
1105    </exec>
1106
1107    <!-- windows: just the java stuff. -->
1108    <echo>Windows: compile javagdbm (java only)</echo>
1109    <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
1110      <arg value="compile"/>
1111      <arg value="javaonly"/>
1112    </exec>
1113
1114    <!-- install the jar file -->
1115    <echo>Install the javagdbm jar file</echo>
1116    <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1117
1118
1119    <!-- Search4j -->
1120    <antcall target="compile-search4j"/>
1121  </target>
1122
1123  <target name="compile-search4j">
1124
1125  <!-- windows -->
1126    <exec executable="${src.packages.home}/search4j/compile.bat" os="${os.windows}" dir="${src.packages.home}/search4j" failonerror="true"/>
1127
1128  <!-- unix -->
1129    <exec executable="${src.packages.home}/search4j/configure" os="${os.unix}" dir="${src.packages.home}/search4j" failonerror="true"><arg line="--bindir=${basedir}/bin"/></exec>
1130    <exec executable="make" os="${os.unix}" dir="${src.packages.home}/search4j" failonerror="true"/>
1131
1132  <!-- install -->
1133    <copy todir="bin"><fileset dir="${src.packages.home}/search4j" includes="search4j,search4j.exe"/></copy>
1134    <if><bool><istrue value="${current.os.isunix}"/></bool>
1135      <chmod perm="+x" file="bin/search4j"/>
1136    </if>
1137
1138  </target>
1139
1140  <target name="install-auxiliary-jar-files" depends="init">
1141    <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1142    <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1143    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>   
1144  </target>
1145 
1146  <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/>
1147
1148  <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
1149    <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1150    <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
1151    <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
1152    <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1153    <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
1154    <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1155  </target>
1156  <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
1157    <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1158    <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
1159    <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
1160    <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1161    <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
1162    <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1163  </target>
1164  <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
1165    <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1166    <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
1167    <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
1168    <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1169    <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
1170    <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1171  </target>
1172 
1173  <!-- ========common-src targets =================================-->
1174  <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
1175  collection building is not enabled -->
1176
1177  <target name="update-common-src" depends="init" if="collection.building.disabled">
1178  </target>
1179  <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1180    <svn>
1181      <update dir="${common.src.home}" revision="${branch.revision}"/>
1182    </svn>   
1183  </target>
1184
1185  <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
1186    <antcall target="checkout-common-src"/>
1187    <antcall target="unzip-windows-packages"/>
1188  </target>
1189
1190  <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1191    <echo>checking out common-src</echo>
1192    <svn>
1193      <checkout url="${svn.root}/gsdl/trunk/common-src" destPath="common-src" revision="${branch.revision}"/>
1194    </svn>
1195  </target>
1196   
1197  <target name="configure-common-src" depends="init" if="collection.building.disabled">
1198    <exec executable="${common.src.home}/configure" os="${os.unix}"
1199      dir="${common.src.home}" failonerror="true">
1200      <arg value="--prefix=${common.src.home}"/> <!-- what value to use?? -->
1201    </exec>
1202  </target>
1203
1204  <target name="clean-common-src" depends="init" if="collection.building.disabled">
1205    <!-- unix:  -->
1206    <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1207      <arg value="clean"/>
1208    </exec>
1209    <!-- windows: -->   
1210    <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1211      <arg value="/f"/>
1212      <arg value="win32.mak"/>
1213      <arg value="clean"/>
1214    </exec>
1215  </target>
1216  <target name="distclean-common-src" depends="init" if="collection.building.disabled">
1217    <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1218      <arg value="distclean"/>
1219    </exec>
1220  </target>
1221  <target name="compile-common-src" depends="init" if="collection.building.disabled">
1222    <!-- unix: -->
1223    <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1224    </exec>
1225    <!-- windows: -->
1226    <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1227      <arg value="/f"/>
1228      <arg value="win32.mak"/>
1229    </exec>
1230  </target>
1231 
1232  <!-- ======= collection-building targets ===========================-->
1233
1234  <target name="update-collection-building" if="collection.building.enabled"
1235    depends="init,svnupdate-collection-building,gs2build-edit-setup-bat,configure-collection-building,clean-collection-building,compile-collection-building"
1236    description="Update (SVN update, configure, compile etc) only the collection building components"/>
1237
1238  <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
1239    description="SVN update the collection building components">
1240  </target>
1241
1242  <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
1243  </target>
1244
1245  <target name="configure-collection-building" depends="init" if="collection.building.enabled"
1246    description="Configure only the collection building components">
1247    <exec executable="${gs2build.home}/configure" os="${os.unix}"
1248      dir="${gs2build.home}" failonerror="true">
1249      <arg value="--prefix=${gs2build.home}"/>
1250    </exec>
1251  </target>
1252
1253  <target name="clean-collection-building" depends="init,clean-gli,clean-gs2build"
1254    description="Clean only the collection building components"
1255    if="collection.building.enabled"/>
1256
1257  <target name="distclean-collection-building" depends="init,clean-gli,clean-gs2build,distclean-gs2build"
1258    description="Distclean only the collection building components"
1259    if="collection.building.enabled"/>
1260
1261  <target name="compile-collection-building" depends="init,compile-gs2build,compile-gli" if="collection.building.enabled"
1262    description="Compile only the collection building components">
1263  </target>
1264
1265  <!-- ============== gli targets ================================= -->
1266
1267  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1268    <svn>
1269      <update dir="${gli.home}" revision="${branch.revision}"/>
1270    </svn>
1271  </target>
1272
1273  <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
1274    <!-- checkout -->
1275    <if><bool><not><istrue value="${nosvn.mode}"/></not></bool>
1276      <svn>
1277        <checkout url="${svn.root}/gli/${branch.path}" destPath="gli" revision="${branch.revision}"/>
1278      </svn>
1279    </if>
1280  </target>
1281 
1282  <target name="clean-gli" depends="init" if="collection.building.enabled">
1283    <!-- gli -->
1284    <property name="gli.home" value="${basedir}/gli"/>
1285    <!-- linux -->
1286    <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1287      resolveExecutable="true"/>
1288    <!-- windows -->
1289    <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1290      resolveExecutable="true"/>
1291  </target>
1292 
1293  <target name="compile-gli" depends="init" if="collection.building.enabled">
1294    <!-- gli -->
1295    <property name="gli.home" value="${basedir}/gli"/>
1296
1297    <!-- linux -->
1298    <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true"/>
1299    <!--remote gli-->
1300    <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
1301      resolveExecutable="true"/>
1302    <!-- windows -->
1303    <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true"/>
1304    <!--remote gli-->
1305    <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
1306      resolveExecutable="true"/>
1307    <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
1308  </target>
1309
1310  <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
1311    <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1312      <env key="gsdl3path" path="${basedir}"/>
1313      <env key="gsdlpath" path="${gs2build.home}"/>
1314    </exec>
1315    <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1316      <env key="gsdl3path" path="${basedir}"/>
1317      <env key="gsdlpath" path="${gs2build.home}"/>
1318      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
1319    </exec>
1320    <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1321      <env key="GSDL3PATH" path="${basedir}"/>
1322      <env key="GSDLPATH" path="${gs2build.home}"/>
1323    </exec>
1324    <echo>Running GLI from Ant means that you don't get to see any of the terminal output. If you have problems with GLI and want to see the output, please run the script gli.sh/bat from the greenstone3/gli directory.
1325    </echo>
1326  </target>
1327
1328  <!-- ================ gs2build targets =========================== -->
1329
1330  <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1331    <echo>svn updating gs2build</echo>
1332    <svn>
1333      <update dir="{gs2build.home}" revision="${branch.revision}"/>
1334    </svn>
1335  </target>
1336   
1337  <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
1338    <antcall target="checkout-gs2build"/>
1339    <antcall target="unzip-windows-packages"/>
1340    <antcall target="checkout-winbin"/>
1341    <antcall target="get-windows-binaries"/>
1342    <antcall target="delete-winbin"/>
1343  </target>
1344
1345  <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
1346    <echo>checking out gs2build</echo>
1347    <svn>
1348      <checkout url="${svn.root}/gs2build" destPath="gs2build" revision="${branch.revision}"/>
1349    </svn>
1350  </target>
1351
1352  <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1353    unless="nosvn.mode">
1354    <svn>
1355      <checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin" revision="${branch.revision}"/>
1356    </svn>
1357  </target>
1358
1359  <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
1360    <svn>
1361      <update dir="winbin" revision="${branch.revision}"/>
1362    </svn>
1363  </target>
1364 
1365  <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
1366    <move todir="${gs2build.home}/bin/windows" failonerror="false">
1367      <fileset dir="${basedir}/winbin/bin"/>
1368    </move>
1369  </target>
1370
1371  <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
1372    <delete dir="${basedir}/winbin"/>
1373  </target>
1374 
1375  <target name="unzip-windows-packages" depends="init" if="current.os.iswindows"> 
1376    <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
1377      dest="${common.src.home}/packages/windows/crypt"/>
1378    <unzip src="${common.src.home}/packages/windows/expat/expat.zip"
1379      dest="${common.src.home}/packages/windows/expat"/>
1380    <untar compression="gzip"
1381      src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
1382      dest="${common.src.home}/packages/sqlite"/>
1383    <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
1384      dest="${common.src.home}/indexers/packages/windows/iconv"/>
1385  </target>
1386   
1387  <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
1388    <!-- we want a windows path in the setup.bat file -->
1389    <pathconvert targetos="windows" property="gs2build.home.windows">
1390      <path path="${gs2build.home}"/>
1391    </pathconvert>
1392    <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
1393      <filterset>
1394        <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1395      </filterset>
1396    </move> 
1397    <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
1398  </target>
1399 
1400 
1401  <target name="clean-gs2build" depends="init" if="collection.building.enabled">
1402    <!-- unix:  -->
1403    <exec executable="make" os="${os.unix}" dir="${gs2build.home}" failonerror="true">
1404      <arg value="clean"/>
1405    </exec>
1406    <!-- windows: -->   
1407    <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}" failonerror="true">
1408      <arg value="/f"/>
1409      <arg value="win32.mak"/>
1410      <arg value="clean"/>
1411    </exec>
1412  </target>
1413 
1414
1415  <target name="distclean-gs2build" depends="init,clean-gs2build" if="collection.building.enabled">
1416    <exec executable="make" os="${os.unix}" dir="${gs2build.home}" failonerror="true">
1417      <arg value="distclean"/>
1418    </exec>
1419  </target>
1420 
1421  <target name="compile-gs2build" depends="init" if="collection.building.enabled">
1422
1423    <!-- unix: make, make install -->
1424    <if>
1425      <bool><istrue value="${current.os.isunix}"/></bool>
1426
1427      <!-- WORKAROUND: make common-src and reconfigure -->
1428      <!-- this is a workaround to a problem with the gsdl build code -->
1429      <!-- expat needs to be compiled before the perl XML Parser is configured -->
1430      <exec executable="make" dir="${gs2build.home}/common-src" failonerror="true"/>
1431      <antcall target="configure-collection-building"/>
1432      <!-- /WORKAROUND -->
1433
1434      <exec executable="make" dir="${gs2build.home}" failonerror="true"/>
1435      <exec executable="make" dir="${gs2build.home}" failonerror="true">
1436        <arg value="install"/>
1437      </exec>
1438
1439    <!-- windows: nmake, nmake install -->
1440    <else><if>
1441      <bool><istrue value="${current.os.isunix}"/></bool>
1442      <!-- run the setup script -->
1443      <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}"/>-->
1444      <!--Above does not work: even though vcvars.bat executes, the env changes it makes don't get saved. Need user to run vcvars.bat first before calling ant-->
1445      <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}" failonerror="true">
1446        <arg value="/f"/>
1447        <arg value="win32.mak"/>
1448      </exec>
1449      <exec executable="nmake" dir="${gs2build.home}" failonerror="true">
1450        <arg value="/f"/>
1451        <arg value="win32.mak"/>
1452        <arg value="install"/>
1453      </exec>
1454
1455      <!-- install gs2build indexers -->
1456      <copy todir="${gs2build.home}/bin/windows">
1457        <fileset dir="${gs2build.home}/common-src/indexers/bin">
1458          <include name="*.*"/>
1459        </fileset>
1460      </copy>
1461
1462    </if></else></if>
1463
1464    <!-- LuceneWrapper jar file not installed by default -->
1465    <mkdir dir="${gs2build.home}/bin/java"/>
1466    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
1467
1468  </target>
1469 
1470
1471  <!-- ======================== TESTING Targets ========================= -->
1472 
1473  <target name="test" description="Run the (incomplete) JUnit test suite "
1474    depends="init">
1475    <mkdir dir="${basedir}/test"/>
1476    <junit printsummary="withOutAndErr"
1477      errorproperty="test.failed"
1478      failureproperty="test.failed"
1479      fork="${junit.fork}">
1480      <formatter type="plain"/>
1481      <classpath>
1482        <pathelement location="${build.home}/gsdl3test.jar"/>
1483        <path refid="compile.classpath"/>
1484      </classpath>
1485      <test name="${testcase}" if="testcase"/>
1486      <batchtest todir="${basedir}/test" unless="testcase">
1487        <fileset dir="${build.home}" includes="**/*Test.class" />
1488      </batchtest>
1489    </junit>
1490    <echo>
1491      *********************************************
1492      Test output can be found in directory 'test'
1493      *********************************************
1494    </echo>
1495  </target>
1496
1497  <!-- ======================== FLAX Targets ========================= -->
1498  <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
1499    <echo>checking out flax ...</echo>
1500    <mkdir dir="${basedir}/src/java/org/flax"/>
1501    <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1502    <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
1503    <mkdir dir="${web.home}/interfaces/flax"/>
1504    <mkdir dir="${web.home}/sites/flax"/>
1505    <mkdir dir="${basedir}/flax-resources"/>
1506    <mkdir dir="${basedir}/flax-lib"/>
1507    <svn>
1508      <checkout url="${flax.checkout.path}/src/java/org/flax/" 
1509        destPath="${basedir}/src/java/org/flax"/>
1510      <checkout url="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax/"
1511        destPath="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1512      <checkout url="${flax.checkout.path}/web/WEB-INF/classes/flax/"
1513        destPath="${web.home}/WEB-INF/classes/flax"/>
1514      <checkout url="${flax.checkout.path}/web/interfaces/flax/"
1515        destPath="${web.home}/interfaces/flax"/>
1516      <checkout url="${flax.checkout.path}/web/sites/flax/"
1517        destPath="${web.home}/sites/flax"/>
1518      <checkout url="${flax.checkout.path}/flax-resources"
1519        destPath="${basedir}/flax-resources"/>
1520      <checkout url="${flax.checkout.path}/lib"
1521        destPath="${basedir}/flax-lib"/>
1522    </svn>
1523    <echo>prepare flax files...</echo>
1524    <move file="${web.home}/WEB-INF/web.xml" tofile="${web.home}/WEB-INF/web.xml.greenstone3backup"/>
1525    <antcall target="flax-copy-files" />
1526    <antcall target="unzip-flax-resources" />
1527  </target>
1528
1529  <target name="update-flax" description="update flax from repository">
1530    <echo>updating flax ...</echo>
1531    <svn>
1532      <update dir="${basedir}/src/java/org/flax"/>
1533      <update dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1534      <update dir="${web.home}/WEB-INF/classes/flax"/>
1535      <update dir="${web.home}/interfaces/flax"/>
1536      <update dir="${web.home}/sites/flax"/>
1537    </svn>
1538    <antcall target="flax-copy-files" />
1539  </target>
1540
1541  <target name="unzip-flax-resources" >
1542    <property name="classes.dir" value="${web.home}/WEB-INF/classes/flax"/>
1543    <unzip dest="${classes.dir}"> 
1544      <fileset dir="${classes.dir}">
1545        <include name="*.zip"/>
1546      </fileset>   
1547    </unzip>   
1548    <delete>
1549      <fileset dir="${classes.dir}" includes="*.zip"/>
1550    </delete>
1551  </target>
1552 
1553  <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
1554    <echo>copying flax files ...</echo>
1555    <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
1556    <!-- A configuration file containing web service binding information for the axis engine -->
1557    <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
1558    <copy file="${basedir}/flax-resources/flax-build.xml" todir="${basedir}" overwrite="true" />
1559    <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" />   
1560  </target>
1561
1562
1563
1564
1565  <target name="compile-javadocs">
1566    <javadoc packagenames="org.greenstone.*"
1567           sourcepath="src/java"
1568           defaultexcludes="yes"
1569           destdir="docs/javadoc"
1570           author="true"
1571           version="true"
1572           use="true"
1573           windowtitle="Greenstone3 API">
1574    <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
1575    </javadoc>
1576  </target>
1577
1578  <target name="dist-tidy"
1579    description="'tidies-up' a greenstone3 installation for distribution.">
1580
1581    <!-- delete unneeded things -->
1582    <delete dir="${gs2build.home}/gs2build-extra"/>
1583    <delete dir="${packages.home}/axis"/>
1584    <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
1585    <delete file="README-SVN.txt"/>
1586    <delete file="${gli.home}/gems.sh"/>
1587
1588    <!-- delete some source files -->
1589    <delete dir="${gs2build.home}/source/src"/>
1590    <delete dir="${gs2build.home}/source/lib"/>
1591    <delete dir="${gs2build.home}/source/packages"/>
1592    <delete dir="${gs2build.home}/source/indexers"/>
1593
1594    <delete dir="${basedir}/build"/>
1595    <delete dir="${basedir}/lib/jni"/>
1596    <delete dir="${basedir}/winutil"/>
1597    <delete dir="${basedir}/dist-resources"/>
1598    <delete dir="${basedir}/gs2build/source"/>
1599
1600    <delete file="${basedir}/gs2build/WIN32cfg.h"/>
1601    <delete file="${basedir}/gs2build/win32.mak"/>
1602
1603    <!-- create empty directories -->
1604    <mkdir dir="${web.home}/applet"/>
1605    <mkdir dir="${web.home}/logs"/>
1606
1607    <!-- os specific tidy-ups -->
1608    <if>
1609      <bool><istrue value="${current.os.isunix}"/></bool>
1610      <delete><fileset dir="." includes="*.bat"/></delete>
1611      <delete><fileset dir="gli" includes="*.bat"/></delete>
1612      <delete><fileset dir="gs2build" includes="*.bat"/></delete>
1613      <delete><fileset dir="bin/script" includes="*.bat"/></delete>
1614      <delete dir="winutil"/>
1615      <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
1616    </if>
1617
1618  </target>
1619
1620
1621</project>
Note: See TracBrowser for help on using the browser.