source: greenstone3/trunk/build.xml@ 20034

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

demo colls no longer have import.zip or metadata.zip so removing all references to them

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