source: greenstone3/trunk/build.xml@ 19930

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

added a taskdef for rsr tasks so we can do replacements in files

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