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

Last change on this file since 28044 was 28044, checked in by ak19, 11 years ago

Related to previous commit: all exec tasks specific to windows now check osfamily=windows rather than checking os=os.winows, where the latter is a property string defined by Greenstone as a list of recognised Windows versions and which can grow in future, requiring constant maintenance. Using osfamily does not require maintenance and at least won't fail silently when using tasks such as ant start and start-tomcat. Can't use osfamily=unix in the same way, since osfamily=mac is defined as separate from unix (and doesn't include os/2), so sticking to the os=os.unix test for when exec should behave the same on mac as on linux, since the os.unix property is defined to be unix/mac/solaris as a group and thus works fine for the intentions in build.xml.

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