source: greenstone3/trunk/build.xml@ 19931

Last change on this file since 19931 was 19931, checked in by kjdon, 15 years ago

working on configure and compile common-src always, then configure and compile build-src if necessary. don't want the workaround of reconfiguring build-src after compiling comon-src

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