source: main/trunk/greenstone3/build.xml@ 29988

Last change on this file since 29988 was 29988, checked in by ak19, 9 years ago
  1. Targets for stopping and starting the derby server now first check whether derby is already running and acts accordingly, just like stop-tomcat does, with the introduction of a force-stop-derby. 2. Have added a similar check for start-tomcat, so that we can't any longer accidentally run ant start and thereby run two tomcat instances on the same host and port.
File size: 139.8 KB
RevLine 
[15124]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=".">
[20241]10 <echo>os.name: ${os.name}</echo>
[15124]11
[15799]12 <!-- ============ classpath =================== -->
13 <path id="project.classpath">
14 <fileset dir="lib/java">
15 <include name="**/*.jar"/>
16 </fileset>
17 </path>
18
19 <!-- ============ self defined tasks =================== -->
20 <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpathref="project.classpath"/>
21 <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpathref="project.classpath"/>
[19930]22 <taskdef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
[21196]23 <!--<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>-->
[15799]24 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
[26115]25 <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="project.classpath"/>
[23854]26 <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpathref="project.classpath"/>
27
[19930]28
[15799]29 <!-- ===================== Property Definitions =========================== -->
30
31 <!--
[15124]32
33 Each of the following properties are used in the build script.
34 Values for these properties are set by the first place they are
35 defined, from the following list:
36
37 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
38
39 * Definitions from a "build.properties" file in the top level
[15799]40 source directory of this application.
[15124]41
42 * Definitions from a "build.properties" file in the user's
[15799]43 home directory.
[15124]44
45 * Default definitions in this build.xml file.
46
47 You will note below that property values can be composed based on the
48 contents of previously defined properties. This is a powerful technique
49 that helps you minimize the number of changes required when your development
50 environment is modified. Note that property composition is allowed within
51 "build.properties" files as well as in the "build.xml" script.
52
[15799]53 -->
[18227]54
[27834]55 <property name="os.linux" value="Linux"/>
56 <property name="os.mac" value="Mac OS X"/>
57 <property name="os.solaris" value="SunOS"/>
58 <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
[28042]59 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows 2003,Windows XP,Windows NT,Windows ME,Windows Vista,Windows 7,Windows Server 2008,Windows Server 2008 R2"/> <!-- check this!!!-->
[27834]60
61 <!-- this is true for linux and macs -->
62 <condition property="current.os.isunix">
63 <os family="unix"/>
64 </condition>
65
66 <condition property="current.os.isunixnotmac">
67 <and>
68 <os family="unix"/>
69 <not>
70 <os family="mac"/>
71 </not>
72 </and>
73 </condition>
74
75 <condition property="current.os.ismac">
76 <os family="mac"/>
77 </condition>
78
79 <condition property="current.os.iswindows">
80 <os family="windows"/>
81 </condition>
82
[18227]83 <!-- create build.properties if it has not been created yet -->
84 <if>
85 <bool><not><available file="build.properties"/></not></bool>
86 <copy file="build.properties.in" tofile="build.properties"/>
87 </if>
88
[18515]89 <!-- create the packages dir if it has not been created yet -->
90 <mkdir dir="packages"/>
[15799]91
[15859]92 <!--the first three properties have to be put on the top to be used by build.properties-->
[19960]93 <property name="gs2build.home" value="${basedir}${file.separator}gs2build"/>
[15124]94 <property name="src.packages.home" value="${basedir}/src/packages"/>
[15859]95 <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
[19878]96
[27860]97 <property name="solr-ext.home" value="${basedir}/ext/solr"/>
98
[15124]99 <property file="build.properties"/>
[16962]100 <if><bool><available file="${user.home}/build.properties"/></bool>
101 <property file="${user.home}/build.properties"/>
102 </if>
[15124]103
[20464]104 <!-- now we've read in properties, apply defaults -->
105 <property name="disable.collection.building" value="false"/>
106
[15124]107 <!-- get properties from the environment -->
108 <property environment="env"/>
[15799]109
[20127]110 <!-- get the filesets defining components and executables -->
[19975]111 <import file="resources/xml/components.xml"/>
[20127]112 <import file="resources/xml/executables.xml"/>
[15799]113
114 <!-- version properties for external packages -->
[20079]115 <!-- for Java versions < 1.4, we print out the message that Java is too old.
[25131]116 For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 7.0-->
[29578]117 <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-7.0.57">
[20079]118 <equals arg1="1.4" arg2="${ant.java.version}"/>
119 </condition>
[25131]120 <condition property="tomcat.version.major" value="5" else="7">
[20079]121 <equals arg1="1.4" arg2="${ant.java.version}"/>
122 </condition>
[22320]123 <condition property="privileged.attribute" value="privileged='true'" else="">
[25384]124 <equals arg1="7" arg2="${tomcat.version.major}"/>
[22320]125 </condition>
[20233]126
[29845]127 <!-- external access to the GS3 pages or not
128 https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html -->
129 <condition property="allowed.IPs"
130 value=".*"
131 else="(127\.0\.0\.1|::1|0:0:0:0:0:0:0:1)">
132 <matches pattern="^(1|true|yes)$" string="${server.external.access}"/>
133 </condition>
134
[22405]135 <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
136 <property name="axis.dir.version" value="axis-1_4"/>
[24077]137 <property name="sqlite.targz.version" value="sqlite-autoconf-3070602.tar.gz"/>
[15799]138
[15124]139 <property name="build.home" value="${basedir}/build"/>
140 <property name="src.home" value="${basedir}/src/java"/>
[27829]141
142 <if><bool><istrue value="${gsdl3home.isreadonly}"/></bool>
143 <property name="readonly-packages.home" value="${basedir}/packages"/>
144 <property name="packages.home" value="${gsdl3.writablehome}/packages"/>
145 <else>
146 <property name="packages.home" value="${basedir}/packages"/>
147 </else>
148 </if>
149
150 <!-- this may be set in build.properties, e.g. if you move the web dir to
151 tomcats webapps directory -->
[15124]152 <property name="web.home" value="${basedir}/web"/>
[27829]153 <property name="web.writablehome" value="${gsdl3.writablehome}"/>
154
[15124]155 <!-- jar files needed by applets go here -->
156 <property name="web.applet" value="${web.home}/applet"/>
[20085]157
[15124]158 <!-- jar files needed by the servlet (and extra ones) go here -->
159 <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
[27829]160 <property name="web.writablelib" value="${web.writablehome}/WEB-INF/lib"/>
[15124]161 <!-- other files needed by the servlet go here -->
162 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
[27829]163 <property name="web.writableclasses" value="${web.writablehome}/WEB-INF/classes"/>
164
165 <if>
166 <bool><istrue value="${gsdl3home.isreadonly}"/></bool>
167 <echo>Greenstone3 home directory is read-only</echo>
168 <echo> => Writable area is: ${gsdl3.writablehome}</echo>
169
170 <condition property="gsdl3.writablehome.already-exists">
171 <available file="${gsdl3.writablehome}" type="dir"/>
172 </condition>
173
174 <if>
175 <bool><not><istrue value="${gsdl3.writablehome.already-exists}"/></not></bool>
176
177 <!-- set up writable area -->
178 <echo>No previous Greenstone home writable area detected</echo>
179 <echo> => Setting up area</echo>
180 <mkdir dir="${gsdl3.writablehome}"/>
181 <mkdir dir="${gsdl3.writablehome}/packages"/>
182 <mkdir dir="${gsdl3.writablehome}/logs"/>
[27860]183 <mkdir dir="${gsdl3.writablehome}/ext/solr"/>
[27829]184
185 <chmod perm="a+rwx" dir="${gsdl3.writablehome}"/>
186 <chmod perm="a+rwx" dir="${gsdl3.writablehome}/packages"/>
187 <chmod perm="a+rwx" dir="${gsdl3.writablehome}/logs"/>
[27860]188 <chmod perm="a+rwx" dir="${gsdl3.writablehome}/ext/solr"/>
[27829]189
190 <!-- copy over packages tomcat folder -->
191
192 <if>
[27834]193 <bool><istrue value="${current.os.iswindows}"/></bool>
[27829]194 <copy todir="${gsdl3.writablehome}/packages/tomcat"
195 preservelastmodified="true"
196 failonerror="true" >
197 <fileset dir="${readonly-packages.home}/tomcat" includes="**"/>
198 </copy>
199
200 <else>
201 <!-- else assume Unix -->
202 <!-- Can't go through the OS-independant <copy> task as it fails to preserve exec permissions -->
203 <echo>Copying to ${gsdl3.writablehome}/packages/tomcat</echo>
204 <exec executable="cp" output="/dev/null" spawn="false">
205 <arg value="-r"/>
206 <arg value="${readonly-packages.home}/tomcat"/>
207 <arg value="${gsdl3.writablehome}/packages/."/>
208 </exec>
209
210 </else>
211 </if>
212
213 <echo> => Copying Greenstone's web/WEB-INF to writable area</echo>
214 <copy todir="${gsdl3.writablehome}/WEB-INF"
215 preservelastmodified="true"
216 failonerror="true" >
217 <fileset dir="${web.home}/WEB-INF" includes="**"/>
218 </copy>
219
220 <copy todir="${gsdl3.writablehome}"
221 preservelastmodified="true"
222 failonerror="true" >
223 <fileset dir="${web.home}" includes="index.html"/>
224 </copy>
225
226 </if>
227 </if>
228
229
[15124]230 <!--- flax: the WordNet home -->
231 <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
232
233 <!-- jni libraries and java wrappers go here -->
234 <property name="lib.jni" value="${basedir}/lib/jni"/>
[19878]235
236 <!-- other jar files needed for installation (but not runtime) go here -->
[18110]237 <property name="lib.java" value="${basedir}/lib/java"/>
[15799]238
[15124]239 <property name="javadocs" value="${basedir}/docs/javadoc"/>
240
241 <property name="app.name" value="greenstone3"/>
242 <property name="app.path" value="/${app.name}"/>
243
[18124]244 <property name="admin.dir" value="${basedir}/admin"/>
[15124]245
[27829]246 <!-- defaults - set these on the command line or in build.properties or
247 they will take these default values-->
[15124]248 <property name="app.version" value="trunk"/>
249 <property name="branch.path" value="trunk"/>
250 <property name="branch.revision" value="HEAD"/>
251
252 <!--constants -->
253 <property name="svn.root" value="http://svn.greenstone.org"/>
254
[19878]255 <!-- catalina home is set to tomcat basedir if already installed, otherwise
[27829]256 use greenstone's tomcat -->
[20085]257 <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
[15124]258 <and>
259 <isset property="tomcat.installed.path"/>
260 <not>
[27829]261 <equals arg1="" arg2="${tomcat.installed.path}"/>
[15124]262 </not>
263 </and>
264 </condition>
[25131]265
[15124]266
[19933]267 <!-- is there a better way to do this?? what about solaris?? -->
[26765]268 <condition property="os.bin.dir" value="${cross.os}">
269 <istrue value="${compile.cross}"/>
270 </condition>
[19933]271 <condition property="os.bin.dir" value="windows">
272 <os family="windows"/>
273 </condition>
274 <condition property="os.bin.dir" value="darwin">
275 <os family="mac"/>
276 </condition>
277 <condition property="os.bin.dir" value="linux">
278 <and>
279 <os family="unix"/>
280 <not>
281 <os family="mac"/>
282 </not>
283 </and>
284 </condition>
[26765]285
[19933]286
[19878]287 <condition property="collection.building.disabled">
[20464]288 <and>
289 <isset property="disable.collection.building"/>
290 <istrue value="${disable.collection.building}"/>
291 </and>
[19878]292 </condition>
293
[15124]294 <condition property="collection.building.enabled">
295 <not>
[20464]296 <istrue value="${disable.collection.building}"/>
[15124]297 </not>
298 </condition>
[19878]299
[15124]300 <condition property="collection.building.enabled.windows">
301 <and>
[20464]302 <istrue value="${collection.building.enabled}"/>
[15124]303 <isset property="current.os.iswindows"/>
304 </and>
305 </condition>
306
307 <condition property="collection.building.enabled.unix">
308 <and>
[20464]309 <istrue value="${collection.building.enabled}"/>
[15124]310 <isset property="current.os.isunix"/>
311 </and>
312 </condition>
[22847]313
[20085]314 <condition property="static.arg" value="LDFLAGS=-static" else=" ">
[19931]315 <isset property="compile.static"/>
316 </condition>
[22184]317
[27199]318 <!-- If building a release then we want to adjust environment variables so that the support library can be seen during compilation -->
[27185]319 <if><bool><isset property="use.gnomelib.ext"/></bool>
[23599]320 <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
[22845]321
[23599]322 <if><bool><isset property="env.CFLAGS"/></bool>
323 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CFLAGS}&quot;"/>
324 <else>
325 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
326 </else>
327 </if>
[22845]328
[23599]329 <if><bool><isset property="env.CPPFLAGS"/></bool>
330 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CPPFLAGS}&quot;"/>
331 <else>
332 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
333 </else>
334 </if>
[22847]335
[23599]336 <if><bool><isset property="env.CXXFLAGS"/></bool>
337 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CXXFLAGS}&quot;"/>
338 <else>
339 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
340 </else>
341 </if>
342
343 <if><bool><isset property="env.LDFLAGS"/></bool>
344 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
345 <else>
346 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib&quot;"/>
347 </else>
348 </if>
349
350 <if><bool><isset property="env.PATH"/></bool>
351 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
352 <else>
353 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin&quot;"/>
354 </else>
355 </if>
356
357 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
358 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
359 <else>
360 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig&quot;"/>
361 </else>
362 </if>
363
[23611]364 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
365 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
366 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}&quot;"/>
367 <else>
368 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
369 </else>
370 </if>
[23599]371 <else>
[23611]372 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
373 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}&quot;"/>
374 <else>
375 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
376 </else>
377 </if>
[23599]378 </else>
379 </if>
380
381 <else>
382 <if><bool><isset property="env.CFLAGS"/></bool>
383 <property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
384 <else>
385 <property name="cflags.arg" value=" "/>
386 </else>
387 </if>
388
389 <if><bool><isset property="env.CPPFLAGS"/></bool>
390 <property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
391 <else>
392 <property name="cppflags.arg" value=" "/>
393 </else>
394 </if>
395
396 <if><bool><isset property="env.CXXFLAGS"/></bool>
397 <property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
398 <else>
399 <property name="cxxflags.arg" value=" "/>
400 </else>
401 </if>
402
403 <if><bool><isset property="env.LDFLAGS"/></bool>
404 <property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
405 <else>
406 <property name="ldflags.arg" value=" "/>
407 </else>
408 </if>
409
410 <if><bool><isset property="env.PATH"/></bool>
411 <property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
412 <else>
413 <property name="path.arg" value=" "/>
414 </else>
415 </if>
416
417 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
418 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
419 <else>
420 <property name="pcpath.arg" value=" "/>
421 </else>
422 </if>
423
[23611]424 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
425 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
426 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
427 <else>
428 <property name="ldlpath.arg" value=" "/>
429 </else>
430 </if>
[23599]431 <else>
[23611]432 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
433 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
434 <else>
435 <property name="ldlpath.arg" value=" "/>
436 </else>
437 </if>
438 </else>
[23599]439 </if>
440 </else>
[22868]441 </if>
[23611]442 <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
[22868]443
[26765]444 <condition property="opt.cross.build"
445 value="--build=${cross.build}" else=" ">
446 <isset property="cross.build"/>
447 </condition>
448
449
450 <condition property="cross.configure.args"
[26806]451 value="--host=${cross.host} ${opt.cross.build} CPP=${cross.host}-cpp CC=${cross.host}-gcc CXX=${cross.host}-g++ LD=${cross.host}-ld AR=${cross.host}-ar RANLIB=${cross.host}-ranlib STRIP=${cross.host}-strip ${cross.configure.extraargs} crossOS=${cross.os}" else=" ">
[26765]452 <istrue value="${compile.cross}"/>
453 </condition>
454
[28311]455 <!-- if we're told to work with gnome-lib, or if there's a gnome-lib-minimal that the user
456 has placed in gs2build/ext, then compile gs2build after sourcing gnome-lib environment -->
457 <condition property="opt.gnomelibext.arg"
458 value="--enable-gnome-lib-ext" else=" ">
459 <or>
460 <available file="${gs2build.home}/ext/gnome-lib-minimal" type="dir"/>
461 <istrue value="${use.gnomelib.ext}"/>
462 <istrue value="${checkout.gnomelib.ext}"/>
463 </or>
464 </condition>
465
[27028]466<!-- if you want to disable wvware, do so here: set the value (not else) field to contain minus-minus-disable-wvware -->
[28311]467 <condition property="gs2.opt.args" value="${opt.gnomelibext.arg} " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
[22184]468 <istrue value="${with.jni}"/>
469 </condition>
470 <condition property="gs2.compile.target" value="with-jni" else="without-jni">
471 <istrue value="${with.jni}"/>
472 </condition>
473 <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni">
474 <istrue value="${with.jni}"/>
475 </condition>
476 <condition property="gs2.windows.enablejni" value="1" else="0">
477 <istrue value="${with.jni}"/>
478 </condition>
[22976]479 <condition property="gs2.windows.enablemg" value="1" else="0">
480 <istrue value="${with.jni}"/>
481 </condition>
482 <condition property="gs2.windows.enablemgpp" value="1" else="0">
483 <istrue value="${with.jni}"/>
484 </condition>
485 <!-- Should accent folding not also be set here ?? -->
486 <condition property="gs2.windows.usegdbm" value="1" else="0">
487 <istrue value="${with.jni}"/>
488 </condition>
489 <condition property="gs2.windows.usesqlite" value="1" else="0">
490 <istrue value="${with.jni}"/>
491 </condition>
[19931]492
[15799]493 <!-- where is search4j tool -->
[20085]494 <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
[15799]495 <isset property="current.os.iswindows"/>
[15136]496 </condition>
497
[15799]498
[15124]499 <!-- ============= Base dirs for each package and component ============ -->
500 <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
501 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
502 <property name="gli.home" value="${basedir}/gli"/>
503 <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
504
[21347]505 <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}${file.separator}common-src">
[20464]506 <istrue value="${disable.collection.building}"/>
[19871]507 </condition>
[19931]508
509 <property name="build.src.home" value="${gs2build.home}/build-src"/>
[19871]510 <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
511 <property name="mg.home" value="${common.src.home}/indexers/mg"/>
512 <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
513 <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
514
[15799]515 <!-- ==================== Compilation Control Options ==================== -->
[15124]516
[15799]517 <!--
[15124]518
519 These properties control option settings on the Javac compiler when it
520 is invoked using the <javac> task.
521
522 compile.debug Should compilation include the debug option?
523
524 compile.deprecation Should compilation include the deprecation option?
525
526 compile.optimize Should compilation include the optimize option?
527
[15799]528 -->
[15124]529
530 <property name="compile.debug" value="true"/>
531 <property name="compile.deprecation" value="true"/>
532 <property name="compile.optimize" value="true"/>
[29515]533 <property name="compile.encoding" value="UTF8"/>
[28137]534 <property name="compile.includeantruntime" value="false"/> <!-- to get rid of annoying 'ant' warning -->
[15124]535
[15799]536 <!--
[15124]537
538 Rather than relying on the CLASSPATH environment variable, Ant includes
539 features that makes it easy to dynamically construct the classpath you
540 need for each compilation. The example below constructs the compile
541 classpath to include the servlet.jar file, as well as the other components
542 that Tomcat makes available to web applications automatically, plus anything
543 that you explicitly added.
544
[15799]545 -->
[20079]546
547 <!-- All elements that Tomcat 5 exposes to applications -->
548 <path id="tomcat5">
[20085]549 <pathelement location="${catalina.home}/common/classes"/>
550 <fileset dir="${catalina.home}/common/endorsed">
551 <include name="*.jar"/>
552 </fileset>
553 <fileset dir="${catalina.home}/common/lib">
554 <include name="*.jar"/>
555 </fileset>
556 <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
557 <pathelement location="${catalina.home}/shared/classes"/>
558 <fileset dir="${catalina.home}/shared/lib">
559 <include name="*.jar"/>
560 </fileset>
[20079]561 </path>
562
[25131]563 <!-- All elements that Tomcat 7 exposes to applications -->
564 <path id="tomcat7">
[20085]565 <fileset dir="${catalina.home}/lib">
566 <include name="*.jar"/>
567 </fileset>
[20079]568 </path>
569
[15124]570 <path id="compile.classpath">
571 <!-- Include all jar files and libraries in our jni lib directory -->
572 <pathelement location="${lib.jni}"/>
573 <fileset dir="${lib.jni}">
574 <include name="*.jar"/>
575 </fileset>
576 <!-- Include all jar files in our web lib directory -->
577 <pathelement location="${web.lib}"/>
578 <fileset dir="${web.lib}">
579 <include name="*.jar"/>
580 </fileset>
581
[18110]582 <pathelement location="${lib.java}"/>
583 <fileset dir="${lib.java}">
584 <include name="*.jar"/>
585 </fileset>
[15124]586
587 <!-- include the jar files from the source packages -->
588 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
589 so we add them in by name -->
[22184]590 <!-- *** is there any way to make this optional, based on ${with.jni}? -->
[15124]591 <pathelement location="${lib.jni}/mg.jar"/>
592 <pathelement location="${lib.jni}/mgpp.jar"/>
593
[20085]594 <!-- Include all elements that Tomcat exposes to applications -->
595 <path refid="tomcat${tomcat.version.major}"/>
596
[15124]597 </path>
598
599 <path id="local.tomcat.classpath">
600 <!-- explicitly include the jni java wrappers in the classpath -->
601 <pathelement location="${lib.jni}"/>
602 <fileset dir="${lib.jni}">
603 <include name="*.jar"/>
604 </fileset>
[25095]605
[27829]606 <pathelement location="${web.writablelib}"/>
607 <fileset dir="${web.writablelib}">
[29903]608 <include name="derbyclient.jar"/> <!--<include name="derby.jar"/>-->
[25095]609 </fileset>
[15124]610 </path>
611
[29903]612 <path id="derby.server.classpath">
613 <pathelement location="${web.lib}/derbynet.jar"/>
614 <pathelement location="${web.lib}/derby.jar"/>
615 </path>
616
617
[15124]618 <path id="local.tomcat.path">
619 <pathelement location="${basedir}/bin/script"/>
620 <pathelement location="${basedir}/bin"/>
621 <pathelement location="${lib.jni}"/>
622 <pathelement path="${env.PATH}"/>
623 <pathelement path="${env.Path}"/>
624 <pathelement path="${wn.home}/bin"/>
625 </path>
626
627 <target name="test-setup">
628 <echo>ant java version=${ant.java.version}</echo>
629 <echo>is unix : ${current.os.isunix}</echo>
630 <echo>is mac : ${current.os.ismac}</echo>
631 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
632 <echo>is windows : ${current.os.iswindows}</echo>
633 <echo>os.unix: ${os.unix}</echo>
634 </target>
[27369]635
636 <!-- Appends the current env to the file environment.txt. For debugging env vars used by the release-kit. -->
[29341]637 <target name="write-env" description="Writes out the environment that this build.xml is executed in to file environment.txt. For debugging.">
[27369]638 <echo message="*****************ENVIRONMENT OUTPUT:****************${line.separator}" file="environment.txt" append="true" />
639
640 <if><bool><istrue value="${current.os.iswindows}"/></bool>
[29343]641 <exec executable="set" dir="${basedir}" failonerror="false" output="environment.txt" append="true">
642 <arg value="/c" />
643 <arg value="set" />
644 </exec>
[27369]645 <else>
646 <exec executable="env" dir="${basedir}" failonerror="false" output="environment.txt" append="true" />
647 </else>
648 </if>
649
650 <echo message="${line.separator}" file="environment.txt" append="true" />
651 </target>
652
[20085]653
[15799]654 <!-- ==================== Primary and Global Targets ============================= -->
[15124]655
[28904]656 <target name="prepare" depends="accept-properties,init,copy-dot-in-files,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
[15124]657 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.">
658
659 <!-- make sure .sh files are executable -->
660 <chmod dir="${basedir}" perm="ugo+rx"
661 includes="*.sh"/>
662 <chmod dir="${basedir}/bin/script" perm="ugo+rx"
663 includes="*.sh,*.pl"/>
664 </target>
[16936]665
[19871]666 <!-- 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 -->
[28311]667 <!--before configuring build-src, make sure that gnome-lib is compiled up-->
[28611]668 <target name="install" depends="init,compile-imagemagick,compile-gnome-lib,install-common-src,install-collection-building,install-runtime,install-solr-ext,setup-for-eclipse,get-isisgdl"
[19843]669 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
670
[19931]671 <target name="install-common-src" depends="init"
672 description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2). " >
[19894]673 <antcall target="configure-common-src"/>
674 <antcall target="compile-common-src"/>
675 <antcall target="install-auxiliary-jar-files"/>
676 <antcall target="install-jni-files"/>
677 </target>
[19878]678
[19894]679 <target name="install-collection-building" depends="init" if="collection.building.enabled"
680 description="Install (configure, compile, install) the Greenstone 2 collection building package." >
681 <antcall target="configure-collection-building"/>
[19931]682 <antcall target="tweak-makefiles" />
[19894]683 <antcall target="compile-collection-building"/>
684 </target>
685
[19878]686
[20209]687 <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core,compile-classpath-jars"
[19878]688 description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
689
690 <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
[15124]691 description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
692
693 <target name="configure" depends="init,configure-tomcat,configure-web"
[23855]694 description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file, including if you change the port number."/>
[15124]695
[20209]696 <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
[19878]697 description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
[15124]698
[20209]699 <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building,clean-classpath-jars"
[19878]700 description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
[15799]701
[19878]702 <target name="update" depends="init,svnupdate,clean,install"
703 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'"/>
[15124]704
[23854]705
706 <target name="perl-for-building" depends="init">
707 <!-- uses perl.path if set in build.properties, otherwise try for
708 environment variable PERLPATH, and failing that assumes 'perl'
709 is on environment PATH -->
[23856]710 <!-- if, outside build.properties, we only set perl.path if we have gs2build/build-src (collection building), then we won't set perl.path in a (flax) binary, since it doesn't have build-src -->
[23857]711 <if><bool><available file="${gs2build.home}"/></bool>
[23854]712
713 <if><bool><not><isset property="perl.path"/></not></bool>
714
715 <if>
716 <bool>
717 <and>
718 <isset property="env.PERLPATH"/>
719 <not><equals arg1="${env.PERLPATH}" arg2=""/></not>
720 </and>
721 </bool>
[27859]722 <!-- set perlpath to env.PERLPATH.
723 This is the path to perl\bin that's found by findperl.bat when the server is launched
724 through GLI instead of the console.
725 For windows, this env.PERLPATH is the bin folder and needs a backslash at end, since it
726 will appear suffixed with "perl.exe" in the perl setting in packages\tomcat\config\web.xml.
727 This web.xml's path to perl is then used to find perl when running the perl scripts in the
728 cgi folder, so without a slash appended at this point it becomes "binperl" in web.xml, and
729 things will break when GLI launches the server on Windows and the online GS3 metadata editor
730 is used to save user-edited metadata. -->
731 <if><bool><istrue value="${current.os.iswindows}"/></bool>
732 <property name="perl.path" value="${env.PERLPATH}\"/>
733 <else>
734 <property name="perl.path" value="${env.PERLPATH}"/>
735 </else>
736 </if>
737
[23854]738 <else>
739 <echo>
[23896]740 Using PATH environment variable to locate Perl.
[23854]741 </echo>
742 <exec executable="which" os="${os.unix}" spawn="false" outputproperty="full.perl.path">
743 <arg value="perl" />
744 </exec>
745
[28044]746 <exec executable="${gs2build.home}/bin/windows/which" osfamily="windows" spawn="false" outputproperty="full.perl.path">
[23941]747 <arg value="perl" />
748 </exec>
[23896]749
[25640]750 <stringutil string="${full.perl.path}" property="partial.perl.path">
751 <replace regex="\/[^\/]*$" replacement="/" />
[23854]752 </stringutil>
[27484]753 <stringutil string="${partial.perl.path}" property="perl.path">
[25640]754 <replace regex="\\[^\\]*$" replacement="\\" />
755 </stringutil>
[23896]756 <if><bool><istrue value="${current.os.isunix}"/></bool>
757 <if><bool><not><equals arg1="${full.perl.path}" arg2="/usr/bin/perl"/></not></bool>
758 <echo>
[23854]759 Non-standard location of Perl found: ${full.perl.path}
760 Set the environment variable PERLPATH or the perl.path property in
[27484]761 build.properties to explicitly control the version of Perl used.
[23896]762 </echo>
763 </if>
[23854]764 </if>
765 </else>
766 </if>
767 </if>
768
769 <!-- full.perl.path is for pretty-printing only, e.g. used in target "start" -->
770 <if><bool><isset property="perl.path"/></bool>
771 <property name="full.perl.path" value="${perl.path}${file.separator}perl"/>
772 <else>
773 <property name="full.perl.path" value="perl (will use the enviroment variable PATH to find this executable)"/>
774 </else>
775 </if>
[23857]776
777 <!-- gs2build not available, perl.path -->
778 <else>
779 <property name="perl.path" value=""/>
780 </else>
781 </if>
[27484]782 <stringutil string="${perl.path}" property="escaped.perl.path">
783 <replace regex="\\" replacement="\\\\" />
784 </stringutil>
[23854]785 </target>
786
[25549]787 <target name="get-default-servlet-url">
[29903]788 <echo>http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}</echo>
[29988]789 </target>
790
791 <target name="check-derbyserver-running">
792 <condition property="derby.isrunning" value="true" else="false">
793 <!--<socket server="jdbc:derby://${derby.server}" port="${derby.server.port}"/>-->
794 <socket server="${derby.server}" port="${derby.server.port}"/><!-- like telnet machine port -->
795 </condition>
796 <echo>Derby is running: ${derby.isrunning}</echo>
[29903]797 </target>
[29988]798
799 <target name="start-derby-java" depends="check-derbyserver-running">
800 <if><bool><not><istrue value="${derby.isrunning}"/></not></bool>
801 <echo>Launching derby on ${derby.server}:${derby.server.port}...</echo>
802 <java classname="org.apache.derby.drda.NetworkServerControl" fork="true" spawn="true" clonevm="true">
803 <arg value="start"/>
804 <classpath refid="derby.server.classpath"/>
805 </java>
806 <else>
807 <echo>Derby server ALREADY RUNNING on ${derby.server}:${derby.server.port}</echo>
808 </else>
809 </if>
810 </target>
[29903]811
812 <!-- Using derby 10.1.2.1
813 See db-derby-10.1.2.1-bin/docs/html/adminguide/index.html -->
[29988]814 <target name="start-derby" depends="check-derbyserver-running">
815 <if><bool><not><istrue value="${derby.isrunning}"/></not></bool>
816 <echo>About to launch derby on ${derby.server}:${derby.server.port}</echo>
817 <property name="derby.server.classpath.prop" refid="derby.server.classpath" />
818
819 <exec executable="java" spawn="true"><!-- failonerror="true"-->
820 <env key="CLASSPATH" path="${derby.server.classpath.prop}"/>
821 <arg value="org.apache.derby.drda.NetworkServerControl"/>
822 <arg value="start"/>
823 <arg value="-p"/>
824 <arg value="${derby.server.port}"/>
825 </exec>
826 <else>
827 <echo>Derby networked server ALREADY RUNNING on ${derby.server}:${derby.server.port}</echo>
828 </else>
829 </if>
[29903]830 </target>
831
[29988]832 <target name="force-stop-derby">
[29903]833 <java classname="org.apache.derby.drda.NetworkServerControl">
834 <arg value="shutdown"/>
835 <classpath refid="derby.server.classpath"/>
836 </java>
837 </target>
838
[29988]839 <target name="stop-derby" description="Shutdown derby server only if running" depends="check-derbyserver-running"><!-- if="${derby.isrunning}" checks if true or false only from ant 1.8 on -->
840 <if><bool><istrue value="${derby.isrunning}"/></bool>
841 <!--<echo>Derby is |${derby.isrunning}| running</echo>-->
842 <antcall target="force-stop-derby"/>
843 <else>
844 <echo>Derby is not running</echo>
845 </else>
846 </if>
847 </target>
848
[29903]849 <target name="start" depends="init,configure-tomcat,configure-web,configure-solr-ext,start-derby,start-tomcat"
[15124]850 description="Startup the Tomcat server." >
[15799]851 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
[16936]852 <echo>Tomcat: ${catalina.home}</echo>
853 <echo>Java : ${java.home}</echo>
[23849]854 <if><bool><available file="${build.src.home}"/></bool>
855 <echo>Perl : ${full.perl.path}</echo>
856 </if>
[23936]857 <if><bool><isset property="install.flax"/></bool>
858 <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/flax"/>
859 <else>
860 <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/"/>
861 </else>
862 </if>
863 <echo>URL : ${url}</echo>
[15799]864 <!-- assuming that index.html is not needed here -->
[26033]865
866 <!--Now write out the url with oaiserver suffix as the baseURL property in OAIConfig.xml-->
[29268]867 <available file="${basedir}/resources/oai/OAIConfig.xml" property="oaiconfig.present"/>
[26033]868 <antcall target="init-oaiconfig">
869 <param name="url" value="${url}"/>
870 </antcall>
[15124]871 </target>
872
[26033]873 <target name="init-oaiconfig" if="oaiconfig.present">
[27829]874 <echo>Writing out baseURL ${url}oaiserver to ${web.writableclasses}/OAIConfig.xml</echo>
[29268]875 <copy file="${basedir}/resources/oai/OAIConfig.xml" tofile="${web.writableclasses}/OAIConfig.xml"/>
[28136]876 <rsr verbosity="1" file="${web.writableclasses}/OAIConfig.xml" pattern="&lt;baseURL&gt;.*&lt;/baseURL&gt;" replacement="&lt;baseURL&gt;${url}oaiserver&lt;/baseURL&gt;" />
[26033]877 </target>
878
[29903]879 <target name="stop" depends="init,stop-tomcat,stop-derby"
[15124]880 description="Shutdown the Tomcat server."/>
881
882 <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
883
[15799]884 <!-- =========== Help targets =================================== -->
[15124]885
886 <property name="install-command" value="ant [options] prepare install"/>
887
888 <target name="usage" description="Print a help message">
889 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
890 <echo message=" Execute 'ant -help' for Ant help."/>
[23849]891 <echo>
892 To install Greenstone3, run '${install-command}'.
893 There are properties defined in build.properties. The install
894 process will ask you if these properties are set correctly.
895 To avoid this prompt, use the '-Dproperties.accepted=yes'
896 option.
897 To log the output, use the '-logfile build.log' option.
898 The README.txt file has more information about the ant targets
899 and install process.
[15124]900 </echo>
901 </target>
902
903 <target name="help" depends="usage" description="Print a help message"/>
904
905 <target name="debug" depends="init" description="Display all the currently used properties">
906 <echoproperties/>
907 </target>
908
[15799]909 <!-- ====== initialization and setup targets ================== -->
[15124]910
911 <target name="accept-properties" unless="properties.accepted">
912 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
[15799]913 tomcat.server=${tomcat.server}
914 tomcat.port=${tomcat.port}
915 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
916 proxy.host=${proxy.host}
917 proxy.port=${proxy.port}
[19878]918 disable.collection.building=${disable.collection.building}
[19910]919 If these are not acceptable, please change them and rerun this target. Continue [y/n]?
[15124]920 </input>
921 <condition property="do.abort">
922 <equals arg1="n" arg2="${properties.ok}"/>
923 </condition>
924 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
925 </target>
[20085]926
[15124]927 <!-- this sets up some initial properties -->
928 <target name="init">
929
[20085]930 <!-- has the gs3-setup script been run?? -->
931 <condition property="gs3-setup-not-done">
932 <not>
933 <isset property="env.GSDL3HOME"/>
934 </not>
935 </condition>
936
[20092]937 <!--<fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>-->
[20085]938
[15124]939 <condition property="java.too.old">
940 <or>
[16936]941 <equals arg1="1.1" arg2="${ant.java.version}"/>
942 <equals arg1="1.2" arg2="${ant.java.version}"/>
943 <equals arg1="1.3" arg2="${ant.java.version}"/>
[15124]944 </or>
945 </condition>
[20208]946 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
[15124]947
948 <available file="${basedir}/gli" property="gli.present"/>
[19878]949 <available file="${basedir}/common-src" property="common.src.present"/>
[15124]950 <available file="${basedir}/gs2build" property="gs2build.present"/>
[28643]951 <available file="${gnome-lib-dir}" property="gnome-lib.present"/>
[15124]952
953 <condition property="tomcat.islocal">
954 <or>
[16936]955 <not><isset property="tomcat.installed.path"/></not>
956 <equals arg1="" arg2="${tomcat.installed.path}"/>
[15124]957 </or>
958 </condition>
959
[15799]960 <echo>tomcat.port = ${tomcat.port}</echo>
[15124]961
962 <condition property="proxy.present">
963 <and>
[16936]964 <isset property="proxy.host"/>
965 <not><equals arg1="" arg2="${proxy.host}"/></not>
[15124]966 </and>
967 </condition>
968
[20235]969 <!--
[20290]970 the next block checks if the bundled tomcat is present in the 'packages' directory,
[25131]971 and checks for the lethal combination of tomcat 7 and java 1.4. Test for
[20290]972 tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
973 download, as there is no other surefire way to check tomcat version under java 1.4
[20235]974 -->
975 <condition property="packages.tomcat.ispresent" value="true" else="false">
976 <available file="packages/tomcat"/>
977 </condition>
[25131]978 <condition property="packages.tomcat.istomcat7" value="true" else="false">
979 <available file="packages/tomcat/tomcat7.txt"/>
[20290]980 </condition>
[20235]981 <if>
982 <bool>
[20290]983 <and>
984 <istrue value="${packages.tomcat.ispresent}"/>
[25131]985 <istrue value="${packages.tomcat.istomcat7}"/>
[20290]986 <equals arg1="1.4" arg2="${ant.java.version}"/>
987 </and>
[20235]988 </bool>
[20290]989 <fail>Your Java (version 1.4) is too old to work with the bundled Apache Tomcat (version 6). Please upgrade to Java version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
[20235]990 </if>
991
[15124]992 </target>
993
994 <target name="setup-proxy" depends="init" if="proxy.present">
995 <condition property="ask.user">
996 <or>
[16936]997 <equals arg1="" arg2="${proxy.user}"/>
998 <equals arg1="" arg2="${proxy.password}"/>
[15124]999 </or>
1000 </condition>
[19878]1001
[15124]1002 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
1003 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
1004 </target>
1005
[28904]1006 <target name="copy-dot-in-files" depends="init"
1007 description="Copies all resources .in files to version without the .in suffix" >
1008 <if><bool><available file="${basedir}/resources/tomcat/greenstone3.xml"/></bool>
1009 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${basedir}/resources/tomcat/greenstone3.xml.backup" overwrite="true"/>
1010 </if>
1011
1012 <copy file="${basedir}/resources/tomcat/greenstone3.xml.in" tofile="${basedir}/resources/tomcat/greenstone3.xml" overwrite="true"/>
1013 <if><bool><available file="${basedir}/resources/tomcat/server_tomcat5.xml"/></bool>
1014 <copy file="${basedir}/resources/tomcat/server_tomcat5.xml" tofile="${basedir}/resources/tomcat/server_tomcat5.xml.backup" overwrite="true"/>
1015 </if>
1016 <copy file="${basedir}/resources/tomcat/server_tomcat5.xml.in" tofile="${basedir}/resources/tomcat/server_tomcat5.xml" overwrite="true"/>
1017 <if><bool><available file="${basedir}/resources/tomcat/server_tomcat7.xml"/></bool>
1018 <copy file="${basedir}/resources/tomcat/server_tomcat7.xml" tofile="${basedir}/resources/tomcat/server_tomcat7.xml.backup" overwrite="true"/>
1019 </if>
1020 <copy file="${basedir}/resources/tomcat/server_tomcat7.xml.in" tofile="${basedir}/resources/tomcat/server_tomcat7.xml" overwrite="true"/>
1021 <if><bool><available file="${basedir}/resources/tomcat/web.xml"/></bool>
1022 <copy file="${basedir}/resources/tomcat/web.xml" tofile="${basedir}/resources/tomcat/web.xml.backup" overwrite="true"/>
1023 </if>
1024 <copy file="${basedir}/resources/tomcat/web.xml.in" tofile="${basedir}/resources/tomcat/web.xml" overwrite="true"/>
1025 <if><bool><available file="${basedir}/resources/oai/OAIConfig.xml"/></bool>
1026 <copy file="${basedir}/resources/oai/OAIConfig.xml" tofile="${basedir}/resources/oai/OAIConfig.xml.backup" overwrite="true"/>
1027 </if>
1028 <copy file="${basedir}/resources/oai/OAIConfig.xml.in" tofile="${basedir}/resources/oai/OAIConfig.xml" overwrite="true"/>
[28907]1029 <if><bool><available file="${basedir}/resources/cgi/gsdl3site.cfg"/></bool>
1030 <copy file="${basedir}/resources/cgi/gsdl3site.cfg" tofile="${basedir}/resources/cgi/gsdl3site.cfg.backup" overwrite="true"/>
1031 </if>
1032 <copy file="${basedir}/resources/cgi/gsdl3site.cfg.in" tofile="${basedir}/resources/cgi/gsdl3site.cfg" overwrite="true"/>
[28937]1033 <if><bool><available file="${basedir}/resources/web/global.properties"/></bool>
1034 <copy file="${basedir}/resources/web/global.properties" tofile="${basedir}/resources/web/global.properties.backup" overwrite="true"/>
[28908]1035 </if>
[28937]1036 <copy file="${basedir}/resources/web/global.properties.in" tofile="${basedir}/resources/web/global.properties" overwrite="true"/>
1037 <if><bool><available file="${basedir}/resources/web/log4j.properties"/></bool>
1038 <copy file="${basedir}/resources/web/log4j.properties" tofile="${basedir}/resources/web/log4j.properties.backup" overwrite="true"/>
[28908]1039 </if>
[28937]1040 <copy file="${basedir}/resources/web/log4j.properties.in" tofile="${basedir}/resources/web/log4j.properties" overwrite="true"/>
[28904]1041 </target>
[15799]1042 <!-- ========== Web app Targets ================================ -->
1043
[20089]1044 <target name="prepare-web" depends="init">
[27829]1045 <mkdir dir="${web.writablehome}/applet"/>
1046 <mkdir dir="${web.writablehome}/logs"/>
1047 <mkdir dir="${web.writablehome}/logs/tmp"/>
[15124]1048 </target>
1049
[24607]1050 <!-- 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.
1051 The test for whether we need it assumes we won't be trying to compile GS3 against Java versions less than 1.4. -->
[15124]1052 <target name="configure-java-version" depends="init"
[15139]1053 description="Activates or deactivates some jar libraries as needed depending on your java version">
[15136]1054
[15799]1055 <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
[15124]1056 <condition property="need.xalan.jar">
[15799]1057 <or>
[24607]1058 <not><equals arg1="1.4" arg2="${ant.java.version}"/></not>
[15799]1059 </or>
1060 </condition>
[15136]1061
[15799]1062 <!-- if they have xalan.jar but dont need it -->
1063 <if>
1064 <bool>
[16936]1065 <and>
1066 <isset property="have.xalan.jar"/>
1067 <not><isset property="need.xalan.jar"/></not>
1068 </and>
[15799]1069 </bool>
1070 <antcall target="deactivate-xalan-jar"/>
1071 </if>
[15136]1072
[15799]1073 <!-- if they need xalan.jar but dont have it -->
1074 <if>
1075 <bool>
[16936]1076 <and>
1077 <not><isset property="have.xalan.jar"/></not>
1078 <isset property="need.xalan.jar"/>
1079 </and>
[15799]1080 </bool>
1081 <antcall target="activate-xalan-jar"/>
1082 </if>
[15136]1083
[15124]1084 </target>
1085
[15139]1086 <target name="activate-xalan-jar">
[15799]1087 <echo>activating xalan.jar</echo>
[15124]1088 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
[20085]1089 <if>
1090 <bool>
1091 <and>
1092 <isset property="current.os.ismac"/>
1093 <available file="${catalina.home}/common/endorsed" type="dir"/>
1094 </and>
1095 </bool>
1096 <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
[15799]1097 </if>
[15124]1098 </target>
[15035]1099
[15139]1100 <target name="deactivate-xalan-jar">
[15799]1101 <echo>deactivating xalan.jar</echo>
[15124]1102 <delete file="${web.lib}/xalan.jar"/>
[20089]1103 <!-- should we be deleting common/endorsed/xalan.jar on mac?? -->
[15124]1104 </target>
1105
[15837]1106
[25491]1107 <target name="prepare-collections" depends="init"
1108 description="Unpack all the collections from their svn zipped versions">
[16936]1109 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
[17008]1110 <property name="index.zip" value="index.zip"/>
[15799]1111
[16936]1112 <echo message="installing collections..."/>
1113 <antcall target="gs2mgdemo-install"/>
1114 <antcall target="gs2mgppdemo-install"/>
1115 <antcall target="gberg-install"/>
[25214]1116 <antcall target="lucene-jdbm-demo-install"/>
[16936]1117 </target>
[15837]1118
[16936]1119 <target name="gs2mgdemo-prepare" if="collect.dir">
1120 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
[15799]1121
[16936]1122 <condition property="gs2mgdemo.present">
1123 <and>
[15837]1124 <available file="${gs2mgdemo.dir}/${index.zip}"/>
[16936]1125 </and>
1126 </condition>
1127 </target>
[15799]1128
[17008]1129 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
1130 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
[16936]1131 <echo>collection gs2mgdemo installed</echo>
1132 </target>
[15799]1133
[16936]1134 <target name="gs2mgppdemo-prepare" if="collect.dir">
1135 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
[15837]1136
[16936]1137 <condition property="gs2mgppdemo.present">
1138 <and>
[15837]1139 <available file="${gs2mgppdemo.dir}/${index.zip}"/>
[16936]1140 </and>
1141 </condition>
1142 </target>
[15799]1143
[16936]1144 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
[17008]1145 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
[16936]1146 <echo>collection gs2mgppdemo installed</echo>
1147 </target>
[15799]1148
[16936]1149 <target name="gberg-prepare" if="collect.dir">
1150 <property name="gberg.dir" value="${collect.dir}/gberg"/>
[17008]1151 <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
[16936]1152 </target>
[15799]1153
[16936]1154 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
[19878]1155 <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
[16936]1156 <echo>collection gberg installed</echo>
1157 </target>
[15799]1158
[25214]1159 <target name="lucene-jdbm-demo-prepare" if="collect.dir">
1160 <property name="lucene-jdbm-demo.dir" value="${collect.dir}/lucene-jdbm-demo"/>
[25491]1161 <available file="${lucene-jdbm-demo.dir}/${index.zip}" property="lucene-jdbm-demo.present"/>
[25214]1162 </target>
1163
1164 <target name="lucene-jdbm-demo-install" if="lucene-jdbm-demo.present" depends="lucene-jdbm-demo-prepare">
[25491]1165 <unzip dest="${lucene-jdbm-demo.dir}" src="${lucene-jdbm-demo.dir}/${index.zip}"/>
[25214]1166 <echo>collection lucene-jdbm-demo installed</echo>
1167 </target>
1168
[27846]1169
[28115]1170 <target name="install-solr-ext" depends="init" >
[28044]1171 <exec executable="ant.bat" osfamily="windows" dir="${solr-ext.home}" spawn="false">
[27846]1172 <arg value="add-service"/>
1173 </exec>
[27849]1174 <exec executable="ant" os="${os.unix}" dir="${solr-ext.home}" spawn="false">
1175 <arg value="add-service"/>
1176 </exec>
[27846]1177 <antcall target="solr-jdbm-demo-install"/>
1178 </target>
1179
1180 <target name="solr-jdbm-demo-prepare" if="collect.dir">
1181 <property name="solr-jdbm-demo.dir" value="${collect.dir}/solr-jdbm-demo"/>
1182 <available file="${solr-jdbm-demo.dir}/${index.zip}" property="solr-jdbm-demo.present"/>
1183 </target>
1184
1185 <target name="solr-jdbm-demo-install" if="solr-jdbm-demo.present" depends="solr-jdbm-demo-prepare">
1186 <unzip dest="${solr-jdbm-demo.dir}" src="${solr-jdbm-demo.dir}/${index.zip}"/>
1187 <echo>collection solr-jdbm-demo installed</echo>
1188 </target>
1189
[28612]1190 <!-- Until 64 bit Linux and Mac (Lion) machines can generate a working IsisGdl,
1191 use the ones generated on a 32 bit Linux and Mac (Leopard), respectively -->
[28952]1192 <target name="get-isisgdl" if="${current.os.isunix}">
[28613]1193 <exec executable="uname" dir="${basedir}" failonerror="false"
[28612]1194 outputproperty="uname.val">
1195 <arg value="-m"/>
1196 </exec>
1197
1198 <if><bool><equals arg1="${uname.val}" arg2="x86_64"/></bool>
1199 <echo>Bitness: ${uname.val}</echo>
1200 <if><bool><contains string="${os.bin.dir}" substring="darwin" casesensitive="false"/></bool>
1201 <get src="http://www.greenstone.org/caveat-emptor/IsisGdl.macleopard"
1202 dest="${basedir}/gs2build/bin/${os.bin.dir}/IsisGdl"/>
1203 </if>
1204 <if><bool><contains string="${os.bin.dir}" substring="linux" casesensitive="false"/></bool>
1205 <get src="http://www.greenstone.org/caveat-emptor/IsisGdl.bin32"
1206 dest="${basedir}/gs2build/bin/${os.bin.dir}/IsisGdl"/>
1207 </if>
[28611]1208 <chmod file="${basedir}/gs2build/bin/${os.bin.dir}/IsisGdl" perm="755"/>
1209 </if>
1210 </target>
[27846]1211
[27484]1212 <target name="set-perl-shebangs" depends="perl-for-building">
1213 <if>
1214 <bool>
1215 <and><isset property="perl.path"/>
1216 <not><equals arg1="${perl.path}" arg2=""/></not>
1217 </and>
1218 </bool>
1219
1220 <if><bool><istrue value="${current.os.iswindows}"/></bool>
[27486]1221 <property name="perl.exec" value="${perl.path}perl.exe"/>
[27484]1222 <else>
[27486]1223 <property name="perl.exec" value="${perl.path}perl"/>
[27484]1224 </else>
1225 </if>
1226
1227 <!--<echo>**** PERLPATH: ${perl.path}</echo>-->
[28158]1228 <echo>Setting perl shebangs to Perl Exec: ${perl.exec}</echo>
[27484]1229
1230 <!-- set the shebangs in the cgi files to point to the correct perlpath -->
[27829]1231 <if>
1232 <bool><not><equals arg1="${web.home}" arg2="${web.writablehome}"></equals></not></bool>
1233 <mkdir dir="${web.writablehome}"/>
1234 <copy file="${web.home}/WEB-INF/cgi/gliserver.pl" tofile="${web.writablehome}/WEB-INF/cgi/gliserver.pl" overwrite="true"/>
1235 <copy file="${web.home}/WEB-INF/cgi/metadata-server.pl" tofile="${web.writablehome}/WEB-INF/cgi/metadata-server.pl" overwrite="true"/>
1236 <copy file="${web.home}/WEB-INF/cgi/checksum.pl" tofile="${web.writablehome}/WEB-INF/cgi/checksum.pl" overwrite="true"/>
1237 </if>
1238
[28136]1239 <rsr verbosity="1" file="${web.writablehome}/WEB-INF/cgi/gliserver.pl" pattern="^#!.*" replacement="#!${perl.exec} -w" lines="1"/>
1240 <rsr verbosity="1" file="${web.writablehome}/WEB-INF/cgi/metadata-server.pl" pattern="^#!.*" replacement="#!${perl.exec} -w" lines="1"/>
1241 <rsr verbosity="1" file="${web.writablehome}/WEB-INF/cgi/checksum.pl" pattern="^#!.*" replacement="#!${perl.exec} -w" lines="1"/>
[27484]1242 <else>
[27829]1243 <echo>WARNING: perl.path is empty. Unable to set the shebangs in the perl files in ${web.writablehome}/WEB-INF/cgi</echo>
[27484]1244 </else>
1245 </if>
1246 </target>
1247
[23854]1248 <target name="configure-web" depends="init,perl-for-building"
[15124]1249 description="Configure only the web app config files">
1250 <!-- we want a unix path in the global.properties file -->
1251 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
1252 <path path="${web.home}"/>
1253 </pathconvert>
[27829]1254 <pathconvert targetos="unix" property="src.gsdl3.writablehome.unix">
1255 <path path="${web.writablehome}"/>
1256 </pathconvert>
[27484]1257
1258 <antcall target="set-perl-shebangs" inheritAll="true" />
[24868]1259
[25830]1260 <filter token="gsdlhome" value="${gs2build.home}"/>
1261 <filter token="gsdl3srchome" value="${basedir}"/>
[15124]1262 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
[27829]1263 <filter token="gsdl3writablehome" value="${src.gsdl3.writablehome.unix}"/>
[15124]1264 <filter token="gsdl3version" value="${app.version}"/>
1265 <filter token="tomcat.server" value="${tomcat.server}"/>
1266 <filter token="tomcat.port" value="${tomcat.port}"/>
[29977]1267 <filter token="derbyserver" value="${derby.server}"/>
[29903]1268 <filter token="derbyserver.port" value="${derby.server.port}"/>
[24868]1269 <filter token="perlpath" value="${escaped.perl.path}"/>
[27484]1270 <filter token="disable.collection.building" value="${disable.collection.building}"/>
[28907]1271 <copy file="${basedir}/resources/cgi/gsdl3site.cfg" tofile="${web.writablehome}/WEB-INF/cgi/gsdl3site.cfg" filtering="true" overwrite="true"/>
[28937]1272 <copy file="${basedir}/resources/web/global.properties" tofile="${web.writableclasses}/global.properties" filtering="true" overwrite="true"/>
1273 <copy file="${basedir}/resources/web/log4j.properties" tofile="${web.writableclasses}/log4j.properties" filtering="true" overwrite="true"/>
[27829]1274 <if><bool><istrue value="${gsdl3home.isreadonly}"/></bool>
1275 <!-- uncomment the writablehome properties -->
[28136]1276 <rsr verbosity="1" file="${web.writableclasses}/global.properties" pattern="^#gsdl3\.(writable{1})?home" replacement="gsdl3.$1home" />
[27829]1277 </if>
1278 <chmod file="${web.writableclasses}/global.properties" perm="644"/>
1279 <chmod file="${web.writableclasses}/log4j.properties" perm="644"/>
[15124]1280 </target>
1281
1282 <target name="compile-web" depends="init">
1283 <javac srcdir="${web.classes}"
1284 destdir="${web.classes}"
[28137]1285 includeantruntime="${compile.includeantruntime}"
[15124]1286 debug="${compile.debug}"
1287 deprecation="${compile.deprecation}"
[29515]1288 optimize="${compile.optimize}"
1289 encoding="${compile.encoding}">
[16936]1290 <classpath><path refid="compile.classpath"/></classpath>
[15124]1291 </javac>
1292 </target>
1293
[20209]1294 <target name="compile-classpath-jars" depends="init">
1295 <if><bool><available file="admin/cp.mf"/></bool>
1296 <jar destfile="admin/cp.jar" manifest="admin/cp.mf"/>
1297 </if>
1298 <if><bool><available file="${lib.java}/cp.mf"/></bool>
1299 <jar destfile="${lib.java}/cp.jar" manifest="${lib.java}/cp.mf"/>
1300 </if>
1301 <if><bool><available file="${lib.jni}/cp.mf"/></bool>
1302 <jar destfile="${lib.jni}/cp.jar" manifest="${lib.jni}/cp.mf"/>
1303 </if>
1304 <if><bool><available file="${web.lib}/cp.mf"/></bool>
1305 <jar destfile="${web.lib}/cp.jar" manifest="${web.lib}/cp.mf"/>
1306 </if>
1307 <jar destfile="cp.jar">
1308 <manifest>
[20211]1309 <attribute name="Class-Path" value="server.jar admin/cp.jar lib/java/cp.jar lib/jni/cp.jar web/WEB-INF/lib/cp.jar"/>
[20209]1310 </manifest>
1311 </jar>
1312 </target>
1313
1314 <target name="clean-classpath-jars" depends="init">
1315 <delete file="admin/cp.jar"/>
1316 <delete file="${lib.java}/cp.jar"/>
1317 <delete file="${lib.jni}/cp.jar"/>
1318 <delete file="${web.lib}/cp.jar"/>
1319 <delete file="cp.jar"/>
1320 </target>
1321
1322
[15799]1323 <target name="svnupdate-web" unless="nosvn.mode">
[20930]1324 <exec executable="svn">
1325 <arg value="update"/>
[27829]1326 <arg value="${web.writablehome}"/>
[20930]1327 <arg value="-r"/><arg value="${branch.revision}"/>
1328 </exec>
[15799]1329 </target>
[15124]1330
1331 <target name="update-web" depends="init,svnupdate-web,configure-web"
1332 description="update only the web stuff (config files)"/>
1333
[15799]1334 <!-- ======================= Tomcat Targets ========================== -->
[15124]1335
1336 <!-- this target downloads and installs Tomcat -->
[25131]1337 <!-- we download tomcat (version 7 for Java 1.5 and later, version 5 for Java 1.4 plus the 1.4 compatibility package). -->
[20089]1338 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"
[25131]1339 description="downloads the appropriate version of Tomcat (Tomcat 5 if using Java 1.4, Tomcat 7 if using Java 1.5 or higher). If you want to change which version of Java you are using between 1.4 and 1.5/7 then you need to run prepare-tomcat">
1340 <if>
[16951]1341 <bool>
1342 <not><available file="${packages.home}/tomcat/.flagfile"/></not>
1343 </bool>
1344
1345 <!-- check that packages dir is there -->
1346 <mkdir dir="${packages.home}"/>
1347 <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
1348 dest="${packages.home}/${tomcat.version}.zip"
1349 usetimestamp="true"/>
1350 <unzip src="${packages.home}/${tomcat.version}.zip"
1351 dest="${packages.home}"/>
[20085]1352
1353 <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
1354 we would need to have the tomcat compat package to work with Java 1.4-->
1355 <if>
1356 <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
1357 <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
1358 dest="${packages.home}/${tomcat.version}-compat.zip"
1359 usetimestamp="true"/>
1360 <unzip src="${packages.home}/${tomcat.version}-compat.zip"
1361 dest="${packages.home}"/>
1362 </if>
1363
[16951]1364 <!-- delete any existing tomcat -->
1365 <delete dir="${packages.home}/tomcat"/>
1366 <move todir="${packages.home}/tomcat">
1367 <fileset dir="${packages.home}/${tomcat.version}"/>
1368 </move>
[25133]1369 <!--
[16951]1370 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
1371 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
1372 overwrite="true"/>
1373 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
1374 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
1375 overwrite="true"/>
[25133]1376 -->
[16951]1377 <!-- make sure we have execute permission for the .sh files -->
1378 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
1379 includes="*.sh"/>
1380
1381 <echo file="${packages.home}/tomcat/.flagfile">
1382 the timestamp of this file is the time that tomcat was extracted from the zip files.
1383 it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
1384 </echo>
1385
[20089]1386 <!-- this is not strictly a prepare tomcat thing, but if one changes
1387 Java, then they need to change tomcat as well, so might as well call
1388 it here -->
1389 <antcall target="configure-java-version"/>
[16951]1390 <else>
1391 <echo>Tomcat has been prepared, will not prepare</echo>
1392 <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
1393 </else>
1394
1395 </if>
1396
[15124]1397 </target>
1398
1399 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
1400
[25570]1401 <target name="configure-tomcat-local" depends="init,perl-for-building" if="tomcat.islocal">
[15124]1402 <!-- re-setup the server.xml file -->
[20079]1403 <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml"
1404 tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
[15124]1405 <filterset>
[16936]1406 <filter token="port" value="${tomcat.port}"/>
1407 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
[15124]1408 </filterset>
1409 </copy>
[28297]1410 <!-- set up the greenstone3 context, it may have a custom name specified in build.properties -->
1411 <if><bool><not><equals arg1="greenstone3" arg2="${custom.context}"></equals></not></bool>
1412 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${basedir}/resources/tomcat/${custom.context}.xml" overwrite="true"/>
1413 </if>
1414 <copy file="${basedir}/resources/tomcat/${custom.context}.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/${custom.context}.xml" overwrite="true">
[15124]1415 <filterset>
[16936]1416 <filter token="gsdl3webhome" value="${web.home}"/>
[27829]1417 <filter token="gsdl3webwritablehome" value="${web.writablehome}"/>
[29845]1418 <filter token="privilegedattribute" value="${privileged.attribute}"/>
1419 <filter token="allowedIPs" value="${allowed.IPs}"/>
[29977]1420 <filter token="derbyserver" value="${derby.server}"/>
[29903]1421 <filter token="derbyserverport" value="${derby.server.port}"/>
[15124]1422 </filterset>
1423 </copy>
[28297]1424 <if>
1425 <bool>
1426 <and>
1427 <available file="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml"/>
1428 <not><equals arg1="greenstone3" arg2="${custom.context}"></equals></not>
1429 </and>
1430 </bool>
1431 <delete file="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml"/>
1432 </if>
[25570]1433
[27860]1434 <!-- set up the greenstone3 web.xml file -->
1435 <copy file="${basedir}/resources/tomcat/web.xml" tofile="${packages.home}/tomcat/conf/web.xml" overwrite="true">
1436 <filterset>
1437 <filter token="perlpath" value="${perl.path}"/>
1438 </filterset>
1439 </copy>
[15124]1440 </target>
[28297]1441
[15124]1442 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
1443 <!-- re-setup the server.xml file -->
1444 <!-- need to edit the config file, or do we get the user to do this???-->
1445 </target>
[26495]1446
[27860]1447 <target name="configure-solr-ext" depends="init" >
1448 <!-- re-setup the web/ext/solr/solr.xml file -->
[28178]1449 <copy file="${web.home}/ext/solr/solr.xml.in"
[27866]1450 tofile="${gsdl3.writablehome}/ext/solr/solr.xml" filtering="true" overwrite="true">
[27860]1451 <filterset>
1452 <filter token="gsdl3.home" value="${src.gsdl3.home.unix}"/>
1453 <filter token="gsdl3.writablehome" value="${src.gsdl3.writablehome.unix}"/>
1454 </filterset>
1455 </copy>
1456 </target>
[22551]1457
[26495]1458 <!-- This target runs tomcat's "bin/catalina.bat(.sh) jpda start"
1459 to allow debugging the running GS3 server in Eclipse. See the instructions at
1460 http://www.wikijava.org/wiki/Debugging_a_servlet_with_tomcat_and_Eclipse_tutorial
1461 on how to use this with eclipse
1462 -->
1463 <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="init" if="tomcat.islocal">
1464 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
1465 <property name="tomcat.path" refid="local.tomcat.path"/>
1466
1467 <if><bool>
1468 <isset property="fedora.maxpermsize"/></bool>
1469 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M ${fedora.maxpermsize}"/>
1470 <else>
1471 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
1472 </else>
1473 </if>
1474
[27829]1475 <echo file="${catalina.home}/bin/setenv.bat">set CLASSPATH=${tomcat.classpath}</echo>
1476 <echo file="${catalina.home}/bin/setenv.sh">export CLASSPATH=${tomcat.classpath}</echo>
[26495]1477
1478 <exec executable="${catalina.home}/bin/catalina.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
1479 <arg value="jpda" />
1480 <arg value="start" />
1481 <env key="JPDA_ADDRESS" value="8000"/> <!-- for debugging Tomcat in Eclipse -->
1482 <env key="JPDA_TRANSPORT" value="dt_socket"/> <!-- for debugging Tomcat in Eclipse -->
1483 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
1484 <env key="PATH" path="${tomcat.path}"/>
1485 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1486 <env key="CATALINA_HOME" value="${catalina.home}"/>
1487 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1488 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
1489 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
1490 <env key="WNHOME" path="${wn.home}"/>
1491 <env key="FEDORA_HOME" path="${fedora.home}"/>
1492 </exec>
[28044]1493 <exec executable="${catalina.home}/bin/catalina.bat" osfamily="windows" dir="${catalina.home}/bin" spawn="true">
[26495]1494 <arg value="jpda" />
1495 <arg value="start" />
1496 <env key="JPDA_ADDRESS" value="8000"/> <!-- for debugging Tomcat in Eclipse -->
1497 <env key="JPDA_TRANSPORT" value="dt_socket"/> <!-- for debugging Tomcat in Eclipse -->
1498 <env key="GSDLOS" value="windows"/>
1499 <env key="GSDL3HOME" value="${basedir}"/>
1500 <env key="Path" path="${tomcat.path}"/>
1501 <env key="PATH" path="${tomcat.path}"/>
1502 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1503 <env key="CATALINA_HOME" value="${catalina.home}"/>
1504 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1505 <env key="FEDORA_HOME" path="${fedora.home}"/>
1506 </exec>
1507 <!-- wait for the server to startup in case other targets need it running -->
1508 <waitfor maxwait="5" maxwaitunit="second">
1509 <and>
1510 <socket server="${tomcat.server}" port="${tomcat.port}"/>
1511 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
1512 </and>
1513 </waitfor>
1514 </target>
[23854]1515
1516
[27829]1517 <!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
[29988]1518 <target name="start-tomcat" description="Startup only Tomcat" depends="init,check-tomcat-running" if="tomcat.islocal">
1519 <if><bool><istrue value="${tomcat.isrunning}"/></bool>
1520 <echo>**************************************</echo>
1521 <echo>A TOMCAT IS ALREADY RUNNING ON http://${tomcat.server}:${tomcat.port}. NOT STARTING.</echo>
1522 <echo>**************************************</echo>
1523 <else>
[15799]1524 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
[15124]1525 <property name="tomcat.path" refid="local.tomcat.path"/>
[25095]1526
[26359]1527 <if><bool>
1528 <isset property="fedora.maxpermsize"/></bool>
1529 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M ${fedora.maxpermsize}"/>
1530 <else>
1531 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
1532 </else>
1533 </if>
1534
[27829]1535 <echo file="${catalina.home}/bin/setenv.bat">set CLASSPATH=${tomcat.classpath}</echo>
1536 <echo file="${catalina.home}/bin/setenv.sh">export CLASSPATH=${tomcat.classpath}</echo>
[28043]1537
1538 <!-- using osfamily instead of testing os against os.windows list of recognised windows versions
[28044]1539 so that future windows versions are included. See http://simonharrer.wordpress.com/tag/osfamily/
1540 Can't use the osfamily test for linux-type machines as a group since osfamily=unix is separate from osfamily=mac,
1541 see http://ant-contrib.sourceforge.net/tasks/tasks/osfamily.html -->
[28043]1542
[21351]1543 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
[15124]1544 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
1545 <env key="GSDL3HOME" value="${basedir}"/>
1546 <env key="PATH" path="${tomcat.path}"/>
1547 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1548 <env key="CATALINA_HOME" value="${catalina.home}"/>
1549 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1550 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
[22184]1551 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
[15124]1552 <env key="WNHOME" path="${wn.home}"/>
[26433]1553 <env key="FEDORA_HOME" path="${fedora.home}"/>
[15124]1554 </exec>
[28043]1555 <exec executable="${catalina.home}/bin/startup.bat" osfamily="windows" dir="${catalina.home}/bin" spawn="true">
[15124]1556 <env key="GSDLOS" value="windows"/>
1557 <env key="GSDL3HOME" value="${basedir}"/>
1558 <env key="Path" path="${tomcat.path}"/>
1559 <env key="PATH" path="${tomcat.path}"/>
1560 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
[16628]1561 <env key="CATALINA_HOME" value="${catalina.home}"/>
[15124]1562 <env key="CLASSPATH" path="${tomcat.classpath}"/>
[26433]1563 <env key="FEDORA_HOME" path="${fedora.home}"/>
[15124]1564 </exec>
1565 <!-- wait for the server to startup in case other targets need it running -->
1566 <waitfor maxwait="5" maxwaitunit="second">
1567 <and>
[16936]1568 <socket server="${tomcat.server}" port="${tomcat.port}"/>
1569 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
[15124]1570 </and>
1571 </waitfor>
[29988]1572
1573 </else>
1574 </if>
[15124]1575 </target>
1576
[22551]1577 <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html-->
1578 <target name="reconfigure" description="Reconfigure the message router">
1579 <waitfor maxwait="5" maxwaitunit="second">
1580 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c"/>
1581 </waitfor>
1582 </target>
1583
1584 <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794-->
1585 <target name="reconfigure-collection" description="Reconfigure the collection">
1586 <waitfor maxwait="5" maxwaitunit="second">
1587 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c&amp;sc=${collection}"/>
1588 </waitfor>
1589 </target>
1590
[15124]1591 <!-- windows: do we want to launch a webrowser?? -->
[25418]1592 <!-- shouldn't this test whether anything is running first?
1593 It's safer to always attempt to stop tomcat: that way we won't be dependent on the right time
1594 to check whether the server is stopped or still running before attempting to start again.
1595 This target, which was recently called force-stop-tomcat for a while but is back to being
1596 called stop-tomcat, now hides the Java exception output that appears whenever tomcat is already
1597 stopped as happens when stop-tomcat is called consecutively. -->
[25420]1598 <target name="force-stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
[21351]1599 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
[26433]1600 <env key="FEDORA_HOME" path="${fedora.home}"/>
[15124]1601 <env key="CATALINA_HOME" value="${catalina.home}"/>
[25418]1602 <arg line=">/dev/null 2>&amp;1"/>
[15124]1603 </exec>
[28043]1604 <exec executable="${catalina.home}/bin/shutdown.bat" osfamily="windows" dir="${catalina.home}/bin" spawn="false">
[26433]1605 <env key="FEDORA_HOME" path="${fedora.home}"/>
[16628]1606 <env key="CATALINA_HOME" value="${catalina.home}"/>
[25418]1607 <arg line=">nul 2>&amp;1"/>
[25443]1608 </exec>
[15124]1609 </target>
1610
[25418]1611 <!-- Can also try the "socket" condition in place of the "http" condition
1612 And also use a <waitfor> in place of <condition>, such as:
1613 <waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped"><http url="..."/></waitfor>
[25420]1614 The http URL resolves to host:port/greenstone3
1615 Condition uses <http/> rather than <socket/> for testing, since if the server was stopped, the socket
1616 might still be in use for some moments. We test the URL with the http condition since it's likelier to
1617 fail sooner if the server has indeed been stopped. -->
[25418]1618 <target name="check-tomcat-running">
1619 <condition property="tomcat.isrunning">
[27238]1620 <!--<http url="http://${tomcat.server}:${tomcat.port}${app.path}"/>-->
1621 <http url="http://${tomcat.server}:${tomcat.port}"/>
[25418]1622 </condition>
[25321]1623 </target>
1624
[25443]1625 <!-- stop-tomcat checks if the tomcat server is already running. If it appears to be running
1626 (regardless of whether tomcat was just starting to shut down), this target calls force-stop-tomcat
1627 to issue the shutdown command to tomcat. Then it waits for at most 15 seconds for the server to
1628 actually stop by checking the socket at which tomcat listens every second, printing a warning
1629 at the end of the max wait time of 15 seconds if tomcat was still running. -->
1630 <target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning">
[25321]1631 <antcall target="force-stop-tomcat"/>
[25443]1632
1633 <property name="wait.numchecks" value="15"/>
1634 <echo>Waiting for the server to shutdown... (${wait.numchecks} seconds max)</echo>
1635 <waitfor maxwait="${wait.numchecks}" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="tomcat.timedout">
[25444]1636 <not><socket server="${tomcat.server}" port="${tomcat.port}"/></not>
[25443]1637 </waitfor>
1638
1639 <if>
1640 <bool>
1641 <isset property="${tomcat.timedout}"/>
1642 </bool>
1643 <property name="tomcat.isrunning" value="true"/>
1644 <echo>WARNING: Checked the socket ${wait.numchecks} times, but port ${tomcat.port} is still busy.</echo>
1645 <else>
1646 <echo>Tomcat is stopped.</echo>
1647 <property name="tomcat.isrunning" value="false"/>
1648 </else>
1649 </if>
[25420]1650 </target>
[25321]1651
[15124]1652 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
1653
1654 <target name="setup-catalina-ant-tasks">
1655 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
1656 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
1657 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1658 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
1659 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1660 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
1661 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1662 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
1663 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1664 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
1665 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1666 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
1667 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1668 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
1669 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1670 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
1671 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1672 </target>
1673
[25449]1674 <!-- http://blog.andrewbeacock.com/2007/11/how-to-truncate-log-file-using-ubuntu.html
1675 Doing "cat </dev/null > packages/tomcat/logs/catalina.out" doesn't work as an ant target.
1676 It seems to have a problem with cat or </dev/null, with or without the < sign. -->
[26776]1677 <target name="reset-logs" description="Empties catalina.out, greenstone.log and contents of web/logs/tmp">
[29156]1678 <echo>Truncating catalina.out, solr.log, greenstone.log and server.log, and emptying ${web.writablehome}/logs/tmp</echo>
[26185]1679 <exec executable="rm" os="${os.unix}" dir="${catalina.home}/logs" spawn="false">
1680 <arg value="-f"/>
[25449]1681 <arg value="catalina.out"/>
1682 </exec>
[27829]1683 <exec executable="rm" os="${os.unix}" dir="${web.writablehome}/logs" spawn="false">
[26185]1684 <arg value="-f"/>
[25449]1685 <arg value="greenstone.log"/>
1686 </exec>
[27829]1687 <exec executable="rm" os="${os.unix}" dir="${web.writablehome}/logs" spawn="false">
[26185]1688 <arg value="-f"/>
[26002]1689 <arg value="server.log"/>
1690 </exec>
[15124]1691
[26185]1692 <exec executable="touch" os="${os.unix}" dir="${catalina.home}/logs"
1693 spawn="false">
1694 <arg value="catalina.out"/>
1695 </exec>
[27829]1696 <exec executable="touch" os="${os.unix}" dir="${web.writablehome}/logs"
[26185]1697 spawn="false">
1698 <arg value="greenstone.log"/>
1699 </exec>
[27829]1700 <exec executable="touch" os="${os.unix}" dir="${web.writablehome}/logs"
[26185]1701 spawn="false">
1702 <arg value="server.log"/>
1703 </exec>
1704
[28044]1705 <exec executable="cmd" osfamily="windows" dir="${catalina.home}/logs" spawn="false">
[25449]1706 <arg line="/c echo. > catalina.out"/>
1707 </exec>
[28044]1708 <exec executable="cmd" osfamily="windows" dir="${web.writablehome}/logs" spawn="false">
[25449]1709 <arg line="/c echo. > greenstone.log"/>
1710 </exec>
[28044]1711 <exec executable="cmd" osfamily="windows" dir="${web.writablehome}/logs" spawn="false">
[26002]1712 <arg line="/c echo. > server.log"/>
1713 </exec>
[25449]1714
[29156]1715 <!-- if ext/solr/logs/solr.log exists, truncate it -->
1716 <if><bool><available file="${solr-ext.home}/logs/solr.log" type="file"/></bool>
1717 <exec executable="rm" os="${os.unix}" dir="${solr-ext.home}/logs" spawn="false">
1718 <arg value="-f"/>
1719 <arg value="solr.log"/>
1720 </exec>
1721 <exec executable="touch" os="${os.unix}" dir="${solr-ext.home}/logs" spawn="false">
1722 <arg value="solr.log"/>
1723 </exec>
1724 <exec executable="cmd" osfamily="windows" dir="${solr-ext.home}/logs" spawn="false">
1725 <arg line="/c echo. > solr.log"/>
1726 </exec>
1727 </if>
1728
[25501]1729 <if>
[27829]1730 <bool><available file="${web.writablehome}/logs/tmp" type="dir"/></bool>
[25501]1731 <delete>
[27829]1732 <fileset dir="${web.writablehome}/logs/tmp" includes="**/*"/>
[25501]1733 </delete>
1734 </if>
[25449]1735 </target>
1736
[29438]1737 <target name="clear-tomcat-sessions" description="Clear the Tomcat Session info." depends="init">
1738 <exec executable="cmd" osfamily="windows" dir="${catalina.home}/work/Catalina/localhost/greenstone3" spawn="false">
1739 <arg line="/c echo. > SESSIONS.ser"/>
1740 </exec>
1741 <exec executable="rm" os="${os.unix}" dir="${catalina.home}/work/Catalina/localhost/greenstone3" spawn="false">
1742 <arg value="-f"/>
1743 <arg value="SESSIONS.ser"/>
1744 </exec>
1745
1746 </target>
[15799]1747 <!-- ======================= ant Targets ============================ -->
[15124]1748 <target name="prepare-ant" depends="init">
[16951]1749 <if>
1750 <bool>
1751 <not><available file="${packages.home}/ant/.flagfile"/></not>
1752 </bool>
1753
1754 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
1755 dest="${packages.home}/apache-ant-1.7.0-bin.zip"
1756 usetimestamp="true"/>
1757 <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
1758 dest="${packages.home}"/>
1759 <move todir="${packages.home}/ant">
1760 <fileset dir="${packages.home}/apache-ant-1.7.0"/>
1761 </move>
1762 <echo file="${packages.home}/ant/.flagfile">
1763 the timestamp of this file is the time that ant was extracted from the zip files.
1764 it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
1765 </echo>
1766
1767 <else>
1768 <echo>Ant has been prepared, will not prepare</echo>
1769 <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
1770 </else>
1771
1772 </if>
[15124]1773 </target>
1774
[25338]1775 <!-- ======================= Admin Targets ============================ -->
1776
1777 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.
1778 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant
1779 But you can do: echo mypassword | ant config-admin -->
1780 <target name="config-admin" description="Reset admin password">
1781 <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):&gt;">
1782 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
1783 </input>
[25343]1784 <!--<echo>PWD: ${admin.password}</echo>-->
[25338]1785 <antcall target="update-userdb">
1786 <param name="user.username" value="admin"/>
1787 <param name="user.password" value="${admin.password}"/>
1788 <param name="user.groups" value=""/>
1789 <param name="user.status" value=""/>
1790 <param name="user.comment" value="Password updated."/>
1791 <param name="user.email" value=""/>
1792 </antcall>
1793 </target>
1794
1795 <target name="config-user" description="Add or modify users" depends="get-user-data,update-userdb"/>
1796
1797 <target name="get-user-data" description="Get user details">
1798 <input addproperty="user.username" message="Username:&gt;"/>
1799 <input addproperty="user.password" defaultvalue="" message="Password (3-8 characters):&gt;">
1800 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
1801 </input>
1802 <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list):&gt;"/>
1803 <input addproperty="user.status" defaultvalue="true" message="Enabled (true/false):&gt;"/>
1804 <input addproperty="user.comment" defaultvalue="" message="Comment:&gt;"/>
1805 <input addproperty="user.email" defaultvalue="" message="Email:&gt;"/>
1806 </target>
1807
1808<!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.
1809 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant
1810 But you can do: echo mypassword | ant config-admin -->
[25418]1811 <target name="update-userdb" description="Add or modify users" depends="check-tomcat-running">
1812
[29903]1813 <!--
1814 We're now using derby networked server, so stopping and starting tomcat is not necessary.
1815 For embedded derby: stop tomcat if running, since derby db is embedded
1816 and only allows connections from one jvm instance at a time
[25418]1817 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
1818 The ${tomcat.isrunning} property is set by the depends-target "check-tomcat-running" -->
[29903]1819 <!--
[25338]1820 <if>
1821 <bool>
1822 <istrue value="${tomcat.isrunning}"/>
1823 </bool>
[25418]1824 <antcall target="stop-tomcat"/>
[25338]1825 </if>
[29903]1826 -->
[25338]1827
1828 <!--<echo>${admin.password}</echo>--> <!-- for testing -->
1829 <java classname="org.greenstone.gsdl3.util.ModifyUsersDB">
1830 <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files-->
[27921]1831 <arg file="${web.home}/etc/usersDB"/>
[25338]1832 <arg value="${user.username}"/>
1833 <arg value="password=${user.password}"/>
1834 <arg value="groups=${user.groups}"/>
1835 <arg value="status=${user.status}"/>
1836 <arg value="comment=${user.comment}"/>
1837 <arg value="email=${user.email}"/>
1838 </java>
1839
1840 <!-- run tomcat again if it used to be running -->
[29903]1841 <!--
[25338]1842 <if>
1843 <bool>
1844 <istrue value="${tomcat.isrunning}"/>
1845 </bool>
1846 <antcall target="start-tomcat"/>
1847 </if>
[29903]1848 -->
[25338]1849 </target>
1850
1851
[20079]1852 <!-- ======================= Axis Targets ============================ -->
1853
[15124]1854 <target name="prepare-axis" depends="init">
[16951]1855
1856 <if>
1857 <bool>
1858 <not><available file="${packages.home}/axis/.flagfile"/></not>
1859 </bool>
1860
1861 <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
1862 dest="${packages.home}/${axis.zip.version}"
1863 usetimestamp="true"/>
1864 <unzip src="${packages.home}/${axis.zip.version}"
1865 dest="${packages.home}"/>
1866 <move todir="${packages.home}/axis">
1867 <fileset dir="${packages.home}/${axis.dir.version}"/>
1868 </move>
1869 <!-- install axis into greenstone web app -->
1870 <copy todir="${web.lib}">
1871 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
1872 <include name="*.jar"/>
1873 </fileset>
1874 </copy>
1875 <copy todir="${web.home}">
1876 <fileset dir="${packages.home}/axis/webapps/axis/">
1877 <include name="*.jsp"/>
1878 <include name="*.jws"/>
1879 </fileset>
1880 </copy>
1881 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
1882 <copy todir="${web.classes}">
1883 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
1884 <include name="*.properties"/>
1885 </fileset>
1886 </copy>
1887 <echo file="${packages.home}/axis/.flagfile">
1888 the timestamp of this file is the time that axis was extracted from the zip files.
1889 it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
1890 </echo>
1891
1892 <else>
1893 <echo>Axis has been prepared, will not prepare</echo>
1894 <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
1895 </else>
1896
1897 </if>
[15124]1898 </target>
1899
[15229]1900 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
[15124]1901 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
[15799]1902
1903 <target name="deploy-site">
[15124]1904 <java classname="org.apache.axis.client.AdminClient">
1905 <classpath refid="compile.classpath"/>
1906 <arg value="-l"/>
1907 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
[15229]1908 <arg file="${basedir}/resources/soap/deploy.wsdd"/>
1909 </java>
1910 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
[15124]1911 </target>
1912
[15229]1913 <target name="soap-undeploy-site" depends="get-undeploy-service-name"
[15124]1914 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
[15229]1915 <filter token="servicesname" value="${axis.undeploy.servicename}"/>
1916 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
1917 tofile="${basedir}/resources/soap/undeploy.wsdd"
1918 filtering="true"
1919 overwrite="true"/>
[15124]1920 <java classname="org.apache.axis.client.AdminClient">
1921 <classpath refid="compile.classpath"/>
1922 <arg value="-l"/>
1923 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
[15229]1924 <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
[15124]1925 </java>
[15229]1926 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
[15799]1927 </target>
[15124]1928
[16936]1929 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
1930 with the default servicename of localsite-->
[15124]1931 <target name="deploy-localsite" depends="init"
1932 description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
1933 <antcall target="start-tomcat"/>
[15235]1934 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
[15229]1935 <antcall target="create-deployment-files">
1936 <param name="axis.sitename" value="localsite"/>
[15235]1937 <param name="axis.servicesname" value="${base.webservice.name}"/>
[15229]1938 <param name="axis.siteuri" value="localsite"/>
1939 </antcall>
[15124]1940 <antcall target="deploy-site">
1941 <param name="axis.sitename" value="localsite"/>
[15235]1942 <param name="axis.servicesname" value="${base.webservice.name}"/>
[15229]1943 <param name="axis.siteuri" value="localsite"/>
[15124]1944 </antcall>
[15369]1945 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
[15124]1946 </target>
[15799]1947
[16936]1948 <target name="get-sitename" unless="axis.sitename">
[15229]1949 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
[15235]1950Press Enter for default:localsite</input>
[15124]1951 </target>
1952
[15229]1953 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
1954 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
1955To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
[20209]1956Or press Enter for undeploying the default:localsite /&gt;</input>
[15229]1957 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
[15124]1958 </target>
1959
[15229]1960 <target name="get-webservices" unless="axis.servicesname">
[15235]1961 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
[15229]1962Choose from: ${web.services.list}
[20209]1963Or press Enter for default:${base.webservice.name} /&gt;</input>
[15229]1964 <echo>${axis.servicesname}</echo>
1965 </target>
1966
1967 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
[15235]1968 <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>
[15229]1969 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
1970 </target>
1971
1972 <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">
1973 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
[15235]1974 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
[15124]1975 </condition>
[15229]1976
1977 <!--everything else defaults to java:RPC at present-->
1978 <condition property="soap.method" value="provider='java:RPC'">
1979 <not>
[15235]1980 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
[15229]1981 </not>
1982 </condition>
[16936]1983 </target>
[15799]1984
[16936]1985 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
[15124]1986 <filter token="sitename" value="${axis.sitename}"/>
1987 <filter token="siteuri" value="${axis.siteuri}"/>
[15229]1988 <filter token="servicesname" value="${axis.servicesname}"/>
1989 <filter token="soapmethod" value="${soap.method}"/>
[15124]1990 <copy file="${basedir}/resources/soap/site.wsdd.template"
[15229]1991 tofile="${basedir}/resources/soap/deploy.wsdd"
1992 filtering="true"
1993 overwrite="true"/>
[15124]1994 <!-- create the java files and compile them -->
[15229]1995 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
1996 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
1997 filtering="true"
1998 overwrite="true"/>
[15124]1999 <mkdir dir="${build.home}"/>
2000 <javac srcdir="${src.home}"
2001 destdir="${build.home}"
[28137]2002 includeantruntime="${compile.includeantruntime}"
[15124]2003 debug="${compile.debug}"
2004 deprecation="${compile.deprecation}"
[29515]2005 optimize="${compile.optimize}"
2006 encoding="${compile.encoding}">
[15124]2007 <classpath refid="compile.classpath"/>
[15229]2008 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
[15124]2009 </javac>
2010 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
[15799]2011 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
2012 tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
2013 overwrite="true" />
[15124]2014 </target>
[15799]2015
[15124]2016
[15799]2017 <!-- ====================== Core targets ============================== -->
2018 <!-- core targets refer to the core gsdl3 java src -->
[15124]2019
[19878]2020 <target name="prepare-core"/>
[15124]2021
2022 <target name="configure-core"/>
2023
2024 <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
2025 description="Update only the Greenstone core" />
2026
[15799]2027 <target name="svnupdate-core" unless="nosvn.mode">
[20930]2028 <exec executable="svn">
2029 <arg value="update"/>
2030 <arg value="${basedir}"/>
2031 <arg value="-r"/><arg value="${branch.revision}"/>
2032 </exec>
[15124]2033 </target>
2034
2035 <target name="clean-core"
2036 description="Clean only the Greenstone core">
[19878]2037 <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
[15124]2038 <delete dir="${build.home}"/>
2039 </target>
2040
[15799]2041 <target name="compile-core" depends="init"
[15124]2042 description="Compile only the Greenstone core">
2043 <mkdir dir="${build.home}"/>
[25131]2044
[23803]2045 <if><bool><isset property="with.jni"/></bool>
2046 <javac srcdir="${src.home}"
2047 destdir="${build.home}"
[28137]2048 includeantruntime="${compile.includeantruntime}"
[23803]2049 debug="${compile.debug}"
2050 deprecation="${compile.deprecation}"
[29515]2051 optimize="${compile.optimize}"
2052 encoding="${compile.encoding}">
[23803]2053 <classpath>
2054 <path refid="compile.classpath"/>
2055 </classpath>
2056 </javac>
2057 <else>
2058 <property name="gsprefix" value=""/>
2059 <javac srcdir="${src.home}"
[28137]2060 destdir="${build.home}"
2061 includeantruntime="${compile.includeantruntime}"
2062 debug="${compile.debug}"
2063 deprecation="${compile.deprecation}"
[29515]2064 optimize="${compile.optimize}"
2065 encoding="${compile.encoding}">
[23803]2066 <classpath>
2067 <path refid="compile.classpath"/>
2068 </classpath>
2069 <exclude name="org/greenstone/gsdl3/service/GS2MGPPRetrieve.java"/>
2070 <exclude name="org/greenstone/gsdl3/service/GS2MGPPSearch.java"/>
2071 <exclude name="org/greenstone/gsdl3/service/GS2MGSearch.java"/>
2072 <exclude name="org/greenstone/gsdl3/service/GS2MGRetrieve.java"/>
2073 <exclude name="org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java"/>
2074 <exclude name="org/greenstone/gsdl3/service/PhindPhraseBrowse.java"/>
2075 <exclude name="org/greenstone/gsdl3/util/GDBMWrapper.java"/>
2076 </javac>
2077 </else>
2078 </if>
[15124]2079 <jar destfile="${build.home}/gsdl3.jar">
2080 <fileset dir="${build.home}">
[16936]2081 <include name="org/greenstone/gsdl3/**"/>
[15124]2082 <include name="org/flax/**"/>
[16936]2083 <exclude name="**/Test.class"/>
[15124]2084 </fileset>
2085 <manifest>
[16936]2086 <attribute name="Built-By" value="${user.name}" />
[15124]2087 </manifest>
2088 </jar>
2089 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
[22101]2090
2091 <jar destfile="${build.home}/gutil.jar">
2092 <fileset dir="${build.home}">
2093 <include name="org/greenstone/util/**"/>
2094 </fileset>
2095 <manifest>
2096 <attribute name="Built-By" value="${user.name}" />
2097 </manifest>
2098 </jar>
2099 <copy file="${build.home}/gutil.jar" todir="${web.lib}"/>
2100
[15124]2101 <!-- copy the localsite server in case we need it -->
[15235]2102 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
[15124]2103
[17918]2104 <!-- Greenstone Administrator Interface -->
[15124]2105 <jar destfile="${build.home}/GAI.jar">
2106 <fileset dir="${build.home}">
[16936]2107 <include name="org/greenstone/admin/**"/>
[15124]2108 </fileset>
2109 <manifest>
[16936]2110 <attribute name="Built-By" value="${user.name}" />
[15124]2111 </manifest>
2112 </jar>
[17917]2113 <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
[18124]2114 <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
[15124]2115 <jar destfile="${build.home}/phind.jar">
2116 <fileset dir="${build.home}">
[16936]2117 <include name="org/greenstone/applet/phind/**"/>
[15124]2118 </fileset>
2119 <manifest>
[16936]2120 <attribute name="Built-By" value="${user.name}" />
[15124]2121 </manifest>
2122 </jar>
2123 <mkdir dir="${web.applet}"/>
2124 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
2125 <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
[18515]2126 <if>
2127 <bool><istrue value="${tomcat.islocal}"/></bool>
[29711]2128 <if><bool><available file="${catalina.home}/lib/xercesImpl.jar"/></bool><!-- moved for solr -->
2129 <copy file="${catalina.home}/lib/xercesImpl.jar" todir="${web.applet}"/>
2130 <copy file="${catalina.home}/lib/xml-apis.jar" todir="${web.applet}"/>
2131
2132 <else><!-- get from default GS3 web lib location-->
2133 <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
2134 <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
2135 </else>
2136 </if>
[18515]2137 </if>
2138
2139
[17116]2140 <!-- skip anttasks for now
[15124]2141 <jar destfile="${build.home}/anttasks.jar">
2142 <fileset dir="${build.home}">
[16936]2143 <include name="org/greenstone/anttasks/**"/>
[15124]2144 </fileset>
2145 <manifest>
[16936]2146 <attribute name="Built-By" value="${user.name}" />
[15124]2147 </manifest>
2148 </jar>
[17116]2149 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
[15124]2150 <jar destfile="${build.home}/gsdl3test.jar">
2151 <fileset dir="${build.home}">
[16936]2152 <include name="org/greenstone/gsdl3/**/*Test.class"/>
2153 <include name="org/greenstone/testing/**"/>
[15124]2154 </fileset>
2155 <manifest>
[16936]2156 <attribute name="Built-By" value="${user.name}" />
[15124]2157 </manifest>
2158 </jar>
2159 <jar destfile="${build.home}/server.jar">
2160 <fileset dir="${build.home}">
[16936]2161 <include name="org/greenstone/server/**"/>
[22634]2162 <include name="org/greenstone/util/**"/>
[15124]2163 </fileset>
2164 <fileset file="${basedir}/resources/java/server.properties"/>
2165 <manifest>
[16936]2166 <attribute name="Built-By" value="${user.name}"/>
[15124]2167 </manifest>
2168 </jar>
2169 <copy file="${build.home}/server.jar" todir="${basedir}"/>
2170 </target>
[27149]2171
2172 <!-- === Eclipse targets == -->
2173 <target name="setup-for-eclipse">
2174
2175 <filter token="gsdlhome" value="${gs2build.home}"/>
2176 <filter token="gsdl3srchome" value="${basedir}"/>
2177 <filter token="gsdl3home" value="${basedir}/web"/>
2178
2179 <if>
2180 <bool><not><available file="${basedir}/TransformingLibrary.launch"/></not></bool>
2181 <copy file="${basedir}/TransformingLibrary.launch.in" tofile="${basedir}/TransformingLibrary.launch" filtering="true" overwrite="true"/>
2182 </if>
2183<!--
2184 <if>
2185 <bool><not><available file="${basedir}/LibraryCommandline.launch"/></not></bool>
2186 <copy file="${basedir}/LibraryCommandline.launch.in" tofile="${basedir}/LibraryCommandline.launch" filtering="true" overwrite="true"/>
2187 </if>
2188-->
2189 </target>
[15799]2190
2191 <!-- ================== Packages targets ================================ -->
[15124]2192 <!-- these targets refer to the greenstone source packages - these need
2193 updating less often, so are in separate targets to the core -->
[19871]2194 <target name="prepare-packages" depends="init"/>
[15124]2195
2196 <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
2197 description="Update only the source packages"/>
2198
[15799]2199 <target name="svnupdate-packages" unless="nosvn.mode">
[20930]2200 <exec executable="svn">
2201 <arg value="update"/>
2202 <arg value="${src.packages.home}"/>
2203 <arg value="-r"/><arg value="${branch.revision}"/>
2204 </exec>
[15124]2205 </target>
[19931]2206
[15124]2207
[19871]2208 <target name="configure-packages" depends="init,configure-javagdbm"
[15124]2209 description="Configure only the packages."/>
2210
[22184]2211 <target name="configure-javagdbm" if="with.jni">
[15124]2212 <echo>
2213 Configuring JavaGDBM
2214 </echo>
[18417]2215
[19904]2216 <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[15124]2217 <arg value="--prefix=${basedir}"/>
2218 <arg value="--libdir=${lib.jni}"/>
[19873]2219 <arg value="--with-gdbm=${gdbm.home}"/>
[26765]2220 <arg line="${cross.configure.args}"/>
[15124]2221 </exec>
2222 </target>
2223
[19871]2224 <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
[15124]2225
2226 <target name="clean-javagdbm" depends="init">
[26082]2227 <if><bool><available file="${javagdbm.home}/Makefile"/></bool>
[15124]2228 <exec executable="make" os="${os.unix}"
[19904]2229 dir="${javagdbm.home}" failonerror="true">
[15124]2230 <arg value="clean"/>
2231 </exec>
[26082]2232 </if>
[15124]2233 </target>
2234
[19871]2235 <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
[15185]2236
[15799]2237 <target name="distclean-javagdbm" depends="init">
[26079]2238 <if><bool><available file="${javagdbm.home}/Makefile"/></bool>
[15799]2239 <exec executable="make" os="${os.unix}"
[19904]2240 dir="${javagdbm.home}" failonerror="true">
[15799]2241 <arg value="distclean"/>
2242 </exec>
[26079]2243 </if>
[15799]2244 </target>
2245
2246 <target name="compile-packages" description="Compile only the source packages">
[22184]2247 <!-- javagdbm -->
2248 <antcall target="compile-javagdbm"/>
2249 <!-- Search4j -->
2250 <antcall target="compile-search4j"/>
2251 </target>
2252
2253 <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni">
[15799]2254
[19878]2255 <!-- unix: -->
[15799]2256 <echo>compile javagdbm</echo>
[19904]2257 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[29518]2258 <arg value="JAVACOPTIONS=-encoding UTF8"/>
2259 </exec>
2260 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[15799]2261 <arg value="install"/>
2262 </exec>
[15098]2263
[23852]2264 <!-- windows: Calling without the "compile" argument first will run winMake.bat with
2265 "all" which will then perform both the compile AND link targets in jni/win32.mak
2266 (thereby also generating gdbmjava.dll). Then we run the same command with
2267 the "install" argument to copy the gdbmjava.dll into the correct location. -->
[23849]2268 <echo>Windows: compile javagdbm</echo>
[28044]2269 <exec executable="${javagdbm.home}/winMake.bat" osfamily="windows" dir="${javagdbm.home}" failonerror="true">
[24076]2270 <env key="GSDL3SRCHOME" path="${basedir}"/>
[23852]2271 </exec>
[28044]2272 <exec executable="${javagdbm.home}/winMake.bat" osfamily="windows" dir="${javagdbm.home}" failonerror="true">
[24076]2273 <env key="GSDL3SRCHOME" path="${basedir}"/>
[23847]2274 <arg value="install"/>
[15799]2275 </exec>
[15124]2276
[15799]2277 <!-- install the jar file -->
[23847]2278 <echo>Install the javagdbm jar file ${javagdbm.home}/javagdbm.jar ${lib.jni}</echo>
[15799]2279 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
2280 </target>
2281
[17491]2282 <target name="compile-search4j">
[17509]2283
[19996]2284 <!-- windows -->
[19997]2285 <if><bool><istrue value="${current.os.iswindows}"/></bool>
[19996]2286 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
2287 <arg value="/f"/>
2288 <arg value="win32.mak"/>
2289 <arg value='BINDIR="${basedir}\bin"'/>
2290 </exec>
2291 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
2292 <arg value="/f"/>
2293 <arg value="win32.mak"/>
2294 <arg value="install"/>
2295 <arg value='BINDIR="${basedir}\bin"'/>
2296 </exec>
[17509]2297
[19996]2298 <!-- unix -->
[19997]2299 <else><if><bool><istrue value="${current.os.isunix}"/></bool>
[19996]2300 <exec executable="${src.packages.home}/search4j/configure" dir="${src.packages.home}/search4j" failonerror="true">
2301 <arg value="--bindir=${basedir}/bin"/>
2302 <arg value="${static.arg}"/>
[26765]2303 <arg line="${cross.configure.args}"/>
[19996]2304 </exec>
2305 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
2306 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true">
2307 <arg value="install"/>
2308 </exec>
[17509]2309
[19996]2310 <!-- else warn -->
2311 <else>
2312 <fail>this target does not support the current os</fail>
[17509]2313
[19996]2314 </else></if></else></if>
2315
[17491]2316 </target>
2317
[19871]2318 <target name="install-auxiliary-jar-files" depends="init">
[22184]2319
2320 <if>
2321 <bool><available file="${mg.home}/mg.jar"/></bool>
2322 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
2323 </if>
2324
2325 <if>
[22199]2326 <bool><available file="${mgpp.home}/mgpp.jar"/></bool>
[22184]2327 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
2328 </if>
2329
[29143]2330 <copy file="${lucene.home}/LuceneWrapper4.jar" todir="${web.lib}"/>
[19871]2331 </target>
2332
[22976]2333 <target name="install-jni-files" depends="init" if="with.jni">
2334 <antcall target="install-jni-files-linux"/>
2335 <antcall target="install-jni-files-windows"/>
2336 <antcall target="install-jni-files-macos"/>
2337 </target>
[15124]2338
[15799]2339 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
[26765]2340
2341 <if>
2342
2343 <bool><equals arg1="${os.bin.dir}" arg2="windows"/></bool>
2344 <!-- cross compiling to windows -->
2345 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
2346 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
2347 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
2348 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
2349 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
2350 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
2351
2352 <else>
2353 <!-- otherwise do the usual Unix copies -->
2354 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
2355 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
2356 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
2357 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
2358 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
2359 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
2360 </else>
2361 </if>
2362
2363
[15799]2364 </target>
2365 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
[15124]2366 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
2367 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
[15799]2368 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
[15124]2369 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
2370 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
[15799]2371 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
2372 </target>
2373 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
[15124]2374 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
2375 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
[15799]2376 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
[15124]2377 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
2378 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
[15799]2379 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
2380 </target>
2381
[19871]2382 <!-- ========common-src targets =================================-->
2383 <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
2384 collection building is not enabled -->
2385
2386 <target name="update-common-src" depends="init" if="collection.building.disabled">
2387 </target>
[19931]2388
[19871]2389 <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
[20930]2390 <exec executable="svn">
2391 <arg value="update"/>
2392 <arg value="${common.src.home}"/>
2393 <arg value="-r"/><arg value="${branch.revision}"/>
2394 </exec>
[19871]2395 </target>
2396
[19878]2397 <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
[19871]2398 <antcall target="checkout-common-src"/>
2399 <antcall target="unzip-windows-packages"/>
2400 </target>
2401
2402 <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
2403 <echo>checking out common-src</echo>
[20930]2404 <exec executable="svn">
2405 <arg value="checkout"/>
[21196]2406 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src"/>
[20930]2407 <arg value="common-src"/>
2408 <arg value="-r"/><arg value="${branch.revision}"/>
2409 </exec>
[19871]2410 </target>
2411
[19931]2412 <target name="configure-common-src" depends="init">
[26765]2413<!--
2414 <echo>cross configure args: ${cross.configure.args}</echo>
2415-->
[19871]2416 <exec executable="${common.src.home}/configure" os="${os.unix}"
[19904]2417 dir="${common.src.home}" failonerror="true">
[19931]2418 <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
[19933]2419 <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
[22184]2420 <arg line="${gs2.opt.args}"/>
[22854]2421 <arg line="${static.arg}"/>
[26765]2422 <arg line="${cross.configure.args}"/>
[23611]2423 <arg line="${allargs}"/>
[19871]2424 </exec>
2425 </target>
2426
[19931]2427 <target name="clean-common-src" depends="init">
[19871]2428 <!-- unix: -->
[26082]2429 <if><bool><available file="${common.src.home}/Makefile"/></bool>
[19904]2430 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[19871]2431 <arg value="clean"/>
2432 </exec>
[26082]2433 </if>
[19871]2434 <!-- windows: -->
[28044]2435 <exec executable="nmake" dir="${common.src.home}" osfamily="windows" failonerror="true">
[19871]2436 <arg value="/f"/>
2437 <arg value="win32.mak"/>
2438 <arg value="clean"/>
[19960]2439 <arg value="GSDLHOME=${gs2build.home}"/>
[19871]2440 </exec>
2441 </target>
[19931]2442 <target name="distclean-common-src" depends="init">
[19960]2443 <!-- unix: -->
[26079]2444 <if><bool><available file="${common.src.home}/Makefile"/></bool>
[19904]2445 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[19871]2446 <arg value="distclean"/>
2447 </exec>
[26079]2448 </if>
[19960]2449 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
[28044]2450 <exec executable="nmake" dir="${common.src.home}" osfamily="windows" failonerror="true">
[19960]2451 <arg value="/f"/>
2452 <arg value="win32.mak"/>
2453 <arg value="clean"/>
2454 <arg value="GSDLHOME=${gs2build.home}"/>
2455 </exec>
[19871]2456 </target>
[19931]2457 <target name="compile-common-src" depends="init">
[19871]2458 <!-- unix: -->
[19904]2459 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[22184]2460 <arg value="${gs2.compile.target}"/>
[19871]2461 </exec>
2462 <!-- windows: -->
[28044]2463 <exec executable="nmake" dir="${common.src.home}" osfamily="windows" failonerror="true">
[19871]2464 <arg value="/f"/>
2465 <arg value="win32.mak"/>
[19934]2466 <arg value="GSDLHOME=${gs2build.home}"/>
[22184]2467 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
[22976]2468 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
2469 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
2470 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
2471 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
[19871]2472 </exec>
2473 </target>
2474
[19843]2475 <!-- ======= collection-building targets ===========================-->
[15124]2476
[19843]2477 <target name="update-collection-building" if="collection.building.enabled"
[19931]2478 depends="init,svnupdate-collection-building,gs2build-edit-setup-bat,configure-common-src,clean-common-src,compile-common-src,configure-collection-building,clean-collection-building,compile-collection-building"
[19843]2479 description="Update (SVN update, configure, compile etc) only the collection building components"/>
[15124]2480
[27135]2481 <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-cgi,svnupdate-gli" unless="nosvn.mode"
[19843]2482 description="SVN update the collection building components">
2483 </target>
[15124]2484
[27135]2485 <target name="prepare-collection-building" depends="init,prepare-gs2build,svnupdate-cgi,prepare-gli" if="collection.building.enabled">
[15124]2486 </target>
2487
[19931]2488 <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
2489 description="Configure the collection building components">
[19843]2490 </target>
[15098]2491
[19948]2492 <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
[19843]2493 description="Clean only the collection building components"
2494 if="collection.building.enabled"/>
[18495]2495
[19948]2496 <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
[19843]2497 description="Distclean only the collection building components"
2498 if="collection.building.enabled"/>
2499
[19931]2500 <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
[19843]2501 description="Compile only the collection building components">
[19931]2502 <!-- make install for common-src -->
2503 <!-- unix: -->
2504 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[22184]2505 <arg value="${gs2.install.target}"/>
[19931]2506 </exec>
2507
2508 <!-- windows: -->
[28044]2509 <exec executable="nmake" dir="${common.src.home}" osfamily="windows" failonerror="true">
[19931]2510 <arg value="/f"/>
2511 <arg value="win32.mak"/>
[21370]2512 <arg value="install"/>
[23837]2513 <arg value="GSDLHOME=${gs2build.home}"/>
[22184]2514 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
[23837]2515 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
2516 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
2517 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
2518 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
2519 <!--
2520 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
2521 <arg value="USE_SQLITE=0"/>--> <!-- why is this not on by default? -->
[19931]2522 </exec>
2523
2524 <!-- install gs2build indexers for windows -->
2525 <if>
2526 <bool><istrue value="${current.os.iswindows}"/></bool>
2527 <copy todir="${gs2build.home}/bin/windows">
2528 <fileset dir="${gs2build.home}/common-src/indexers/bin">
2529 <include name="*.*"/>
2530 </fileset>
2531 </copy>
2532 </if>
2533
2534 <!-- LuceneWrapper jar file not installed by default -->
2535 <mkdir dir="${gs2build.home}/bin/java"/>
[29143]2536 <copy file="${lucene.home}/LuceneWrapper4.jar" todir="${gs2build.home}/bin/java"/>
[19931]2537
[15124]2538 </target>
[19843]2539
2540 <!-- ============== gli targets ================================= -->
[27135]2541
[27484]2542 <!-- gliserver.pl, gsdlCGI.pm, metadata-server.pl and checksum.pl are updated alongside
[27135]2543 this in target svnupdate-collection-building -->
[15799]2544 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
[19929]2545
[20930]2546 <exec executable="svn">
2547 <arg value="update"/>
2548 <arg value="${gli.home}"/>
2549 <arg value="-r"/><arg value="${branch.revision}"/>
2550 </exec>
2551
[15124]2552 </target>
2553
[27484]2554 <!-- gliserver.pl, gsdlCGI.pm, metadata-server.pl and checksum.pl are updated
[27135]2555 alongside this prepare-gli target in target prepare-collection-building -->
[19843]2556 <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
[19911]2557 <!-- checkout -->
[23808]2558 <if><bool><and><not><istrue value="${nosvn.mode}"/></not><isset property="with.gli.and.gems"/></and></bool>
[19929]2559
[20930]2560 <exec executable="svn">
2561 <arg value="checkout"/>
[21196]2562 <arg value="${svn.root}/main/${branch.path}/gli"/>
[20930]2563 <arg value="-r"/><arg value="${branch.revision}"/>
2564 </exec>
2565
[27135]2566 </if>
2567 </target>
2568
[27484]2569 <!-- svn checkout gliserver.pl, gsdlCGI.pm for gli applet, as well as gsdlCGI.pm-dependent metadata-server.pl
2570 (checksum.pl is used by GS2 for depositdspace.dm and may eventually be used by GS3 too) -->
[27135]2571 <target name="svnupdate-cgi">
2572
2573 <exec executable="svn" dir="web/WEB-INF/cgi">
[20930]2574 <arg value="export"/>
2575 <arg value="-r"/><arg value="${branch.revision}"/>
[25570]2576 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gliserver.pl"/>
[20930]2577 </exec>
[21196]2578 <exec executable="svn" dir="web/WEB-INF/cgi">
2579 <arg value="export"/>
2580 <arg value="-r"/><arg value="${branch.revision}"/>
[25570]2581 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gsdlCGI.pm"/>
[21196]2582 </exec>
[27135]2583 <exec executable="svn" dir="web/WEB-INF/cgi">
2584 <arg value="export"/>
2585 <arg value="-r"/><arg value="${branch.revision}"/>
2586 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/metadata-server.pl"/>
2587 </exec>
[27484]2588 <exec executable="svn" dir="web/WEB-INF/cgi">
2589 <arg value="export"/>
2590 <arg value="-r"/><arg value="${branch.revision}"/>
2591 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/checksum.pl"/>
2592 </exec>
[27135]2593 </target>
[20930]2594
[19843]2595
2596 <target name="clean-gli" depends="init" if="collection.building.enabled">
2597 <!-- gli -->
2598 <property name="gli.home" value="${basedir}/gli"/>
2599 <!-- linux -->
2600 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
[20826]2601 resolveExecutable="true" failonerror="true"/>
[19843]2602 <!-- windows -->
[28044]2603 <exec executable="clean.bat" osfamily="windows" dir="${gli.home}"
[20826]2604 resolveExecutable="true" failonerror="true"/>
[19843]2605 </target>
2606
2607 <target name="compile-gli" depends="init" if="collection.building.enabled">
[23808]2608 <if><bool><isset property="with.gli.and.gems"/></bool>
[23807]2609 <!-- gli -->
2610 <property name="gli.home" value="${basedir}/gli"/>
[15098]2611
[23807]2612 <!-- linux -->
2613 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
2614 <!--remote gli-->
2615 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
2616 resolveExecutable="true" failonerror="true"/>
2617 <!-- windows -->
[28044]2618 <exec executable="makegli.bat" osfamily="windows" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
[23807]2619 <!--remote gli-->
[28044]2620 <exec executable="makejar.bat" osfamily="windows" dir="${gli.home}"
[23807]2621 resolveExecutable="true" failonerror="true"/>
2622 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
2623 </if>
[19843]2624 </target>
[15124]2625
[19843]2626 <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
[21351]2627 <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
[19843]2628 <env key="gsdl3path" path="${basedir}"/>
[19871]2629 <env key="gsdlpath" path="${gs2build.home}"/>
[19843]2630 </exec>
[21351]2631 <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
[19843]2632 <env key="gsdl3path" path="${basedir}"/>
[19871]2633 <env key="gsdlpath" path="${gs2build.home}"/>
[19873]2634 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
[19843]2635 </exec>
[28044]2636 <exec executable="${basedir}/gli/gli.bat" osfamily="windows" dir="${basedir}/gli" spawn="true">
[19843]2637 <env key="GSDL3PATH" path="${basedir}"/>
[19871]2638 <env key="GSDLPATH" path="${gs2build.home}"/>
[19843]2639 </exec>
2640 <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.
2641 </echo>
2642 </target>
2643
2644 <!-- ================ gs2build targets =========================== -->
2645
2646 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
2647 <echo>svn updating gs2build</echo>
[20930]2648 <exec executable="svn">
2649 <arg value="update"/>
2650 <arg value="${gs2build.home}"/>
2651 <arg value="-r"/><arg value="${branch.revision}"/>
2652 </exec>
[15799]2653 </target>
[19843]2654
[15124]2655 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
2656 <antcall target="checkout-gs2build"/>
[28259]2657 <antcall target="prepare-pdfbox"/>
[27199]2658 <antcall target="prepare-imagemagick"/> <!-- has to be done before calling prepare-gnome-lib -->
[26791]2659 <antcall target="prepare-gnome-lib"/>
[15124]2660 <antcall target="unzip-windows-packages"/>
2661 <antcall target="checkout-winbin"/>
2662 <antcall target="get-windows-binaries"/>
2663 <antcall target="delete-winbin"/>
2664 </target>
2665
[19843]2666 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
2667 <echo>checking out gs2build</echo>
[20930]2668 <exec executable="svn">
2669 <arg value="checkout"/>
[21196]2670 <arg value="${svn.root}/main/${branch.path}/gs2build"/>
[20930]2671 <arg value="-r"/><arg value="${branch.revision}"/>
2672 </exec>
[26791]2673 </target>
[20930]2674
[28259]2675 <!-- Gets the PDFBox extension into gs2build/ext if checkout.pdfbox.ext is set to true in build.properties
2676 (which it is by default) -->
2677 <target name="prepare-pdfbox" depends="init" if="collection.building.enabled">
2678 <if>
2679 <bool>
2680 <istrue value="${checkout.pdfbox.ext}"/>
2681 </bool>
2682
2683 <property name="pdfbox.ext.dir" value="${gs2build.home}/ext/pdf-box"/>
2684 <condition property="pdfbox.ext.present">
2685 <available file="${pdfbox.ext.dir}" type="dir" />
2686 </condition>
2687
2688 <!-- get the pdfbox tar.gz file if we don't already have it and extract it if there's no pdf-box directory in gs2build/ext-->
2689 <if>
2690 <bool>
2691 <not><istrue value="${pdfbox.ext.present}"/></not>
2692 </bool>
[27034]2693
[28259]2694 <if>
2695 <bool>
2696 <not><istrue value="${gs2build.home}/ext/pdf-box-java.tar.gz"/></not>
2697 </bool>
2698
2699 <echo>Checking out the PDFBox extension into the GSDLHOME extension area</echo>
2700 <exec executable="svn">
2701 <arg value="export"/>
2702 <arg value="${svn.root}/gs2-extensions/pdf-box/trunk/pdf-box-java.tar.gz"/>
2703 <arg value="${gs2build.home}/ext/pdf-box-java.tar.gz"/>
2704 </exec>
2705 </if>
2706
2707 <echo>Extacting the PDFBox extension into the GSDLHOME extension area</echo>
2708 <untar compression="gzip"
2709 src="${gs2build.home}/ext/pdf-box-java.tar.gz"
[28610]2710 dest="${gs2build.home}/ext"/>
[28259]2711
2712 <delete file="${gs2build.home}/ext/pdf-box-java.tar.gz"/>
2713
2714 <else>
2715 <echo>The PDFBox extension already exists at ${pdfbox.ext.dir}</echo>
2716 </else>
2717 </if>
2718
2719 <else>
2720 <echo>**** Not preparing the PDFBox extension:</echo>
2721 <echo>The property checkout.pdfbox.ext in build.properties was not set or was set to false</echo>
2722 </else>
2723 </if>
2724 </target>
2725
[27199]2726 <target name="prepare-imagemagick" depends="init" if="collection.building.enabled">
2727 <if>
2728 <bool>
2729 <istrue value="${checkout.imagemagick.ext}"/>
2730 </bool>
2731
2732 <antcall target="checkout-imagemagick"/>
[28320]2733 <!--Compilation of imagemagick now happens during ant install, still before configuring the src code, as before -->
[27199]2734
2735 <else>
2736 <echo>**** Not preparing imagemagick:</echo>
2737 <echo>property checkout.imagemagick.ext in build.properties was not set or was set to false</echo>
2738 </else>
2739 </if>
2740 </target>
2741
2742 <target name="checkout-imagemagick" depends="init" if="collection.building.enabled" unless="nosvn.mode">
2743
2744 <property name="imagemagick.src.dir" value="${gs2build.home}/ext/imagemagick"/>
2745 <condition property="imagemagick.src.present">
2746 <available file="${imagemagick.src.dir}" type="dir" />
2747 </condition>
2748
2749 <if>
2750 <bool>
2751 <not><istrue value="${imagemagick.src.present}"/></not>
2752 </bool>
2753
2754 <echo>checking out imagemagick source into the extension area</echo>
2755
2756 <exec executable="svn">
2757 <arg value="checkout"/>
2758 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/src"/>
2759 <arg value="${imagemagick.src.dir}"/>
2760 </exec>
2761
2762 <else>
2763 <echo>imagemagick source code already exists at ${imagemagick.src.dir}</echo>
2764 </else>
2765 </if>
2766 </target>
2767
2768 <!-- Compile up imagemagick src folder if: the checkout.imagemagick.ext flag is turned on, if the imagick source code exists and if hasn't already been compiled up, then compile it up. Later can check if a gs-specific binary version has been installed already, in which case compilation won't be necessary. -->
2769 <target name="compile-imagemagick" if="checkout.imagemagick.ext">
2770
2771 <property name="imagemagick.src.dir" value="${gs2build.home}/ext/imagemagick"/>
2772 <property name="imagemagick.compiled.dir" value="${gs2build.home}/ext/imagemagick/${os.bin.dir}"/>
2773
[28320]2774 <condition property="imagemagick.src.present.firstcheck">
[27199]2775 <available file="${imagemagick.src.dir}" type="dir" />
2776 </condition>
2777 <condition property="imagemagick.compiled.present">
2778 <available file="${imagemagick.compiled.dir}" type="dir"/>
2779 </condition>
2780 <!--<condition property="imagemagick.bin.present">
2781 <available file="${basedir}/wherever/the/imgmagick/binary/is/to/be/found" type="dir" />
2782 </condition>-->
2783
[28320]2784 <!-- imagemagick will only be checked out if the user set the checkout.imagemagick.ext in build.properties -->
[27199]2785 <if>
2786 <bool>
[28320]2787 <isfalse value="${imagemagick.src.present.firstcheck}"/>
2788 </bool>
2789 <antcall target="checkout-imagemagick"/>
2790 </if>
2791
2792 <!-- keep track of whether the imagemagick src is now indeed present. Need to know this for a subsequent test -->
2793 <condition property="imagemagick.src.present">
2794 <available file="${imagemagick.src.dir}" type="dir" />
2795 </condition>
2796
2797 <if>
2798 <bool>
[27199]2799 <and>
2800 <istrue value="${imagemagick.src.present}"/> <!-- imagemagick src code is present -->
[28320]2801 <isfalse value="${imagemagick.compiled.present}"/> <!-- imagemagick src not compiled yet, so no imagemagick/os subfolder yet -->
2802 </and>
[27199]2803 </bool>
2804 <!-- then compile it. Only necessary for mac/linux, since windows has a stable working binary of imagemagick -->
2805 <exec executable="/bin/bash" dir="${imagemagick.src.dir}" failonerror="true">
2806 <arg value="CASCADE-MAKE.sh"/>
2807 </exec>
2808 </if>
2809 </target>
2810
2811
[27185]2812 <!-- Compile up gnome-lib src folder if: checkout.gnomelib.ext is turned on, and if not using the binary
[27034]2813 version (gnome-lib-minimal), and if the gnome-lib src folder is not already compiled up. -->
[27185]2814 <target name="compile-gnome-lib" if="checkout.gnomelib.ext">
[27034]2815
2816 <!-- http://stackoverflow.com/questions/3290307/sourcing-a-shell-profile-in-an-ant-build-file
2817 TODO: CASCADE-MAKE already sources devel.bash, but we still want to source it more globally,
2818 so that the rest of the GS3 compilation process also has access to those env variables -->
2819
2820 <property name="gnome.lib.src.dir" value="${basedir}/gs2build/ext/gnome-lib"/>
2821 <property name="gnome.lib.compiled.dir" value="${basedir}/gs2build/ext/gnome-lib/${os.bin.dir}"/>
2822
[28320]2823 <condition property="gnome.src.lib.present.firstcheck" value="true" else="false">
2824 <available file="${gnome.lib.src.dir}" type="dir" />
2825 </condition>
[28311]2826 <condition property="gnome.compiled.lib.present" value="true" else="false">
[27034]2827 <available file="${gnome.lib.compiled.dir}" type="dir"/>
2828 </condition>
[28311]2829 <condition property="gnome.lib.min.present" value="true" else="false">
[27034]2830 <available file="${basedir}/gs2build/ext/gnome-lib-minimal" type="dir" />
2831 </condition>
2832
[28311]2833 <!-- Make sure to checkout gnome-lib if it was not checked out at this stage
2834 since we're instructed to do so in th pre-condition to this target -->
[27034]2835 <if>
2836 <bool>
2837 <and>
[28320]2838 <isfalse value="${gnome.lib.min.present}"/>
2839 <isfalse value="${gnome.src.lib.present.firstcheck}"/>
[28311]2840 </and>
2841 </bool>
2842 <antcall target="checkout-gnome-lib"/>
2843 </if>
2844
[28320]2845 <!-- Keep track of whether we have the gnome-lib src folder now. Need to know this for a subsequent test -->
[28311]2846 <condition property="gnome.src.lib.present" value="true" else="false">
2847 <available file="${gnome.lib.src.dir}" type="dir" />
2848 </condition>
2849
2850 <!--<echo>MIN: ${gnome.lib.min.present}
2851 SRC LIB: ${gnome.src.lib.present}
2852 COMPILED: ${gnome.compiled.lib.present}</echo>-->
2853
2854 <if>
2855 <bool>
2856 <and>
2857 <isfalse value="${gnome.lib.min.present}"/> <!-- no gnome-lib-minimal binary present -->
[27034]2858 <istrue value="${gnome.src.lib.present}"/> <!-- gnome-lib folder for compilation is present-->
[28311]2859 <isfalse value="${gnome.compiled.lib.present}"/> <!-- gnome-lib not yet compiled, so no gnome-lib/os subfolder yet -->
[27034]2860 </and>
2861 </bool>
2862
2863 <!-- then compile it. Only necessary for mac/linux, since windows doesn't need gnome lib -->
2864 <exec executable="/bin/bash" dir="${gnome.lib.src.dir}" failonerror="true">
2865 <arg value="CASCADE-MAKE.sh"/>
2866 </exec>
2867 </if>
2868 </target>
2869
2870
[26791]2871 <target name="prepare-gnome-lib" depends="init" if="collection.building.enabled" unless="gnome-lib.present">
[27139]2872 <if>
2873 <bool>
[28643]2874 <istrue value="${checkout.gnomelib.ext}"/>
[27139]2875 </bool>
2876
[28643]2877 <antcall target="checkout-gnome-lib"/>
2878 <!--Compilation of gnome-lib happens during ant install, just before configuring (common-src and) build-src-->
2879
[28636]2880 <else>
[28643]2881 <echo>**** Not preparing gnome-lib:</echo>
2882 <echo>property checkout.gnomelib.ext in build.properties was not set or was set to false</echo>
[28636]2883 </else>
2884 </if>
2885 </target>
2886
2887
[26791]2888 <target name="checkout-gnome-lib" depends="init" if="collection.building.enabled" unless="nosvn.mode">
[27199]2889
2890 <property name="gnomelib.src.dir" value="${basedir}/gs2build/ext/gnome-lib"/>
2891 <condition property="gnome.src.present">
2892 <available file="${gnomelib.src.dir}" type="dir" />
2893 </condition>
2894
2895 <if>
2896 <bool>
2897 <not><istrue value="${gnome.src.present}"/></not>
2898 </bool>
2899
2900 <echo>checking out gnome-lib extension</echo>
2901 <exec executable="svn">
2902 <arg value="checkout"/>
2903 <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/src"/>
2904 <arg value="${gs2build.home}/ext/gnome-lib"/>
2905 </exec>
2906
2907 <else>
2908 <echo>gnomelib source code already exists at ${gnomelib.src.dir}</echo>
2909 </else>
2910 </if>
2911
[19843]2912 </target>
2913
[15124]2914 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
[15799]2915 unless="nosvn.mode">
[20930]2916
2917 <exec executable="svn">
2918 <arg value="checkout"/>
[21196]2919 <arg value="${svn.root}/main/${branch.path}/binaries/windows"/>
[20930]2920 <arg value="-r"/><arg value="${branch.revision}"/>
[21196]2921 <arg value="winbin"/>
[20930]2922 </exec>
2923
[15124]2924 </target>
2925
[15799]2926 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
[20930]2927 <exec executable="svn">
2928 <arg value="update"/>
2929 <arg value="winbin"/>
2930 <arg value="-r"/><arg value="${branch.revision}"/>
2931 </exec>
2932
[15799]2933 </target>
[15124]2934
2935 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
2936 <move todir="${gs2build.home}/bin/windows" failonerror="false">
2937 <fileset dir="${basedir}/winbin/bin"/>
2938 </move>
2939 </target>
[19843]2940
[15124]2941 <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
2942 <delete dir="${basedir}/winbin"/>
2943 </target>
2944
[19871]2945 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
2946 <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
2947 dest="${common.src.home}/packages/windows/crypt"/>
[18179]2948 <untar compression="gzip"
[19871]2949 src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
2950 dest="${common.src.home}/packages/sqlite"/>
2951 <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
2952 dest="${common.src.home}/indexers/packages/windows/iconv"/>
[15799]2953 </target>
[19878]2954
[15124]2955 <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
2956 <!-- we want a windows path in the setup.bat file -->
2957 <pathconvert targetos="windows" property="gs2build.home.windows">
2958 <path path="${gs2build.home}"/>
2959 </pathconvert>
2960 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
2961 <filterset>
[16620]2962 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
[15799]2963 </filterset>
[15124]2964 </move>
2965 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
2966 </target>
2967
[19843]2968
[19948]2969 <target name="clean-build-src" depends="init" if="collection.building.enabled">
[19871]2970 <!-- unix: -->
[26079]2971 <if><bool><available file="${build.src.home}/Makefile"/></bool>
[19948]2972 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
[15124]2973 <arg value="clean"/>
2974 </exec>
[26079]2975 </if>
[15124]2976 <!-- windows: -->
[28044]2977 <exec executable="nmake" dir="${build.src.home}" osfamily="windows" failonerror="true">
[15799]2978 <arg value="/f"/>
2979 <arg value="win32.mak"/>
2980 <arg value="clean"/>
[19960]2981 <arg value="GSDLHOME=${gs2build.home}"/>
[15124]2982 </exec>
2983 </target>
2984
[19948]2985
2986 <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
[19960]2987 <!-- unix: -->
[26079]2988 <if><bool><available file="${build.src.home}/Makefile"/></bool>
[19948]2989 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
[15124]2990 <arg value="distclean"/>
2991 </exec>
[26079]2992 </if>
[19960]2993 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
[28044]2994 <exec executable="nmake" dir="${build.src.home}" osfamily="windows" failonerror="true">
[19960]2995 <arg value="/f"/>
2996 <arg value="win32.mak"/>
2997 <arg value="clean"/>
2998 <arg value="GSDLHOME=${gs2build.home}"/>
2999 </exec>
[15124]3000 </target>
[19843]3001
[28643]3002 <target name="configure-build-src" depends="init" if="collection.building.enabled"
[19931]3003 description="Configure the build-src component">
3004 <exec executable="${build.src.home}/configure" os="${os.unix}"
3005 dir="${build.src.home}" failonerror="true">
3006 <arg value="--prefix=${gs2build.home}"/>
[26765]3007 <arg line="${gs2.opt.args} ${static.arg} ${cross.configure.args} ${allargs}"/>
[19931]3008 </exec>
3009 </target>
[19910]3010
[19931]3011 <!-- common-src is done separately and needs to be compiled first -->
3012 <target name="compile-build-src" depends="init" if="collection.building.enabled">
3013
3014 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
[23611]3015 <arg line="${ldlpath.arg}"/>
[22845]3016 </exec>
3017
3018 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
[19931]3019 <arg value="install"/>
3020 </exec>
[19910]3021
[19931]3022 <!-- run the setup script -->
[28044]3023 <!-- <exec executable="${compile.windows.c++.setup}" osfamily="windows" failonerror="true"/>-->
[19910]3024 <!--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-->
[28044]3025 <exec executable="nmake" dir="${build.src.home}" osfamily="windows" failonerror="true">
[19910]3026 <arg value="/f"/>
3027 <arg value="win32.mak"/>
[19934]3028 <arg value="GSDLHOME=${gs2build.home}"/>
[19910]3029 </exec>
[28044]3030 <exec executable="nmake" dir="${build.src.home}" osfamily="windows" failonerror="true">
[19910]3031 <arg value="/f"/>
3032 <arg value="win32.mak"/>
3033 <arg value="install"/>
[19934]3034 <arg value="GSDLHOME=${gs2build.home}"/>
[19910]3035 </exec>
[15124]3036 </target>
3037
3038
[15799]3039 <!-- ======================== TESTING Targets ========================= -->
[15124]3040
3041 <target name="test" description="Run the (incomplete) JUnit test suite "
3042 depends="init">
3043 <mkdir dir="${basedir}/test"/>
3044 <junit printsummary="withOutAndErr"
3045 errorproperty="test.failed"
3046 failureproperty="test.failed"
3047 fork="${junit.fork}">
3048 <formatter type="plain"/>
3049 <classpath>
[16936]3050 <pathelement location="${build.home}/gsdl3test.jar"/>
3051 <path refid="compile.classpath"/>
[15124]3052 </classpath>
3053 <test name="${testcase}" if="testcase"/>
3054 <batchtest todir="${basedir}/test" unless="testcase">
[18505]3055 <fileset dir="${build.home}" includes="**/*Test.class" />
[15124]3056 </batchtest>
3057 </junit>
3058 <echo>
3059 *********************************************
[15799]3060 Test output can be found in directory 'test'
[15124]3061 *********************************************
3062 </echo>
3063 </target>
[15799]3064
[20950]3065 <!-- ======================== FLAX Targets ========================= -->
3066 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
3067 <echo>checking out flax ...</echo>
3068 <mkdir dir="${basedir}/src/java/org/flax"/>
3069 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
[22198]3070 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/action/flax"/>
[20950]3071 <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
3072 <mkdir dir="${web.home}/interfaces/flax"/>
3073 <mkdir dir="${web.home}/sites/flax"/>
3074 <mkdir dir="${basedir}/flax-resources"/>
3075 <mkdir dir="${basedir}/flax-lib"/>
[21272]3076 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
3077 <arg value="src/java/org/flax"/></exec>
3078 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
3079 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
[22198]3080 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/action/flax"/>
3081 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
3082 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
[21272]3083 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
3084 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
3085 <arg value="${web.home}/interfaces/flax"/></exec>
3086 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
3087 <arg value="${web.home}/sites/flax"/></exec>
3088 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
3089 <arg value="flax-resources"/></exec>
3090 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
3091 <arg value="flax-lib"/></exec>
[25901]3092 <antcall target="flax-copy-del-files" />
[20950]3093 </target>
[23442]3094
[25901]3095 <target name="flax-copy-del-files" description="copy some flax files into the appropriate greenstone3 directories and delete some unwanted greenstone stuff">
[23442]3096 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
3097 <copy todir="${web.home}/WEB-INF/lib">
[25901]3098 <fileset dir="${basedir}/flax-lib">
3099 <include name="*.jar"/>
3100 </fileset>
[23442]3101 </copy>
[25904]3102 <!--<delete dir="${web.home}/sites/gateway"/>
3103 <delete dir="${web.home}/sites/localsite"/>-->
[23442]3104 </target>
[20950]3105
3106 <target name="update-flax" description="update flax from repository">
3107 <echo>updating flax ...</echo>
[21272]3108 <exec executable="svn"><arg value="update"/>
3109 <arg value="src/java/org/flax"/></exec>
3110 <exec executable="svn"><arg value="update"/>
[22198]3111 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
3112 <exec executable="svn"><arg value="update"/>
[21272]3113 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
3114 <exec executable="svn"><arg value="update"/>
3115 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
3116 <exec executable="svn"><arg value="update"/>
3117 <arg value="${web.home}/interfaces/flax"/></exec>
3118 <exec executable="svn"><arg value="update"/>
[24366]3119 <arg value="${web.home}/web/sites/flax"/></exec>
3120 <exec executable="svn"><arg value="update"/>
[21272]3121 <arg value="flax-resources"/></exec>
3122 <exec executable="svn"><arg value="update"/>
3123 <arg value="flax-lib"/></exec>
[24098]3124 <antcall target="compile-core" />
[20950]3125 </target>
3126
[25901]3127 <!-- ========================End of FLAX Targets ========================= -->
[20963]3128
[19354]3129 <target name="compile-javadocs">
3130 <javadoc packagenames="org.greenstone.*"
3131 sourcepath="src/java"
3132 defaultexcludes="yes"
3133 destdir="docs/javadoc"
3134 author="true"
3135 version="true"
3136 use="true"
3137 windowtitle="Greenstone3 API">
3138 <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
3139 </javadoc>
3140 </target>
3141
[20089]3142<!-- ========== Some distribution targets ======================== -->
[19972]3143 <target name="remove-source">
[23809]3144 <if><bool><isset property="with.gli.and.gems"/></bool>
[19975]3145 <delete includeEmptyDirs="true">
3146 <fileset dir="." defaultexcludes="false">
3147 <patternset refid="greenstone3.source.component"/>
3148 </fileset>
3149 </delete>
[23809]3150
3151 <else>
3152 <delete includeEmptyDirs="true">
3153 <fileset dir="." defaultexcludes="false">
3154 <patternset refid="greenstone3.source.no.gli.component"/>
3155 </fileset>
3156 </delete>
3157 </else>
3158 </if>
[19972]3159 </target>
3160
[19903]3161 <target name="dist-tidy"
[29387]3162 description="'tidies-up' a greenstone3 installation for distribution."
3163 unless="${properties.keep.src}">
[19903]3164
3165 <!-- delete unneeded things -->
3166 <delete dir="${packages.home}/axis"/>
3167 <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
3168 <delete file="README-SVN.txt"/>
[20215]3169 <delete file="build.properties.in"/>
[19903]3170
[19961]3171 <!-- delete source files -->
[19972]3172 <antcall target="remove-source"/>
[19903]3173
3174 <!-- create empty directories -->
[27829]3175 <mkdir dir="${web.writablehome}/applet"/>
3176 <mkdir dir="${web.writablehome}/logs"/>
3177 <mkdir dir="${web.writablehome}/logs/tmp"/>
[19903]3178
[27902]3179 <!-- Lines with ***** are commented out because these files are useful if we want hybrid installations -->
3180
[19903]3181 <!-- os specific tidy-ups -->
[20051]3182 <!-- linux, mac -->
3183 <if><bool><istrue value="${current.os.isunix}"/></bool>
[27902]3184 <!--*****<delete><fileset dir="." includes="*.bat"/></delete>-->
[23809]3185 <if><bool><isset property="with.gli.and.gems"/></bool>
[27902]3186 <!--*****<delete><fileset dir="gli" includes="*.bat"/></delete>-->
[23809]3187 </if>
[27902]3188 <!--*****<delete><fileset dir="gs2build" includes="*.bat"/></delete>-->
3189 <!--*****<delete><fileset dir="bin/script" includes="*.bat"/></delete>-->
[19946]3190 <delete file="${basedir}/gs2build/win32cfg.h"/>
[19939]3191 <delete file="${basedir}/gs2build/win32.mak"/>
[20051]3192 <delete dir="${basedir}/winutil"/>
[19903]3193 <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
3194
[20051]3195 <!-- windows -->
3196 <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
[27902]3197 <!--*****<delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>-->
[23809]3198 <if><bool><isset property="with.gli.and.gems"/></bool>
[27902]3199 <!--*****<delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>-->
[23809]3200 </if>
[27902]3201 <!--*****<delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>-->
3202 <!--*****<delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>-->
[20051]3203 </if></else></if>
3204
[19903]3205 </target>
3206
[20089]3207 <!-- fix up executable permissions for binary release -->
3208 <target name="fix-execute-permissions">
3209 <echo>Setting binaries to executable</echo>
[20127]3210 <chmod perm="775">
3211 <fileset dir="."><patternset refid="greenstone3.executables"/></fileset>
3212 </chmod>
[20089]3213 </target>
3214
3215 <!-- fix up executable permissions for source code release -->
3216 <target name="fix-execute-permissions-source">
[20127]3217 <chmod perm="775">
3218 <fileset dir="."><patternset refid="greenstone3.source.executables"/></fileset>
3219 </chmod>
[20089]3220 </target>
3221
[27380]3222 <!-- for macs, set up the .app shortcuts to gsi, gli, client-gli and gems -->
3223 <target name="gen-mac-shortcuts">
3224 <if><bool><istrue value="${current.os.ismac}"/></bool>
3225 <filter token="gsdl3srchome" value="${basedir}"/>
3226 <copy file="${basedir}/gs3-server.app/Contents/document.wflow.in" tofile="${basedir}/gs3-server.app/Contents/document.wflow" filtering="true" overwrite="true"/>
3227 <copy file="${basedir}/gli.app/Contents/document.wflow.in" tofile="${basedir}/gli.app/Contents/document.wflow" filtering="true" overwrite="true"/>
3228 <copy file="${basedir}/client-gli.app/Contents/document.wflow.in" tofile="${basedir}/client-gli.app/Contents/document.wflow" filtering="true" overwrite="true"/>
3229 <copy file="${basedir}/gems.app/Contents/document.wflow.in" tofile="${basedir}/gems.app/Contents/document.wflow" filtering="true" overwrite="true"/>
3230 </if>
3231 </target>
[20089]3232
[19931]3233 <!-- ============= tweaks for making compilation static ========== -->
3234 <target name="tweak-makefiles" depends="init" if="compile.static">
3235 <antcall target="rtftohtml-add-static" />
3236 </target>
3237
3238 <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
[28136]3239 <rsr verbosity="1" file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
[19931]3240 </target>
3241
[26115]3242 <target name="run-collection-tests">
3243 <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool>
3244 <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail>
3245 </if>
3246 <for param="testjar">
3247 <path>
3248 <fileset dir="${basedir}" includes="web/sites/*/collect/*/tests/tests.jar"/>
3249 </path>
3250 <sequential>
3251 <echo>Testing @{testjar}</echo>
3252 <java classname="org.junit.runner.JUnitCore" fork="true">
3253 <arg value="gstests.TestClass"/>
3254 <jvmarg value="-DSERVERURL=http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet} "/>
3255 <classpath>
3256 <fileset dir="${basedir}/ext/testing/lib/java">
3257 <include name="*.jar"/>
3258 </fileset>
3259 <files includes="@{testjar}"/>
3260 </classpath>
3261 </java>
3262 </sequential>
3263 </for>
3264 </target>
3265
3266 <target name="build-collection-tests">
3267 <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool>
3268 <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail>
3269 </if>
3270 <for param="compiledir">
3271 <path>
3272 <dirset dir="${basedir}" includes="web/sites/*/collect/*/tests/src"/>
3273 </path>
3274 <sequential>
3275 <echo>Compiling @{compiledir}</echo>
3276 <if><bool><not><available file="@{compiledir}/../build" type="dir"/></not></bool>
3277 <mkdir dir="@{compiledir}/../build"/>
3278 </if>
3279 <javac
3280 srcdir="@{compiledir}"
3281 destdir="@{compiledir}/../build"
[28137]3282 includeantruntime="${compile.includeantruntime}"
[26115]3283 debug="${compile.debug}"
3284 deprecation="${compile.deprecation}"
[29515]3285 optimize="${compile.optimize}"
3286 encoding="${compile.encoding}">
[26115]3287 <classpath>
3288 <fileset dir="${basedir}/ext/testing/lib/java">
3289 <include name="*.jar"/>
3290 </fileset>
3291 </classpath>
3292 <include name="gstests/*.java"/>
3293 </javac>
3294 <jar destfile="@{compiledir}/../tests.jar">
3295 <fileset dir="@{compiledir}/../build">
3296 <include name="gstests/**"/>
3297 </fileset>
3298 <manifest>
3299 <attribute name="Built-By" value="${user.name}" />
3300 </manifest>
3301 </jar>
3302 </sequential>
3303 </for>
3304 </target>
[26002]3305</project>
Note: See TracBrowser for help on using the repository browser.