source: greenstone3/trunk/build.xml@ 19972

Last change on this file since 19972 was 19972, checked in by oranfry, 15 years ago

make use of the definitive source code fileset, and split remove-source into it's own target

File size: 70.3 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/source-fileset.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="import.zip" value="import.zip"/>
546 <property name="metadata.zip" value="metadata.zip"/>
547 <property name="index.zip" value="index.zip"/>
548
549 <echo message="installing collections..."/>
550 <antcall target="gs2mgdemo-install"/>
551 <antcall target="gs2mgppdemo-install"/>
552 <antcall target="gberg-install"/>
553 </target>
554
555 <target name="gs2mgdemo-prepare" if="collect.dir">
556 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
557
558 <condition property="gs2mgdemo.present">
559 <and>
560 <available file="${gs2mgdemo.dir}/${import.zip}"/>
561 <available file="${gs2mgdemo.dir}/${metadata.zip}"/>
562 <available file="${gs2mgdemo.dir}/${index.zip}"/>
563 </and>
564 </condition>
565 </target>
566
567 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
568 <echo> installing gs2mgdemo</echo>
569 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${import.zip}" />
570 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${metadata.zip}" />
571 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
572 <echo>collection gs2mgdemo installed</echo>
573 </target>
574
575 <target name="gs2mgppdemo-prepare" if="collect.dir">
576 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
577
578 <condition property="gs2mgppdemo.present">
579 <and>
580 <available file="${gs2mgppdemo.dir}/${import.zip}"/>
581 <available file="${gs2mgppdemo.dir}/${metadata.zip}"/>
582 <available file="${gs2mgppdemo.dir}/${index.zip}"/>
583 </and>
584 </condition>
585 </target>
586
587 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
588 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${import.zip}" />
589 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${metadata.zip}" />
590 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
591 <echo>collection gs2mgppdemo installed</echo>
592 </target>
593
594 <target name="gberg-prepare" if="collect.dir">
595 <property name="gberg.dir" value="${collect.dir}/gberg"/>
596 <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
597 </target>
598
599 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
600 <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
601 <echo>collection gberg installed</echo>
602 </target>
603
604 <target name="configure-web" depends="init"
605 description="Configure only the web app config files">
606 <!-- we want a unix path in the global.properties file -->
607 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
608 <path path="${web.home}"/>
609 </pathconvert>
610 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
611 <filter token="gsdl3version" value="${app.version}"/>
612 <filter token="tomcat.server" value="${tomcat.server}"/>
613 <filter token="tomcat.port" value="${tomcat.port}"/>
614 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
615 <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
616 <chmod file="${web.classes}/global.properties" perm="600"/>
617 <chmod file="${web.classes}/log4j.properties" perm="600"/>
618 </target>
619
620 <target name="compile-web" depends="init">
621 <javac srcdir="${web.classes}"
622 destdir="${web.classes}"
623 debug="${compile.debug}"
624 deprecation="${compile.deprecation}"
625 optimize="${compile.optimize}">
626 <classpath><path refid="compile.classpath"/></classpath>
627 </javac>
628 </target>
629
630 <target name="svnupdate-web" unless="nosvn.mode">
631 <svn>
632 <update dir="${web.home}" revision="${branch.revision}"/>
633 </svn>
634 </target>
635
636 <target name="update-web" depends="init,svnupdate-web,configure-web"
637 description="update only the web stuff (config files)"/>
638
639 <!-- ======================= Tomcat Targets ========================== -->
640
641 <!-- this target downloads and installs Tomcat -->
642 <!-- we download tomcat and the compat module - its needed for 1.4, and doesn't seem to harm 1.5 -->
643 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
644
645 <if>
646 <bool>
647 <not><available file="${packages.home}/tomcat/.flagfile"/></not>
648 </bool>
649
650 <!-- check that packages dir is there -->
651 <mkdir dir="${packages.home}"/>
652 <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
653 dest="${packages.home}/${tomcat.version}.zip"
654 usetimestamp="true"/>
655 <unzip src="${packages.home}/${tomcat.version}.zip"
656 dest="${packages.home}"/>
657 <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
658 dest="${packages.home}/${tomcat.version}-compat.zip"
659 usetimestamp="true"/>
660 <unzip src="${packages.home}/${tomcat.version}-compat.zip"
661 dest="${packages.home}"/>
662 <!-- delete any existing tomcat -->
663 <delete dir="${packages.home}/tomcat"/>
664 <move todir="${packages.home}/tomcat">
665 <fileset dir="${packages.home}/${tomcat.version}"/>
666 </move>
667 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
668 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
669 overwrite="true"/>
670 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
671 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
672 overwrite="true"/>
673 <!-- make sure we have execute permission for the .sh files -->
674 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
675 includes="*.sh"/>
676
677 <echo file="${packages.home}/tomcat/.flagfile">
678 the timestamp of this file is the time that tomcat was extracted from the zip files.
679 it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
680 </echo>
681
682 <else>
683 <echo>Tomcat has been prepared, will not prepare</echo>
684 <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
685 </else>
686
687 </if>
688
689 </target>
690
691 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
692
693 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
694 <!-- re-setup the server.xml file -->
695 <copy file="${basedir}/resources/tomcat/server.xml" tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
696 <filterset>
697 <filter token="port" value="${tomcat.port}"/>
698 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
699 </filterset>
700 </copy>
701 <!-- set up the greenstone3 context -->
702 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
703 <filterset>
704 <filter token="gsdl3webhome" value="${web.home}"/>
705 </filterset>
706 </copy>
707 </target>
708
709 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
710 <!-- re-setup the server.xml file -->
711 <!-- need to edit the config file, or do we get the user to do this???-->
712 </target>
713
714 <target name="start-tomcat" description="Startup only Tomcat" depends="init,configure-java-version" if="tomcat.islocal">
715 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
716 <property name="tomcat.path" refid="local.tomcat.path"/>
717 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
718 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
719 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
720 <env key="GSDL3HOME" value="${basedir}"/>
721 <env key="PATH" path="${tomcat.path}"/>
722 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
723 <env key="CATALINA_HOME" value="${catalina.home}"/>
724 <env key="CLASSPATH" path="${tomcat.classpath}"/>
725 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
726 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here??-->
727 <env key="WNHOME" path="${wn.home}"/>
728 </exec>
729 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
730 <env key="GSDLOS" value="windows"/>
731 <env key="GSDL3HOME" value="${basedir}"/>
732 <env key="Path" path="${tomcat.path}"/>
733 <env key="PATH" path="${tomcat.path}"/>
734 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
735 <env key="CATALINA_HOME" value="${catalina.home}"/>
736 <env key="CLASSPATH" path="${tomcat.classpath}"/>
737 </exec>
738 <!-- wait for the server to startup in case other targets need it running -->
739 <waitfor maxwait="5" maxwaitunit="second">
740 <and>
741 <socket server="${tomcat.server}" port="${tomcat.port}"/>
742 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
743 </and>
744 </waitfor>
745 </target>
746
747 <!-- windows: do we want to launch a webrowser?? -->
748 <!-- shouldn't this test whether anything is running first? -->
749 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
750 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
751 <env key="CATALINA_HOME" value="${catalina.home}"/>
752 </exec>
753 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
754 <env key="CATALINA_HOME" value="${catalina.home}"/>
755 </exec>
756 </target>
757
758 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
759
760 <target name="setup-catalina-ant-tasks">
761 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
762 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
763 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
764 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
765 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
766 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
767 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
768 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
769 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
770 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
771 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
772 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
773 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
774 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
775 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
776 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
777 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
778 </target>
779
780
781 <!-- ======================= ant Targets ============================ -->
782 <target name="prepare-ant" depends="init">
783 <if>
784 <bool>
785 <not><available file="${packages.home}/ant/.flagfile"/></not>
786 </bool>
787
788 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
789 dest="${packages.home}/apache-ant-1.7.0-bin.zip"
790 usetimestamp="true"/>
791 <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
792 dest="${packages.home}"/>
793 <move todir="${packages.home}/ant">
794 <fileset dir="${packages.home}/apache-ant-1.7.0"/>
795 </move>
796 <echo file="${packages.home}/ant/.flagfile">
797 the timestamp of this file is the time that ant was extracted from the zip files.
798 it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
799 </echo>
800
801 <else>
802 <echo>Ant has been prepared, will not prepare</echo>
803 <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
804 </else>
805
806 </if>
807 </target>
808
809 <!-- ======================= Axis Targets ============================ -->
810
811 <target name="prepare-axis" depends="init">
812
813 <if>
814 <bool>
815 <not><available file="${packages.home}/axis/.flagfile"/></not>
816 </bool>
817
818 <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
819 dest="${packages.home}/${axis.zip.version}"
820 usetimestamp="true"/>
821 <unzip src="${packages.home}/${axis.zip.version}"
822 dest="${packages.home}"/>
823 <move todir="${packages.home}/axis">
824 <fileset dir="${packages.home}/${axis.dir.version}"/>
825 </move>
826 <!-- install axis into greenstone web app -->
827 <copy todir="${web.lib}">
828 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
829 <include name="*.jar"/>
830 </fileset>
831 </copy>
832 <copy todir="${web.home}">
833 <fileset dir="${packages.home}/axis/webapps/axis/">
834 <include name="*.jsp"/>
835 <include name="*.jws"/>
836 </fileset>
837 </copy>
838 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
839 <copy todir="${web.classes}">
840 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
841 <include name="*.properties"/>
842 </fileset>
843 </copy>
844 <echo file="${packages.home}/axis/.flagfile">
845 the timestamp of this file is the time that axis was extracted from the zip files.
846 it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
847 </echo>
848
849 <else>
850 <echo>Axis has been prepared, will not prepare</echo>
851 <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
852 </else>
853
854 </if>
855 </target>
856
857 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
858 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
859
860 <target name="deploy-site">
861 <java classname="org.apache.axis.client.AdminClient">
862 <classpath refid="compile.classpath"/>
863 <arg value="-l"/>
864 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
865 <arg file="${basedir}/resources/soap/deploy.wsdd"/>
866 </java>
867 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
868 </target>
869
870 <target name="soap-undeploy-site" depends="get-undeploy-service-name"
871 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
872 <filter token="servicesname" value="${axis.undeploy.servicename}"/>
873 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
874 tofile="${basedir}/resources/soap/undeploy.wsdd"
875 filtering="true"
876 overwrite="true"/>
877 <java classname="org.apache.axis.client.AdminClient">
878 <classpath refid="compile.classpath"/>
879 <arg value="-l"/>
880 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
881 <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
882 </java>
883 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
884 </target>
885
886 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
887 with the default servicename of localsite-->
888 <target name="deploy-localsite" depends="init"
889 description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
890 <antcall target="start-tomcat"/>
891 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
892 <antcall target="create-deployment-files">
893 <param name="axis.sitename" value="localsite"/>
894 <param name="axis.servicesname" value="${base.webservice.name}"/>
895 <param name="axis.siteuri" value="localsite"/>
896 </antcall>
897 <antcall target="deploy-site">
898 <param name="axis.sitename" value="localsite"/>
899 <param name="axis.servicesname" value="${base.webservice.name}"/>
900 <param name="axis.siteuri" value="localsite"/>
901 </antcall>
902 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
903 </target>
904
905 <target name="get-sitename" unless="axis.sitename">
906 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
907Press Enter for default:localsite</input>
908 </target>
909
910 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
911 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
912To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
913Or press Enter for undeploying the default:localsite /></input>
914 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
915 </target>
916
917 <target name="get-webservices" unless="axis.servicesname">
918 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
919Choose from: ${web.services.list}
920Or press Enter for default:${base.webservice.name} /></input>
921 <echo>${axis.servicesname}</echo>
922 </target>
923
924 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
925 <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>
926 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
927 </target>
928
929 <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">
930 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
931 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
932 </condition>
933
934 <!--everything else defaults to java:RPC at present-->
935 <condition property="soap.method" value="provider='java:RPC'">
936 <not>
937 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
938 </not>
939 </condition>
940 </target>
941
942 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
943 <filter token="sitename" value="${axis.sitename}"/>
944 <filter token="siteuri" value="${axis.siteuri}"/>
945 <filter token="servicesname" value="${axis.servicesname}"/>
946 <filter token="soapmethod" value="${soap.method}"/>
947 <copy file="${basedir}/resources/soap/site.wsdd.template"
948 tofile="${basedir}/resources/soap/deploy.wsdd"
949 filtering="true"
950 overwrite="true"/>
951 <!-- create the java files and compile them -->
952 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
953 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
954 filtering="true"
955 overwrite="true"/>
956 <mkdir dir="${build.home}"/>
957 <javac srcdir="${src.home}"
958 destdir="${build.home}"
959 debug="${compile.debug}"
960 deprecation="${compile.deprecation}"
961 optimize="${compile.optimize}">
962 <classpath refid="compile.classpath"/>
963 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
964 </javac>
965 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
966 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
967 tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
968 overwrite="true" />
969 </target>
970
971
972 <!-- ====================== Core targets ============================== -->
973 <!-- core targets refer to the core gsdl3 java src -->
974
975 <target name="prepare-core"/>
976
977 <target name="configure-core"/>
978
979 <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
980 description="Update only the Greenstone core" />
981
982 <target name="svnupdate-core" unless="nosvn.mode">
983 <svn>
984 <update dir="." revision="${branch.revision}"/>
985 </svn>
986 </target>
987
988 <target name="clean-core"
989 description="Clean only the Greenstone core">
990 <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
991 <delete dir="${build.home}"/>
992 </target>
993
994 <target name="compile-core" depends="init"
995 description="Compile only the Greenstone core">
996 <mkdir dir="${build.home}"/>
997 <javac srcdir="${src.home}"
998 destdir="${build.home}"
999 debug="${compile.debug}"
1000 deprecation="${compile.deprecation}"
1001 optimize="${compile.optimize}">
1002 <classpath>
1003 <path refid="compile.classpath"/>
1004 </classpath>
1005 </javac>
1006 <jar destfile="${build.home}/gsdl3.jar">
1007 <fileset dir="${build.home}">
1008 <include name="org/greenstone/gsdl3/**"/>
1009 <include name="org/flax/**"/>
1010 <exclude name="**/Test.class"/>
1011 </fileset>
1012 <manifest>
1013 <attribute name="Built-By" value="${user.name}" />
1014 </manifest>
1015 </jar>
1016 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1017 <!-- copy the localsite server in case we need it -->
1018 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
1019
1020 <!-- Greenstone Administrator Interface -->
1021 <jar destfile="${build.home}/GAI.jar">
1022 <fileset dir="${build.home}">
1023 <include name="org/greenstone/admin/**"/>
1024 </fileset>
1025 <manifest>
1026 <attribute name="Built-By" value="${user.name}" />
1027 </manifest>
1028 </jar>
1029 <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
1030 <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
1031 <jar destfile="${build.home}/phind.jar">
1032 <fileset dir="${build.home}">
1033 <include name="org/greenstone/applet/phind/**"/>
1034 </fileset>
1035 <manifest>
1036 <attribute name="Built-By" value="${user.name}" />
1037 </manifest>
1038 </jar>
1039 <mkdir dir="${web.applet}"/>
1040 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1041 <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
1042 <if>
1043 <bool><istrue value="${tomcat.islocal}"/></bool>
1044 <copy file="${packages.home}/tomcat/common/endorsed/xercesImpl.jar" todir="${web.applet}"/>
1045 <copy file="${packages.home}/tomcat/common/endorsed/xml-apis.jar" todir="${web.applet}"/>
1046 </if>
1047
1048
1049 <!-- skip anttasks for now
1050 <jar destfile="${build.home}/anttasks.jar">
1051 <fileset dir="${build.home}">
1052 <include name="org/greenstone/anttasks/**"/>
1053 </fileset>
1054 <manifest>
1055 <attribute name="Built-By" value="${user.name}" />
1056 </manifest>
1057 </jar>
1058 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
1059 <jar destfile="${build.home}/gsdl3test.jar">
1060 <fileset dir="${build.home}">
1061 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1062 <include name="org/greenstone/testing/**"/>
1063 </fileset>
1064 <manifest>
1065 <attribute name="Built-By" value="${user.name}" />
1066 </manifest>
1067 </jar>
1068 <jar destfile="${build.home}/server.jar">
1069 <fileset dir="${build.home}">
1070 <include name="org/greenstone/server/**"/>
1071 </fileset>
1072 <fileset file="${basedir}/resources/java/server.properties"/>
1073 <manifest>
1074 <attribute name="Built-By" value="${user.name}"/>
1075 </manifest>
1076 </jar>
1077 <copy file="${build.home}/server.jar" todir="${basedir}"/>
1078 </target>
1079
1080 <!-- ================== Packages targets ================================ -->
1081 <!-- these targets refer to the greenstone source packages - these need
1082 updating less often, so are in separate targets to the core -->
1083 <target name="prepare-packages" depends="init"/>
1084
1085 <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
1086 description="Update only the source packages"/>
1087
1088 <target name="svnupdate-packages" unless="nosvn.mode">
1089 <svn>
1090 <update dir="${src.packages.home}" revision="${branch.revision}"/>
1091 </svn>
1092 </target>
1093
1094
1095 <target name="configure-packages" depends="init,configure-javagdbm"
1096 description="Configure only the packages."/>
1097
1098 <target name="configure-javagdbm">
1099 <echo>
1100 Configuring JavaGDBM
1101 </echo>
1102
1103 <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1104 <arg value="--prefix=${basedir}"/>
1105 <arg value="--libdir=${lib.jni}"/>
1106 <arg value="--with-gdbm=${gdbm.home}"/>
1107 </exec>
1108 </target>
1109
1110 <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
1111
1112 <target name="clean-javagdbm" depends="init">
1113 <exec executable="make" os="${os.unix}"
1114 dir="${javagdbm.home}" failonerror="true">
1115 <arg value="clean"/>
1116 </exec>
1117 </target>
1118
1119 <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
1120
1121 <target name="distclean-javagdbm" depends="init">
1122 <exec executable="make" os="${os.unix}"
1123 dir="${javagdbm.home}" failonerror="true">
1124 <arg value="distclean"/>
1125 </exec>
1126 </target>
1127
1128 <target name="compile-packages" description="Compile only the source packages">
1129
1130 <!-- unix: -->
1131 <echo>compile javagdbm</echo>
1132 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
1133 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1134 <arg value="install"/>
1135 </exec>
1136
1137 <!-- windows: just the java stuff. -->
1138 <echo>Windows: compile javagdbm (java only)</echo>
1139 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
1140 <arg value="compile"/>
1141 <arg value="javaonly"/>
1142 </exec>
1143
1144 <!-- install the jar file -->
1145 <echo>Install the javagdbm jar file</echo>
1146 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1147
1148
1149 <!-- Search4j -->
1150 <antcall target="compile-search4j"/>
1151 </target>
1152
1153 <target name="compile-search4j">
1154
1155 <!-- windows -->
1156 <exec executable="${src.packages.home}/search4j/compile.bat" os="${os.windows}" dir="${src.packages.home}/search4j" failonerror="true"/>
1157
1158 <!-- unix -->
1159 <exec executable="${src.packages.home}/search4j/configure" os="${os.unix}" dir="${src.packages.home}/search4j" failonerror="true"><arg line="--bindir=${basedir}/bin"/>
1160 <arg line="${static.arg}"/>
1161 </exec>
1162 <exec executable="make" os="${os.unix}" dir="${src.packages.home}/search4j" failonerror="true"/>
1163
1164 <!-- install -->
1165 <copy todir="bin"><fileset dir="${src.packages.home}/search4j" includes="search4j,search4j.exe"/></copy>
1166 <if><bool><istrue value="${current.os.isunix}"/></bool>
1167 <chmod perm="+x" file="bin/search4j"/>
1168 </if>
1169
1170 </target>
1171
1172 <target name="install-auxiliary-jar-files" depends="init">
1173 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1174 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1175 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
1176 </target>
1177
1178 <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/>
1179
1180 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
1181 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1182 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
1183 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
1184 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1185 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
1186 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1187 </target>
1188 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
1189 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1190 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
1191 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
1192 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1193 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
1194 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1195 </target>
1196 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
1197 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1198 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
1199 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
1200 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1201 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
1202 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1203 </target>
1204
1205 <!-- ========common-src targets =================================-->
1206 <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
1207 collection building is not enabled -->
1208
1209 <target name="update-common-src" depends="init" if="collection.building.disabled">
1210 </target>
1211
1212 <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1213 <svn>
1214 <update dir="${common.src.home}" revision="${branch.revision}"/>
1215 </svn>
1216 </target>
1217
1218 <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
1219 <antcall target="checkout-common-src"/>
1220 <antcall target="unzip-windows-packages"/>
1221 </target>
1222
1223 <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1224 <echo>checking out common-src</echo>
1225 <svn>
1226 <checkout url="${svn.root}/gsdl/trunk/common-src" destPath="common-src" revision="${branch.revision}"/>
1227 </svn>
1228 </target>
1229
1230 <target name="configure-common-src" depends="init">
1231 <exec executable="${common.src.home}/configure" os="${os.unix}"
1232 dir="${common.src.home}" failonerror="true">
1233 <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
1234 <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
1235 <arg line="${static.arg}"/>
1236 </exec>
1237 </target>
1238
1239 <target name="clean-common-src" depends="init">
1240 <!-- unix: -->
1241 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1242 <arg value="clean"/>
1243 </exec>
1244 <!-- windows: -->
1245 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1246 <arg value="/f"/>
1247 <arg value="win32.mak"/>
1248 <arg value="clean"/>
1249 <arg value="GSDLHOME=${gs2build.home}"/>
1250 </exec>
1251 </target>
1252 <target name="distclean-common-src" depends="init">
1253 <!-- unix: -->
1254 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1255 <arg value="distclean"/>
1256 </exec>
1257 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1258 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1259 <arg value="/f"/>
1260 <arg value="win32.mak"/>
1261 <arg value="clean"/>
1262 <arg value="GSDLHOME=${gs2build.home}"/>
1263 </exec>
1264 </target>
1265 <target name="compile-common-src" depends="init">
1266 <!-- unix: -->
1267 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1268 </exec>
1269 <!-- windows: -->
1270 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1271 <arg value="/f"/>
1272 <arg value="win32.mak"/>
1273 <arg value="GSDLHOME=${gs2build.home}"/>
1274 </exec>
1275 </target>
1276
1277 <!-- ======= collection-building targets ===========================-->
1278
1279 <target name="update-collection-building" if="collection.building.enabled"
1280 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"
1281 description="Update (SVN update, configure, compile etc) only the collection building components"/>
1282
1283 <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
1284 description="SVN update the collection building components">
1285 </target>
1286
1287 <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
1288 </target>
1289
1290 <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
1291 description="Configure the collection building components">
1292 </target>
1293
1294 <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
1295 description="Clean only the collection building components"
1296 if="collection.building.enabled"/>
1297
1298 <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
1299 description="Distclean only the collection building components"
1300 if="collection.building.enabled"/>
1301
1302 <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
1303 description="Compile only the collection building components">
1304 <!-- make install for common-src -->
1305 <!-- unix: -->
1306 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1307 <arg value="install"/>
1308 </exec>
1309
1310 <!-- windows: -->
1311 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1312 <arg value="/f"/>
1313 <arg value="win32.mak"/>
1314 <arg value="install"/>
1315 </exec>
1316
1317 <!-- install gs2build indexers for windows -->
1318 <if>
1319 <bool><istrue value="${current.os.iswindows}"/></bool>
1320 <copy todir="${gs2build.home}/bin/windows">
1321 <fileset dir="${gs2build.home}/common-src/indexers/bin">
1322 <include name="*.*"/>
1323 </fileset>
1324 </copy>
1325 </if>
1326
1327 <!-- LuceneWrapper jar file not installed by default -->
1328 <mkdir dir="${gs2build.home}/bin/java"/>
1329 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
1330
1331 </target>
1332
1333 <!-- ============== gli targets ================================= -->
1334 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1335 <svn>
1336 <update dir="${gli.home}" revision="${branch.revision}"/>
1337
1338 <!-- some files from cgi-bin: necessary for remote GLI server -->
1339 <export srcUrl="${svn.root}/gsdl/${branch.path}/cgi-bin/gliserver.pl" destPath="${web.home}/WEB-INF/cgi/gliserver.pl" revision="${branch.revision}"/>
1340 <export srcUrl="${svn.root}/gsdl/${branch.path}/cgi-bin/gsdlCGI.pm" destPath="${web.home}/WEB-INF/cgi/gsdlCGI.pm" revision="${branch.revision}"/>
1341 </svn>
1342 </target>
1343
1344 <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
1345 <!-- checkout -->
1346 <if><bool><not><istrue value="${nosvn.mode}"/></not></bool>
1347 <svn>
1348 <checkout url="${svn.root}/gli/${branch.path}" destPath="gli" revision="${branch.revision}"/>
1349
1350 <!-- some files from cgi-bin: necessary for remote GLI server -->
1351 <export srcUrl="${svn.root}/gsdl/${branch.path}/cgi-bin/gliserver.pl" destPath="${web.home}/WEB-INF/cgi/gliserver.pl" revision="${branch.revision}"/>
1352 <export srcUrl="${svn.root}/gsdl/${branch.path}/cgi-bin/gsdlCGI.pm" destPath="${web.home}/WEB-INF/cgi/gsdlCGI.pm" revision="${branch.revision}"/>
1353 </svn>
1354 </if>
1355 </target>
1356
1357 <target name="clean-gli" depends="init" if="collection.building.enabled">
1358 <!-- gli -->
1359 <property name="gli.home" value="${basedir}/gli"/>
1360 <!-- linux -->
1361 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1362 resolveExecutable="true"/>
1363 <!-- windows -->
1364 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1365 resolveExecutable="true"/>
1366 </target>
1367
1368 <target name="compile-gli" depends="init" if="collection.building.enabled">
1369 <!-- gli -->
1370 <property name="gli.home" value="${basedir}/gli"/>
1371
1372 <!-- linux -->
1373 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true"/>
1374 <!--remote gli-->
1375 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
1376 resolveExecutable="true"/>
1377 <!-- windows -->
1378 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true"/>
1379 <!--remote gli-->
1380 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
1381 resolveExecutable="true"/>
1382 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
1383 </target>
1384
1385 <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
1386 <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1387 <env key="gsdl3path" path="${basedir}"/>
1388 <env key="gsdlpath" path="${gs2build.home}"/>
1389 </exec>
1390 <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1391 <env key="gsdl3path" path="${basedir}"/>
1392 <env key="gsdlpath" path="${gs2build.home}"/>
1393 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
1394 </exec>
1395 <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1396 <env key="GSDL3PATH" path="${basedir}"/>
1397 <env key="GSDLPATH" path="${gs2build.home}"/>
1398 </exec>
1399 <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.
1400 </echo>
1401 </target>
1402
1403 <!-- ================ gs2build targets =========================== -->
1404
1405 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1406 <echo>svn updating gs2build</echo>
1407 <svn>
1408 <update dir="{gs2build.home}" revision="${branch.revision}"/>
1409 </svn>
1410 </target>
1411
1412 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
1413 <antcall target="checkout-gs2build"/>
1414 <antcall target="unzip-windows-packages"/>
1415 <antcall target="checkout-winbin"/>
1416 <antcall target="get-windows-binaries"/>
1417 <antcall target="delete-winbin"/>
1418 </target>
1419
1420 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
1421 <echo>checking out gs2build</echo>
1422 <svn>
1423 <checkout url="${svn.root}/gs2build" destPath="gs2build" revision="${branch.revision}"/>
1424 </svn>
1425 </target>
1426
1427 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1428 unless="nosvn.mode">
1429 <svn>
1430 <checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin" revision="${branch.revision}"/>
1431 </svn>
1432 </target>
1433
1434 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
1435 <svn>
1436 <update dir="winbin" revision="${branch.revision}"/>
1437 </svn>
1438 </target>
1439
1440 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
1441 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1442 <fileset dir="${basedir}/winbin/bin"/>
1443 </move>
1444 </target>
1445
1446 <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
1447 <delete dir="${basedir}/winbin"/>
1448 </target>
1449
1450 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1451 <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
1452 dest="${common.src.home}/packages/windows/crypt"/>
1453 <unzip src="${common.src.home}/packages/windows/expat/expat.zip"
1454 dest="${common.src.home}/packages/windows/expat"/>
1455 <untar compression="gzip"
1456 src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
1457 dest="${common.src.home}/packages/sqlite"/>
1458 <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
1459 dest="${common.src.home}/indexers/packages/windows/iconv"/>
1460 </target>
1461
1462 <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
1463 <!-- we want a windows path in the setup.bat file -->
1464 <pathconvert targetos="windows" property="gs2build.home.windows">
1465 <path path="${gs2build.home}"/>
1466 </pathconvert>
1467 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
1468 <filterset>
1469 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1470 </filterset>
1471 </move>
1472 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
1473 </target>
1474
1475
1476 <target name="clean-build-src" depends="init" if="collection.building.enabled">
1477 <!-- unix: -->
1478 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
1479 <arg value="clean"/>
1480 </exec>
1481 <!-- windows: -->
1482 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1483 <arg value="/f"/>
1484 <arg value="win32.mak"/>
1485 <arg value="clean"/>
1486 <arg value="GSDLHOME=${gs2build.home}"/>
1487 </exec>
1488 </target>
1489
1490
1491 <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
1492 <!-- unix: -->
1493 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
1494 <arg value="distclean"/>
1495 </exec>
1496 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1497 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1498 <arg value="/f"/>
1499 <arg value="win32.mak"/>
1500 <arg value="clean"/>
1501 <arg value="GSDLHOME=${gs2build.home}"/>
1502 </exec>
1503 </target>
1504
1505 <target name="configure-build-src" depends="init" if="collection.building.enabled"
1506 description="Configure the build-src component">
1507 <exec executable="${build.src.home}/configure" os="${os.unix}"
1508 dir="${build.src.home}" failonerror="true">
1509 <arg value="--prefix=${gs2build.home}"/>
1510 <arg line="${static.arg}"/>
1511 </exec>
1512 </target>
1513
1514 <!-- common-src is done separately and needs to be compiled first -->
1515 <target name="compile-build-src" depends="init" if="collection.building.enabled">
1516
1517 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true"/>
1518 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
1519 <arg value="install"/>
1520 </exec>
1521
1522 <!-- run the setup script -->
1523 <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}"/>-->
1524 <!--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-->
1525 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1526 <arg value="/f"/>
1527 <arg value="win32.mak"/>
1528 <arg value="GSDLHOME=${gs2build.home}"/>
1529 </exec>
1530 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1531 <arg value="/f"/>
1532 <arg value="win32.mak"/>
1533 <arg value="install"/>
1534 <arg value="GSDLHOME=${gs2build.home}"/>
1535 </exec>
1536 </target>
1537
1538
1539 <!-- ======================== TESTING Targets ========================= -->
1540
1541 <target name="test" description="Run the (incomplete) JUnit test suite "
1542 depends="init">
1543 <mkdir dir="${basedir}/test"/>
1544 <junit printsummary="withOutAndErr"
1545 errorproperty="test.failed"
1546 failureproperty="test.failed"
1547 fork="${junit.fork}">
1548 <formatter type="plain"/>
1549 <classpath>
1550 <pathelement location="${build.home}/gsdl3test.jar"/>
1551 <path refid="compile.classpath"/>
1552 </classpath>
1553 <test name="${testcase}" if="testcase"/>
1554 <batchtest todir="${basedir}/test" unless="testcase">
1555 <fileset dir="${build.home}" includes="**/*Test.class" />
1556 </batchtest>
1557 </junit>
1558 <echo>
1559 *********************************************
1560 Test output can be found in directory 'test'
1561 *********************************************
1562 </echo>
1563 </target>
1564
1565 <!-- ======================== FLAX Targets ========================= -->
1566 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
1567 <echo>checking out flax ...</echo>
1568 <mkdir dir="${basedir}/src/java/org/flax"/>
1569 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1570 <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
1571 <mkdir dir="${web.home}/interfaces/flax"/>
1572 <mkdir dir="${web.home}/sites/flax"/>
1573 <mkdir dir="${basedir}/flax-resources"/>
1574 <mkdir dir="${basedir}/flax-lib"/>
1575 <svn>
1576 <checkout url="${flax.checkout.path}/src/java/org/flax/"
1577 destPath="${basedir}/src/java/org/flax"/>
1578 <checkout url="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax/"
1579 destPath="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1580 <checkout url="${flax.checkout.path}/web/WEB-INF/classes/flax/"
1581 destPath="${web.home}/WEB-INF/classes/flax"/>
1582 <checkout url="${flax.checkout.path}/web/interfaces/flax/"
1583 destPath="${web.home}/interfaces/flax"/>
1584 <checkout url="${flax.checkout.path}/web/sites/flax/"
1585 destPath="${web.home}/sites/flax"/>
1586 <checkout url="${flax.checkout.path}/flax-resources"
1587 destPath="${basedir}/flax-resources"/>
1588 <checkout url="${flax.checkout.path}/lib"
1589 destPath="${basedir}/flax-lib"/>
1590 </svn>
1591 <echo>prepare flax files...</echo>
1592 <move file="${web.home}/WEB-INF/web.xml" tofile="${web.home}/WEB-INF/web.xml.greenstone3backup"/>
1593 <antcall target="flax-copy-files" />
1594 <antcall target="unzip-flax-resources" />
1595 </target>
1596
1597 <target name="update-flax" description="update flax from repository">
1598 <echo>updating flax ...</echo>
1599 <svn>
1600 <update dir="${basedir}/src/java/org/flax"/>
1601 <update dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1602 <update dir="${web.home}/WEB-INF/classes/flax"/>
1603 <update dir="${web.home}/interfaces/flax"/>
1604 <update dir="${web.home}/sites/flax"/>
1605 </svn>
1606 <antcall target="flax-copy-files" />
1607 </target>
1608
1609 <target name="unzip-flax-resources" >
1610 <property name="classes.dir" value="${web.home}/WEB-INF/classes/flax"/>
1611 <unzip dest="${classes.dir}">
1612 <fileset dir="${classes.dir}">
1613 <include name="*.zip"/>
1614 </fileset>
1615 </unzip>
1616 <delete>
1617 <fileset dir="${classes.dir}" includes="*.zip"/>
1618 </delete>
1619 </target>
1620
1621 <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
1622 <echo>copying flax files ...</echo>
1623 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
1624 <!-- A configuration file containing web service binding information for the axis engine -->
1625 <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
1626 <copy file="${basedir}/flax-resources/flax-build.xml" todir="${basedir}" overwrite="true" />
1627 <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" />
1628 </target>
1629
1630
1631
1632
1633 <target name="compile-javadocs">
1634 <javadoc packagenames="org.greenstone.*"
1635 sourcepath="src/java"
1636 defaultexcludes="yes"
1637 destdir="docs/javadoc"
1638 author="true"
1639 version="true"
1640 use="true"
1641 windowtitle="Greenstone3 API">
1642 <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
1643 </javadoc>
1644 </target>
1645
1646 <target name="remove-source">
1647 <delete includeEmptyDirs="true"><fileset dir="." defaultexcludes="false"><patternset refid="greenstone3.source.fileset"/></fileset></delete>
1648 </target>
1649
1650 <target name="dist-tidy"
1651 description="'tidies-up' a greenstone3 installation for distribution.">
1652
1653 <!-- delete unneeded things -->
1654 <delete dir="${packages.home}/axis"/>
1655 <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
1656 <delete file="README-SVN.txt"/>
1657
1658 <!-- delete source files -->
1659 <antcall target="remove-source"/>
1660
1661 <!-- create empty directories -->
1662 <mkdir dir="${web.home}/applet"/>
1663 <mkdir dir="${web.home}/logs"/>
1664
1665 <!-- os specific tidy-ups -->
1666 <if>
1667 <bool><istrue value="${current.os.isunix}"/></bool>
1668 <delete><fileset dir="." includes="*.bat"/></delete>
1669 <delete><fileset dir="gli" includes="*.bat"/></delete>
1670 <delete><fileset dir="gs2build" includes="*.bat"/></delete>
1671 <delete><fileset dir="bin/script" includes="*.bat"/></delete>
1672 <delete file="${basedir}/gs2build/win32cfg.h"/>
1673 <delete file="${basedir}/gs2build/win32.mak"/>
1674 <delete dir="${basedir}/winutil"/>
1675 <delete dir="winutil"/>
1676 <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
1677 </if>
1678
1679 </target>
1680
1681 <!-- ============= tweaks for making compilation static ========== -->
1682 <target name="tweak-makefiles" depends="init" if="compile.static">
1683 <antcall target="rtftohtml-add-static" />
1684 </target>
1685
1686 <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
1687 <rsr file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
1688 </target>
1689
1690</project>
Note: See TracBrowser for help on using the repository browser.