source: greenstone3/trunk/build.xml@ 19843

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

first stab at updating build.xml to get rid of gdbm specific targets and just generally tidy it up. I am halfway through, and java on my machine is not working properly so haven't tested this :-( But Oran said I could commit :-)

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