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

Last change on this file since 23852 was 23852, checked in by davidb, 13 years ago

Additional capability introduced to control how Perl is found.

  1. if perl.path is set in build.properies then this is used ('perl' is concatenated on to the end)
  2. failing that, if the environment variable PERLPATH is set this is used (again 'perl' is concatenated)
  3. failing that, for Unix systems, 'which' is used to locate it on the path
File size: 89.0 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="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
26
27 <!-- ===================== Property Definitions =========================== -->
28
29 <!--
30
31 Each of the following properties are used in the build script.
32 Values for these properties are set by the first place they are
33 defined, from the following list:
34
35 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
36
37 * Definitions from a "build.properties" file in the top level
38 source directory of this application.
39
40 * Definitions from a "build.properties" file in the user's
41 home directory.
42
43 * Default definitions in this build.xml file.
44
45 You will note below that property values can be composed based on the
46 contents of previously defined properties. This is a powerful technique
47 that helps you minimize the number of changes required when your development
48 environment is modified. Note that property composition is allowed within
49 "build.properties" files as well as in the "build.xml" script.
50
51 -->
52
53 <!-- create build.properties if it has not been created yet -->
54 <if>
55 <bool><not><available file="build.properties"/></not></bool>
56 <copy file="build.properties.in" tofile="build.properties"/>
57 </if>
58
59 <!-- create the packages dir if it has not been created yet -->
60 <mkdir dir="packages"/>
61
62 <!--the first three properties have to be put on the top to be used by build.properties-->
63 <property name="gs2build.home" value="${basedir}${file.separator}gs2build"/>
64 <property name="src.packages.home" value="${basedir}/src/packages"/>
65 <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
66
67 <property file="build.properties"/>
68 <if><bool><available file="${user.home}/build.properties"/></bool>
69 <property file="${user.home}/build.properties"/>
70 </if>
71
72 <!-- now we've read in properties, apply defaults -->
73 <property name="disable.collection.building" value="false"/>
74
75 <!-- get properties from the environment -->
76 <property environment="env"/>
77
78 <!-- uses perl.path if set in build.properties, otherwise try for
79 environment variable PERLPATH, and failing that assumes 'perl'
80 is on environment PATH -->
81
82 <if><bool><isset property="env.PERLPATH"/></bool>
83 <property name="perl.path" value="${env.PERLPATH}"/>
84 <else>
85 <echo>
86 Using PATH enviroment variable to locate Perl.
87 <exec executable="which" spawn="false" outputproperty="full.perl.path">
88 <arg value="perl" />
89 </exec>
90 <echo>
91 <if><equals arg1="${full.perl.path}" arg2="/usr/bin/perl" />
92 Non-stanard location of Perl found: ${full.perl.path}
93 Set the environment variable PERLPATH or the perl.path property in
94 build.properties to explicitly control the version of Perl used.
95 </echo>
96 </else>
97 </if>
98
99<!--
100 <if><bool><isset property="perl.on.path"/></bool>
101 <propertyregex property="perl.path"
102 input="perl.on.path"
103 regexp=".*([^\/]*)"
104 select="\1" />
105 </if>
106-->
107
108 <!-- full.perl.path is for pretty-printing only, e.g. used in target "start" -->
109 <if><bool><isset property="perl.path"/></bool>
110 <property name="full.perl.path" value="${perl.path}${file.separator}perl"/>
111 <else>
112 <property name="full.perl.path" value="perl (will use the enviroment variable PATH to find this executable)"/>
113 </else>
114 </if>
115
116 <!-- get the filesets defining components and executables -->
117 <import file="resources/xml/components.xml"/>
118 <import file="resources/xml/executables.xml"/>
119
120 <!-- version properties for external packages -->
121 <!-- for Java versions < 1.4, we print out the message that Java is too old.
122 For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 6.0-->
123 <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-6.0.20">
124 <equals arg1="1.4" arg2="${ant.java.version}"/>
125 </condition>
126 <condition property="tomcat.version.major" value="5" else="6">
127 <equals arg1="1.4" arg2="${ant.java.version}"/>
128 </condition>
129 <condition property="privileged.attribute" value="privileged='true'" else="">
130 <equals arg1="6" arg2="${tomcat.version.major}"/>
131 </condition>
132
133 <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
134 <property name="axis.dir.version" value="axis-1_4"/>
135 <property name="sqlite.targz.version" value="sqlite-amalgamation-3.5.9.tar.gz"/>
136
137 <property name="build.home" value="${basedir}/build"/>
138 <property name="src.home" value="${basedir}/src/java"/>
139 <property name="packages.home" value="${basedir}/packages"/>
140 <!-- this may be set in build.properties, eg if you move the web dir to
141 tomcats webapps directory -->
142 <property name="web.home" value="${basedir}/web"/>
143 <!-- jar files needed by applets go here -->
144 <property name="web.applet" value="${web.home}/applet"/>
145
146 <!-- jar files needed by the servlet (and extra ones) go here -->
147 <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
148 <!-- other files needed by the servlet go here -->
149 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
150 <!--- flax: the WordNet home -->
151 <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
152
153 <!-- jni libraries and java wrappers go here -->
154 <property name="lib.jni" value="${basedir}/lib/jni"/>
155
156 <!-- other jar files needed for installation (but not runtime) go here -->
157 <property name="lib.java" value="${basedir}/lib/java"/>
158
159 <property name="javadocs" value="${basedir}/docs/javadoc"/>
160
161 <property name="app.name" value="greenstone3"/>
162 <property name="app.path" value="/${app.name}"/>
163
164 <property name="admin.dir" value="${basedir}/admin"/>
165
166 <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
167 <property name="app.version" value="trunk"/>
168 <property name="branch.path" value="trunk"/>
169 <property name="branch.revision" value="HEAD"/>
170
171 <!--constants -->
172 <property name="svn.root" value="http://svn.greenstone.org"/>
173
174 <!-- catalina home is set to tomcat basedir if already installed, otherwise
175 use greenstone's tomcat -->
176 <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
177 <and>
178 <isset property="tomcat.installed.path"/>
179 <not>
180 <equals arg1="" arg2="${tomcat.installed.path}"/>
181 </not>
182 </and>
183 </condition>
184
185 <property name="os.linux" value="Linux"/>
186 <property name="os.mac" value="Mac OS X"/>
187 <property name="os.solaris" value="SunOS"/>
188 <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
189 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows 2003,Windows XP,Windows NT,Windows ME,Windows Vista,Windows 7"/> <!-- check this!!!-->
190
191 <!-- this is true for linux and macs -->
192 <condition property="current.os.isunix">
193 <os family="unix"/>
194 </condition>
195
196 <condition property="current.os.isunixnotmac">
197 <and>
198 <os family="unix"/>
199 <not>
200 <os family="mac"/>
201 </not>
202 </and>
203 </condition>
204
205 <condition property="current.os.ismac">
206 <os family="mac"/>
207 </condition>
208
209 <condition property="current.os.iswindows">
210 <os family="windows"/>
211 </condition>
212
213 <!-- is there a better way to do this?? what about solaris?? -->
214 <condition property="os.bin.dir" value="windows">
215 <os family="windows"/>
216 </condition>
217 <condition property="os.bin.dir" value="darwin">
218 <os family="mac"/>
219 </condition>
220 <condition property="os.bin.dir" value="linux">
221 <and>
222 <os family="unix"/>
223 <not>
224 <os family="mac"/>
225 </not>
226 </and>
227 </condition>
228
229
230 <condition property="collection.building.disabled">
231 <and>
232 <isset property="disable.collection.building"/>
233 <istrue value="${disable.collection.building}"/>
234 </and>
235 </condition>
236
237 <condition property="collection.building.enabled">
238 <not>
239 <istrue value="${disable.collection.building}"/>
240 </not>
241 </condition>
242
243 <condition property="collection.building.enabled.windows">
244 <and>
245 <istrue value="${collection.building.enabled}"/>
246 <isset property="current.os.iswindows"/>
247 </and>
248 </condition>
249
250 <condition property="collection.building.enabled.unix">
251 <and>
252 <istrue value="${collection.building.enabled}"/>
253 <isset property="current.os.isunix"/>
254 </and>
255 </condition>
256
257 <condition property="static.arg" value="LDFLAGS=-static" else=" ">
258 <isset property="compile.static"/>
259 </condition>
260
261 <!-- If building a release then we want to adjust environment variables so that the support library can be see during compilation -->
262 <if><bool><isset property="use.support.lib"/></bool>
263 <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
264
265 <if><bool><isset property="env.CFLAGS"/></bool>
266 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CFLAGS}&quot;"/>
267 <else>
268 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
269 </else>
270 </if>
271
272 <if><bool><isset property="env.CPPFLAGS"/></bool>
273 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CPPFLAGS}&quot;"/>
274 <else>
275 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
276 </else>
277 </if>
278
279 <if><bool><isset property="env.CXXFLAGS"/></bool>
280 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CXXFLAGS}&quot;"/>
281 <else>
282 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
283 </else>
284 </if>
285
286 <if><bool><isset property="env.LDFLAGS"/></bool>
287 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
288 <else>
289 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib&quot;"/>
290 </else>
291 </if>
292
293 <if><bool><isset property="env.PATH"/></bool>
294 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
295 <else>
296 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin&quot;"/>
297 </else>
298 </if>
299
300 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
301 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
302 <else>
303 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig&quot;"/>
304 </else>
305 </if>
306
307 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
308 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
309 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}&quot;"/>
310 <else>
311 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
312 </else>
313 </if>
314 <else>
315 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
316 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}&quot;"/>
317 <else>
318 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
319 </else>
320 </if>
321 </else>
322 </if>
323
324 <else>
325 <if><bool><isset property="env.CFLAGS"/></bool>
326 <property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
327 <else>
328 <property name="cflags.arg" value=" "/>
329 </else>
330 </if>
331
332 <if><bool><isset property="env.CPPFLAGS"/></bool>
333 <property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
334 <else>
335 <property name="cppflags.arg" value=" "/>
336 </else>
337 </if>
338
339 <if><bool><isset property="env.CXXFLAGS"/></bool>
340 <property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
341 <else>
342 <property name="cxxflags.arg" value=" "/>
343 </else>
344 </if>
345
346 <if><bool><isset property="env.LDFLAGS"/></bool>
347 <property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
348 <else>
349 <property name="ldflags.arg" value=" "/>
350 </else>
351 </if>
352
353 <if><bool><isset property="env.PATH"/></bool>
354 <property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
355 <else>
356 <property name="path.arg" value=" "/>
357 </else>
358 </if>
359
360 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
361 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
362 <else>
363 <property name="pcpath.arg" value=" "/>
364 </else>
365 </if>
366
367 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
368 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
369 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
370 <else>
371 <property name="ldlpath.arg" value=" "/>
372 </else>
373 </if>
374 <else>
375 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
376 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
377 <else>
378 <property name="ldlpath.arg" value=" "/>
379 </else>
380 </if>
381 </else>
382 </if>
383 </else>
384 </if>
385 <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
386
387 <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
388 <istrue value="${with.jni}"/>
389 </condition>
390 <condition property="gs2.compile.target" value="with-jni" else="without-jni">
391 <istrue value="${with.jni}"/>
392 </condition>
393 <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni">
394 <istrue value="${with.jni}"/>
395 </condition>
396 <condition property="gs2.windows.enablejni" value="1" else="0">
397 <istrue value="${with.jni}"/>
398 </condition>
399 <condition property="gs2.windows.enablemg" value="1" else="0">
400 <istrue value="${with.jni}"/>
401 </condition>
402 <condition property="gs2.windows.enablemgpp" value="1" else="0">
403 <istrue value="${with.jni}"/>
404 </condition>
405 <!-- Should accent folding not also be set here ?? -->
406 <condition property="gs2.windows.usegdbm" value="1" else="0">
407 <istrue value="${with.jni}"/>
408 </condition>
409 <condition property="gs2.windows.usesqlite" value="1" else="0">
410 <istrue value="${with.jni}"/>
411 </condition>
412
413 <!-- where is search4j tool -->
414 <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
415 <isset property="current.os.iswindows"/>
416 </condition>
417
418
419 <!-- ============= Base dirs for each package and component ============ -->
420 <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
421 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
422 <property name="gli.home" value="${basedir}/gli"/>
423 <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
424
425 <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}${file.separator}common-src">
426 <istrue value="${disable.collection.building}"/>
427 </condition>
428
429 <property name="build.src.home" value="${gs2build.home}/build-src"/>
430 <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
431 <property name="mg.home" value="${common.src.home}/indexers/mg"/>
432 <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
433 <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
434
435 <!-- ==================== Compilation Control Options ==================== -->
436
437 <!--
438
439 These properties control option settings on the Javac compiler when it
440 is invoked using the <javac> task.
441
442 compile.debug Should compilation include the debug option?
443
444 compile.deprecation Should compilation include the deprecation option?
445
446 compile.optimize Should compilation include the optimize option?
447
448 -->
449
450 <property name="compile.debug" value="true"/>
451 <property name="compile.deprecation" value="true"/>
452 <property name="compile.optimize" value="true"/>
453
454 <!--
455
456 Rather than relying on the CLASSPATH environment variable, Ant includes
457 features that makes it easy to dynamically construct the classpath you
458 need for each compilation. The example below constructs the compile
459 classpath to include the servlet.jar file, as well as the other components
460 that Tomcat makes available to web applications automatically, plus anything
461 that you explicitly added.
462
463 -->
464
465 <!-- All elements that Tomcat 5 exposes to applications -->
466 <path id="tomcat5">
467 <pathelement location="${catalina.home}/common/classes"/>
468 <fileset dir="${catalina.home}/common/endorsed">
469 <include name="*.jar"/>
470 </fileset>
471 <fileset dir="${catalina.home}/common/lib">
472 <include name="*.jar"/>
473 </fileset>
474 <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
475 <pathelement location="${catalina.home}/shared/classes"/>
476 <fileset dir="${catalina.home}/shared/lib">
477 <include name="*.jar"/>
478 </fileset>
479 </path>
480
481 <!-- All elements that Tomcat 6 exposes to applications -->
482 <path id="tomcat6">
483 <fileset dir="${catalina.home}/lib">
484 <include name="*.jar"/>
485 </fileset>
486 </path>
487
488 <path id="compile.classpath">
489 <!-- Include all jar files and libraries in our jni lib directory -->
490 <pathelement location="${lib.jni}"/>
491 <fileset dir="${lib.jni}">
492 <include name="*.jar"/>
493 </fileset>
494 <!-- Include all jar files in our web lib directory -->
495 <pathelement location="${web.lib}"/>
496 <fileset dir="${web.lib}">
497 <include name="*.jar"/>
498 </fileset>
499
500 <pathelement location="${lib.java}"/>
501 <fileset dir="${lib.java}">
502 <include name="*.jar"/>
503 </fileset>
504
505 <!-- include the jar files from the source packages -->
506 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
507 so we add them in by name -->
508 <!-- *** is there any way to make this optional, based on ${with.jni}? -->
509 <pathelement location="${lib.jni}/mg.jar"/>
510 <pathelement location="${lib.jni}/mgpp.jar"/>
511
512 <!-- Include all elements that Tomcat exposes to applications -->
513 <path refid="tomcat${tomcat.version.major}"/>
514
515 </path>
516
517 <path id="local.tomcat.classpath">
518 <!-- explicitly include the jni java wrappers in the classpath -->
519 <pathelement location="${lib.jni}"/>
520 <fileset dir="${lib.jni}">
521 <include name="*.jar"/>
522 </fileset>
523 </path>
524
525 <path id="local.tomcat.path">
526 <pathelement location="${basedir}/bin/script"/>
527 <pathelement location="${basedir}/bin"/>
528 <pathelement location="${lib.jni}"/>
529 <pathelement path="${env.PATH}"/>
530 <pathelement path="${env.Path}"/>
531 <pathelement path="${wn.home}/bin"/>
532 </path>
533
534 <target name="test-setup">
535 <echo>ant java version=${ant.java.version}</echo>
536 <echo>is unix : ${current.os.isunix}</echo>
537 <echo>is mac : ${current.os.ismac}</echo>
538 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
539 <echo>is windows : ${current.os.iswindows}</echo>
540 <echo>os.unix: ${os.unix}</echo>
541 </target>
542
543 <!-- ==================== Primary and Global Targets ============================= -->
544
545 <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
546 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.">
547
548 <!-- make sure .sh files are executable -->
549 <chmod dir="${basedir}" perm="ugo+rx"
550 includes="*.sh"/>
551 <chmod dir="${basedir}/bin/script" perm="ugo+rx"
552 includes="*.sh,*.pl"/>
553 </target>
554
555 <!-- 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 -->
556 <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
557 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
558
559 <target name="install-common-src" depends="init"
560 description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2). " >
561 <antcall target="configure-common-src"/>
562 <antcall target="compile-common-src"/>
563 <antcall target="install-auxiliary-jar-files"/>
564 <antcall target="install-jni-files"/>
565 </target>
566
567 <target name="install-collection-building" depends="init" if="collection.building.enabled"
568 description="Install (configure, compile, install) the Greenstone 2 collection building package." >
569 <antcall target="configure-collection-building"/>
570 <antcall target="tweak-makefiles" />
571 <antcall target="compile-collection-building"/>
572 </target>
573
574
575 <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core,compile-classpath-jars"
576 description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
577
578 <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
579 description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
580
581 <target name="configure" depends="init,configure-tomcat,configure-web"
582 description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file."/>
583
584 <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
585 description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
586
587 <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building,clean-classpath-jars"
588 description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
589
590 <target name="update" depends="init,svnupdate,clean,install"
591 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'"/>
592
593 <target name="start" depends="init,start-tomcat"
594 description="Startup the Tomcat server." >
595 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
596 <echo>Tomcat: ${catalina.home}</echo>
597 <echo>Java : ${java.home}</echo>
598 <if><bool><available file="${build.src.home}"/></bool>
599 <echo>Perl : ${full.perl.path}</echo>
600 </if>
601 <echo>URL : http://${tomcat.server}:${tomcat.port}${app.path}/</echo>
602 <!-- assuming that index.html is not needed here -->
603 </target>
604
605 <target name="stop" depends="init,stop-tomcat"
606 description="Shutdown the Tomcat server."/>
607
608 <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
609
610
611 <!-- =========== Help targets =================================== -->
612
613 <property name="install-command" value="ant [options] prepare install"/>
614
615 <target name="usage" description="Print a help message">
616 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
617 <echo message=" Execute 'ant -help' for Ant help."/>
618 <echo>
619 To install Greenstone3, run '${install-command}'.
620 There are properties defined in build.properties. The install
621 process will ask you if these properties are set correctly.
622 To avoid this prompt, use the '-Dproperties.accepted=yes'
623 option.
624 To log the output, use the '-logfile build.log' option.
625 The README.txt file has more information about the ant targets
626 and install process.
627 </echo>
628 </target>
629
630 <target name="help" depends="usage" description="Print a help message"/>
631
632 <target name="debug" depends="init" description="Display all the currently used properties">
633 <echoproperties/>
634 </target>
635
636 <!-- ====== initialization and setup targets ================== -->
637
638 <target name="accept-properties" unless="properties.accepted">
639 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
640 tomcat.server=${tomcat.server}
641 tomcat.port=${tomcat.port}
642 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
643 proxy.host=${proxy.host}
644 proxy.port=${proxy.port}
645 disable.collection.building=${disable.collection.building}
646 If these are not acceptable, please change them and rerun this target. Continue [y/n]?
647 </input>
648 <condition property="do.abort">
649 <equals arg1="n" arg2="${properties.ok}"/>
650 </condition>
651 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
652 </target>
653
654 <!-- this sets up some initial properties -->
655 <target name="init">
656
657 <!-- has the gs3-setup script been run?? -->
658 <condition property="gs3-setup-not-done">
659 <not>
660 <isset property="env.GSDL3HOME"/>
661 </not>
662 </condition>
663
664 <!--<fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>-->
665
666 <condition property="java.too.old">
667 <or>
668 <equals arg1="1.1" arg2="${ant.java.version}"/>
669 <equals arg1="1.2" arg2="${ant.java.version}"/>
670 <equals arg1="1.3" arg2="${ant.java.version}"/>
671 </or>
672 </condition>
673 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
674
675 <available file="${basedir}/gli" property="gli.present"/>
676 <available file="${basedir}/common-src" property="common.src.present"/>
677 <available file="${basedir}/gs2build" property="gs2build.present"/>
678
679 <condition property="tomcat.islocal">
680 <or>
681 <not><isset property="tomcat.installed.path"/></not>
682 <equals arg1="" arg2="${tomcat.installed.path}"/>
683 </or>
684 </condition>
685
686 <echo>tomcat.port = ${tomcat.port}</echo>
687
688 <condition property="proxy.present">
689 <and>
690 <isset property="proxy.host"/>
691 <not><equals arg1="" arg2="${proxy.host}"/></not>
692 </and>
693 </condition>
694
695 <!--
696 the next block checks if the bundled tomcat is present in the 'packages' directory,
697 and checks for the lethal combination of tomcat 6 and java 1.4. Test for
698 tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
699 download, as there is no other surefire way to check tomcat version under java 1.4
700 -->
701 <condition property="packages.tomcat.ispresent" value="true" else="false">
702 <available file="packages/tomcat"/>
703 </condition>
704 <condition property="packages.tomcat.istomcat6" value="true" else="false">
705 <available file="packages/tomcat/tomcat6.txt"/>
706 </condition>
707 <if>
708 <bool>
709 <and>
710 <istrue value="${packages.tomcat.ispresent}"/>
711 <istrue value="${packages.tomcat.istomcat6}"/>
712 <equals arg1="1.4" arg2="${ant.java.version}"/>
713 </and>
714 </bool>
715 <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>
716 </if>
717
718 </target>
719
720 <target name="setup-proxy" depends="init" if="proxy.present">
721 <condition property="ask.user">
722 <or>
723 <equals arg1="" arg2="${proxy.user}"/>
724 <equals arg1="" arg2="${proxy.password}"/>
725 </or>
726 </condition>
727
728 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
729 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
730 </target>
731
732 <!-- ========== Web app Targets ================================ -->
733
734 <target name="prepare-web" depends="init">
735 <mkdir dir="${web.home}/applet"/>
736 <mkdir dir="${web.home}/logs"/>
737 </target>
738
739 <!-- 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 -->
740 <target name="configure-java-version" depends="init"
741 description="Activates or deactivates some jar libraries as needed depending on your java version">
742
743 <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
744 <condition property="need.xalan.jar">
745 <or>
746 <equals arg1="1.5" arg2="${ant.java.version}"/>
747 <equals arg1="1.6" arg2="${ant.java.version}"/>
748 </or>
749 </condition>
750
751 <!-- if they have xalan.jar but dont need it -->
752 <if>
753 <bool>
754 <and>
755 <isset property="have.xalan.jar"/>
756 <not><isset property="need.xalan.jar"/></not>
757 </and>
758 </bool>
759 <antcall target="deactivate-xalan-jar"/>
760 </if>
761
762 <!-- if they need xalan.jar but dont have it -->
763 <if>
764 <bool>
765 <and>
766 <not><isset property="have.xalan.jar"/></not>
767 <isset property="need.xalan.jar"/>
768 </and>
769 </bool>
770 <antcall target="activate-xalan-jar"/>
771 </if>
772
773 </target>
774
775 <target name="activate-xalan-jar">
776 <echo>activating xalan.jar</echo>
777 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
778 <if>
779 <bool>
780 <and>
781 <isset property="current.os.ismac"/>
782 <available file="${catalina.home}/common/endorsed" type="dir"/>
783 </and>
784 </bool>
785 <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
786 </if>
787 </target>
788
789 <target name="deactivate-xalan-jar">
790 <echo>deactivating xalan.jar</echo>
791 <delete file="${web.lib}/xalan.jar"/>
792 <!-- should we be deleting common/endorsed/xalan.jar on mac?? -->
793 </target>
794
795
796 <target name="prepare-collections" depends="init">
797 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
798 <property name="index.zip" value="index.zip"/>
799
800 <echo message="installing collections..."/>
801 <antcall target="gs2mgdemo-install"/>
802 <antcall target="gs2mgppdemo-install"/>
803 <antcall target="gberg-install"/>
804 </target>
805
806 <target name="gs2mgdemo-prepare" if="collect.dir">
807 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
808
809 <condition property="gs2mgdemo.present">
810 <and>
811 <available file="${gs2mgdemo.dir}/${index.zip}"/>
812 </and>
813 </condition>
814 </target>
815
816 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
817 <echo> installing gs2mgdemo</echo>
818 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
819 <echo>collection gs2mgdemo installed</echo>
820 </target>
821
822 <target name="gs2mgppdemo-prepare" if="collect.dir">
823 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
824
825 <condition property="gs2mgppdemo.present">
826 <and>
827 <available file="${gs2mgppdemo.dir}/${index.zip}"/>
828 </and>
829 </condition>
830 </target>
831
832 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
833 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
834 <echo>collection gs2mgppdemo installed</echo>
835 </target>
836
837 <target name="gberg-prepare" if="collect.dir">
838 <property name="gberg.dir" value="${collect.dir}/gberg"/>
839 <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
840 </target>
841
842 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
843 <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
844 <echo>collection gberg installed</echo>
845 </target>
846
847 <target name="configure-web" depends="init"
848 description="Configure only the web app config files">
849 <!-- we want a unix path in the global.properties file -->
850 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
851 <path path="${web.home}"/>
852 </pathconvert>
853 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
854 <filter token="gsdl3version" value="${app.version}"/>
855 <filter token="tomcat.server" value="${tomcat.server}"/>
856 <filter token="tomcat.port" value="${tomcat.port}"/>
857 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
858 <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
859 <chmod file="${web.classes}/global.properties" perm="600"/>
860 <chmod file="${web.classes}/log4j.properties" perm="600"/>
861 </target>
862
863 <target name="compile-web" depends="init">
864 <javac srcdir="${web.classes}"
865 destdir="${web.classes}"
866 debug="${compile.debug}"
867 deprecation="${compile.deprecation}"
868 optimize="${compile.optimize}">
869 <classpath><path refid="compile.classpath"/></classpath>
870 </javac>
871 </target>
872
873 <target name="compile-classpath-jars" depends="init">
874 <if><bool><available file="admin/cp.mf"/></bool>
875 <jar destfile="admin/cp.jar" manifest="admin/cp.mf"/>
876 </if>
877 <if><bool><available file="${lib.java}/cp.mf"/></bool>
878 <jar destfile="${lib.java}/cp.jar" manifest="${lib.java}/cp.mf"/>
879 </if>
880 <if><bool><available file="${lib.jni}/cp.mf"/></bool>
881 <jar destfile="${lib.jni}/cp.jar" manifest="${lib.jni}/cp.mf"/>
882 </if>
883 <if><bool><available file="${web.lib}/cp.mf"/></bool>
884 <jar destfile="${web.lib}/cp.jar" manifest="${web.lib}/cp.mf"/>
885 </if>
886 <jar destfile="cp.jar">
887 <manifest>
888 <attribute name="Class-Path" value="server.jar admin/cp.jar lib/java/cp.jar lib/jni/cp.jar web/WEB-INF/lib/cp.jar"/>
889 </manifest>
890 </jar>
891 </target>
892
893 <target name="clean-classpath-jars" depends="init">
894 <delete file="admin/cp.jar"/>
895 <delete file="${lib.java}/cp.jar"/>
896 <delete file="${lib.jni}/cp.jar"/>
897 <delete file="${web.lib}/cp.jar"/>
898 <delete file="cp.jar"/>
899 </target>
900
901
902 <target name="svnupdate-web" unless="nosvn.mode">
903 <exec executable="svn">
904 <arg value="update"/>
905 <arg value="${web.home}"/>
906 <arg value="-r"/><arg value="${branch.revision}"/>
907 </exec>
908 </target>
909
910 <target name="update-web" depends="init,svnupdate-web,configure-web"
911 description="update only the web stuff (config files)"/>
912
913 <!-- ======================= Tomcat Targets ========================== -->
914
915 <!-- this target downloads and installs Tomcat -->
916 <!-- we download tomcat (version 6 for Java 1.5 and later, version 5 for Java 1.4 plus the 1.4 compatibility package). -->
917 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"
918 description="downloads the appropriate version of Tomcat (Tomcat 5 if using Java 1.4, Tomcat 6 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/6 then you need to run prepare-tomcat">
919 <if>
920 <bool>
921 <not><available file="${packages.home}/tomcat/.flagfile"/></not>
922 </bool>
923
924 <!-- check that packages dir is there -->
925 <mkdir dir="${packages.home}"/>
926 <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
927 dest="${packages.home}/${tomcat.version}.zip"
928 usetimestamp="true"/>
929 <unzip src="${packages.home}/${tomcat.version}.zip"
930 dest="${packages.home}"/>
931
932 <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
933 we would need to have the tomcat compat package to work with Java 1.4-->
934 <if>
935 <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
936 <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
937 dest="${packages.home}/${tomcat.version}-compat.zip"
938 usetimestamp="true"/>
939 <unzip src="${packages.home}/${tomcat.version}-compat.zip"
940 dest="${packages.home}"/>
941 </if>
942
943 <!-- delete any existing tomcat -->
944 <delete dir="${packages.home}/tomcat"/>
945 <move todir="${packages.home}/tomcat">
946 <fileset dir="${packages.home}/${tomcat.version}"/>
947 </move>
948 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
949 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
950 overwrite="true"/>
951 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
952 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
953 overwrite="true"/>
954 <!-- make sure we have execute permission for the .sh files -->
955 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
956 includes="*.sh"/>
957
958 <echo file="${packages.home}/tomcat/.flagfile">
959 the timestamp of this file is the time that tomcat was extracted from the zip files.
960 it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
961 </echo>
962
963 <!-- this is not strictly a prepare tomcat thing, but if one changes
964 Java, then they need to change tomcat as well, so might as well call
965 it here -->
966 <antcall target="configure-java-version"/>
967 <else>
968 <echo>Tomcat has been prepared, will not prepare</echo>
969 <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
970 </else>
971
972 </if>
973
974 </target>
975
976 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
977
978 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
979 <!-- re-setup the server.xml file -->
980 <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml"
981 tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
982 <filterset>
983 <filter token="port" value="${tomcat.port}"/>
984 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
985 </filterset>
986 </copy>
987 <!-- set up the greenstone3 context -->
988 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
989 <filterset>
990 <filter token="gsdl3webhome" value="${web.home}"/>
991 <filter token="privilegedattribute" value ="${privileged.attribute}"/>
992 </filterset>
993 </copy>
994 </target>
995
996 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
997 <!-- re-setup the server.xml file -->
998 <!-- need to edit the config file, or do we get the user to do this???-->
999 </target>
1000
1001<!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
1002 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
1003 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
1004 <property name="tomcat.path" refid="local.tomcat.path"/>
1005 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
1006 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
1007 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
1008 <env key="GSDL3HOME" value="${basedir}"/>
1009 <env key="PERLPATH" value="${perl.path}"/>
1010 <env key="PATH" path="${tomcat.path}"/>
1011 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1012 <env key="CATALINA_HOME" value="${catalina.home}"/>
1013 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1014 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
1015 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
1016 <env key="WNHOME" path="${wn.home}"/>
1017 </exec>
1018 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
1019 <env key="GSDLOS" value="windows"/>
1020 <env key="GSDL3HOME" value="${basedir}"/>
1021 <env key="PERLPATH" value="${perl.path}"/>
1022 <env key="Path" path="${tomcat.path}"/>
1023 <env key="PATH" path="${tomcat.path}"/>
1024 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1025 <env key="CATALINA_HOME" value="${catalina.home}"/>
1026 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1027 </exec>
1028 <!-- wait for the server to startup in case other targets need it running -->
1029 <waitfor maxwait="5" maxwaitunit="second">
1030 <and>
1031 <socket server="${tomcat.server}" port="${tomcat.port}"/>
1032 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
1033 </and>
1034 </waitfor>
1035 </target>
1036
1037 <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html-->
1038 <target name="reconfigure" description="Reconfigure the message router">
1039 <waitfor maxwait="5" maxwaitunit="second">
1040 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c"/>
1041 </waitfor>
1042 </target>
1043
1044 <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794-->
1045 <target name="reconfigure-collection" description="Reconfigure the collection">
1046 <waitfor maxwait="5" maxwaitunit="second">
1047 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c&amp;sc=${collection}"/>
1048 </waitfor>
1049 </target>
1050
1051 <!-- windows: do we want to launch a webrowser?? -->
1052 <!-- shouldn't this test whether anything is running first? -->
1053 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
1054 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
1055 <env key="CATALINA_HOME" value="${catalina.home}"/>
1056 </exec>
1057 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
1058 <env key="CATALINA_HOME" value="${catalina.home}"/>
1059 </exec>
1060 </target>
1061
1062 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
1063
1064 <target name="setup-catalina-ant-tasks">
1065 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
1066 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
1067 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1068 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
1069 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1070 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
1071 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1072 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
1073 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1074 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
1075 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1076 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
1077 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1078 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
1079 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1080 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
1081 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1082 </target>
1083
1084
1085 <!-- ======================= ant Targets ============================ -->
1086 <target name="prepare-ant" depends="init">
1087 <if>
1088 <bool>
1089 <not><available file="${packages.home}/ant/.flagfile"/></not>
1090 </bool>
1091
1092 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
1093 dest="${packages.home}/apache-ant-1.7.0-bin.zip"
1094 usetimestamp="true"/>
1095 <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
1096 dest="${packages.home}"/>
1097 <move todir="${packages.home}/ant">
1098 <fileset dir="${packages.home}/apache-ant-1.7.0"/>
1099 </move>
1100 <echo file="${packages.home}/ant/.flagfile">
1101 the timestamp of this file is the time that ant was extracted from the zip files.
1102 it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
1103 </echo>
1104
1105 <else>
1106 <echo>Ant has been prepared, will not prepare</echo>
1107 <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
1108 </else>
1109
1110 </if>
1111 </target>
1112
1113 <!-- ======================= Axis Targets ============================ -->
1114
1115 <target name="prepare-axis" depends="init">
1116
1117 <if>
1118 <bool>
1119 <not><available file="${packages.home}/axis/.flagfile"/></not>
1120 </bool>
1121
1122 <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
1123 dest="${packages.home}/${axis.zip.version}"
1124 usetimestamp="true"/>
1125 <unzip src="${packages.home}/${axis.zip.version}"
1126 dest="${packages.home}"/>
1127 <move todir="${packages.home}/axis">
1128 <fileset dir="${packages.home}/${axis.dir.version}"/>
1129 </move>
1130 <!-- install axis into greenstone web app -->
1131 <copy todir="${web.lib}">
1132 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
1133 <include name="*.jar"/>
1134 </fileset>
1135 </copy>
1136 <copy todir="${web.home}">
1137 <fileset dir="${packages.home}/axis/webapps/axis/">
1138 <include name="*.jsp"/>
1139 <include name="*.jws"/>
1140 </fileset>
1141 </copy>
1142 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
1143 <copy todir="${web.classes}">
1144 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
1145 <include name="*.properties"/>
1146 </fileset>
1147 </copy>
1148 <echo file="${packages.home}/axis/.flagfile">
1149 the timestamp of this file is the time that axis was extracted from the zip files.
1150 it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
1151 </echo>
1152
1153 <else>
1154 <echo>Axis has been prepared, will not prepare</echo>
1155 <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
1156 </else>
1157
1158 </if>
1159 </target>
1160
1161 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
1162 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
1163
1164 <target name="deploy-site">
1165 <java classname="org.apache.axis.client.AdminClient">
1166 <classpath refid="compile.classpath"/>
1167 <arg value="-l"/>
1168 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
1169 <arg file="${basedir}/resources/soap/deploy.wsdd"/>
1170 </java>
1171 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
1172 </target>
1173
1174 <target name="soap-undeploy-site" depends="get-undeploy-service-name"
1175 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
1176 <filter token="servicesname" value="${axis.undeploy.servicename}"/>
1177 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
1178 tofile="${basedir}/resources/soap/undeploy.wsdd"
1179 filtering="true"
1180 overwrite="true"/>
1181 <java classname="org.apache.axis.client.AdminClient">
1182 <classpath refid="compile.classpath"/>
1183 <arg value="-l"/>
1184 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
1185 <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
1186 </java>
1187 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
1188 </target>
1189
1190 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
1191 with the default servicename of localsite-->
1192 <target name="deploy-localsite" depends="init"
1193 description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
1194 <antcall target="start-tomcat"/>
1195 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
1196 <antcall target="create-deployment-files">
1197 <param name="axis.sitename" value="localsite"/>
1198 <param name="axis.servicesname" value="${base.webservice.name}"/>
1199 <param name="axis.siteuri" value="localsite"/>
1200 </antcall>
1201 <antcall target="deploy-site">
1202 <param name="axis.sitename" value="localsite"/>
1203 <param name="axis.servicesname" value="${base.webservice.name}"/>
1204 <param name="axis.siteuri" value="localsite"/>
1205 </antcall>
1206 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
1207 </target>
1208
1209 <target name="get-sitename" unless="axis.sitename">
1210 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
1211Press Enter for default:localsite</input>
1212 </target>
1213
1214 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
1215 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
1216To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
1217Or press Enter for undeploying the default:localsite /&gt;</input>
1218 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
1219 </target>
1220
1221 <target name="get-webservices" unless="axis.servicesname">
1222 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
1223Choose from: ${web.services.list}
1224Or press Enter for default:${base.webservice.name} /&gt;</input>
1225 <echo>${axis.servicesname}</echo>
1226 </target>
1227
1228 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
1229 <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>
1230 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
1231 </target>
1232
1233 <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">
1234 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
1235 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
1236 </condition>
1237
1238 <!--everything else defaults to java:RPC at present-->
1239 <condition property="soap.method" value="provider='java:RPC'">
1240 <not>
1241 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
1242 </not>
1243 </condition>
1244 </target>
1245
1246 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
1247 <filter token="sitename" value="${axis.sitename}"/>
1248 <filter token="siteuri" value="${axis.siteuri}"/>
1249 <filter token="servicesname" value="${axis.servicesname}"/>
1250 <filter token="soapmethod" value="${soap.method}"/>
1251 <copy file="${basedir}/resources/soap/site.wsdd.template"
1252 tofile="${basedir}/resources/soap/deploy.wsdd"
1253 filtering="true"
1254 overwrite="true"/>
1255 <!-- create the java files and compile them -->
1256 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
1257 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
1258 filtering="true"
1259 overwrite="true"/>
1260 <mkdir dir="${build.home}"/>
1261 <javac srcdir="${src.home}"
1262 destdir="${build.home}"
1263 debug="${compile.debug}"
1264 deprecation="${compile.deprecation}"
1265 optimize="${compile.optimize}">
1266 <classpath refid="compile.classpath"/>
1267 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
1268 </javac>
1269 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
1270 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1271 tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1272 overwrite="true" />
1273 </target>
1274
1275
1276 <!-- ====================== Core targets ============================== -->
1277 <!-- core targets refer to the core gsdl3 java src -->
1278
1279 <target name="prepare-core"/>
1280
1281 <target name="configure-core"/>
1282
1283 <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
1284 description="Update only the Greenstone core" />
1285
1286 <target name="svnupdate-core" unless="nosvn.mode">
1287 <exec executable="svn">
1288 <arg value="update"/>
1289 <arg value="${basedir}"/>
1290 <arg value="-r"/><arg value="${branch.revision}"/>
1291 </exec>
1292 </target>
1293
1294 <target name="clean-core"
1295 description="Clean only the Greenstone core">
1296 <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
1297 <delete dir="${build.home}"/>
1298 </target>
1299
1300 <target name="compile-core" depends="init"
1301 description="Compile only the Greenstone core">
1302 <mkdir dir="${build.home}"/>
1303 <if><bool><isset property="with.jni"/></bool>
1304 <javac srcdir="${src.home}"
1305 destdir="${build.home}"
1306 debug="${compile.debug}"
1307 deprecation="${compile.deprecation}"
1308 optimize="${compile.optimize}">
1309 <classpath>
1310 <path refid="compile.classpath"/>
1311 </classpath>
1312 </javac>
1313 <else>
1314 <property name="gsprefix" value=""/>
1315 <javac srcdir="${src.home}"
1316 destdir="${build.home}"
1317 debug="${compile.debug}"
1318 deprecation="${compile.deprecation}"
1319 optimize="${compile.optimize}">
1320 <classpath>
1321 <path refid="compile.classpath"/>
1322 </classpath>
1323 <exclude name="org/greenstone/gsdl3/service/GS2MGPPRetrieve.java"/>
1324 <exclude name="org/greenstone/gsdl3/service/GS2MGPPSearch.java"/>
1325 <exclude name="org/greenstone/gsdl3/service/GS2MGSearch.java"/>
1326 <exclude name="org/greenstone/gsdl3/service/GS2MGRetrieve.java"/>
1327 <exclude name="org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java"/>
1328 <exclude name="org/greenstone/gsdl3/service/PhindPhraseBrowse.java"/>
1329 <exclude name="org/greenstone/gsdl3/util/GDBMWrapper.java"/>
1330 </javac>
1331 </else>
1332 </if>
1333 <jar destfile="${build.home}/gsdl3.jar">
1334 <fileset dir="${build.home}">
1335 <include name="org/greenstone/gsdl3/**"/>
1336 <include name="org/flax/**"/>
1337 <exclude name="**/Test.class"/>
1338 </fileset>
1339 <manifest>
1340 <attribute name="Built-By" value="${user.name}" />
1341 </manifest>
1342 </jar>
1343 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1344
1345 <jar destfile="${build.home}/gutil.jar">
1346 <fileset dir="${build.home}">
1347 <include name="org/greenstone/util/**"/>
1348 </fileset>
1349 <manifest>
1350 <attribute name="Built-By" value="${user.name}" />
1351 </manifest>
1352 </jar>
1353 <copy file="${build.home}/gutil.jar" todir="${web.lib}"/>
1354
1355 <!-- copy the localsite server in case we need it -->
1356 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
1357
1358 <!-- Greenstone Administrator Interface -->
1359 <jar destfile="${build.home}/GAI.jar">
1360 <fileset dir="${build.home}">
1361 <include name="org/greenstone/admin/**"/>
1362 </fileset>
1363 <manifest>
1364 <attribute name="Built-By" value="${user.name}" />
1365 </manifest>
1366 </jar>
1367 <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
1368 <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
1369 <jar destfile="${build.home}/phind.jar">
1370 <fileset dir="${build.home}">
1371 <include name="org/greenstone/applet/phind/**"/>
1372 </fileset>
1373 <manifest>
1374 <attribute name="Built-By" value="${user.name}" />
1375 </manifest>
1376 </jar>
1377 <mkdir dir="${web.applet}"/>
1378 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1379 <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
1380 <if>
1381 <bool><istrue value="${tomcat.islocal}"/></bool>
1382 <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
1383 <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
1384 </if>
1385
1386
1387 <!-- skip anttasks for now
1388 <jar destfile="${build.home}/anttasks.jar">
1389 <fileset dir="${build.home}">
1390 <include name="org/greenstone/anttasks/**"/>
1391 </fileset>
1392 <manifest>
1393 <attribute name="Built-By" value="${user.name}" />
1394 </manifest>
1395 </jar>
1396 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
1397 <jar destfile="${build.home}/gsdl3test.jar">
1398 <fileset dir="${build.home}">
1399 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1400 <include name="org/greenstone/testing/**"/>
1401 </fileset>
1402 <manifest>
1403 <attribute name="Built-By" value="${user.name}" />
1404 </manifest>
1405 </jar>
1406 <jar destfile="${build.home}/server.jar">
1407 <fileset dir="${build.home}">
1408 <include name="org/greenstone/server/**"/>
1409 <include name="org/greenstone/util/**"/>
1410 </fileset>
1411 <fileset file="${basedir}/resources/java/server.properties"/>
1412 <manifest>
1413 <attribute name="Built-By" value="${user.name}"/>
1414 </manifest>
1415 </jar>
1416 <copy file="${build.home}/server.jar" todir="${basedir}"/>
1417 </target>
1418
1419 <!-- ================== Packages targets ================================ -->
1420 <!-- these targets refer to the greenstone source packages - these need
1421 updating less often, so are in separate targets to the core -->
1422 <target name="prepare-packages" depends="init"/>
1423
1424 <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
1425 description="Update only the source packages"/>
1426
1427 <target name="svnupdate-packages" unless="nosvn.mode">
1428 <exec executable="svn">
1429 <arg value="update"/>
1430 <arg value="${src.packages.home}"/>
1431 <arg value="-r"/><arg value="${branch.revision}"/>
1432 </exec>
1433 </target>
1434
1435
1436 <target name="configure-packages" depends="init,configure-javagdbm"
1437 description="Configure only the packages."/>
1438
1439 <target name="configure-javagdbm" if="with.jni">
1440 <echo>
1441 Configuring JavaGDBM
1442 </echo>
1443
1444 <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1445 <arg value="--prefix=${basedir}"/>
1446 <arg value="--libdir=${lib.jni}"/>
1447 <arg value="--with-gdbm=${gdbm.home}"/>
1448 </exec>
1449 </target>
1450
1451 <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
1452
1453 <target name="clean-javagdbm" depends="init">
1454 <exec executable="make" os="${os.unix}"
1455 dir="${javagdbm.home}" failonerror="true">
1456 <arg value="clean"/>
1457 </exec>
1458 </target>
1459
1460 <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
1461
1462 <target name="distclean-javagdbm" depends="init">
1463 <exec executable="make" os="${os.unix}"
1464 dir="${javagdbm.home}" failonerror="true">
1465 <arg value="distclean"/>
1466 </exec>
1467 </target>
1468
1469 <target name="compile-packages" description="Compile only the source packages">
1470 <!-- javagdbm -->
1471 <antcall target="compile-javagdbm"/>
1472 <!-- Search4j -->
1473 <antcall target="compile-search4j"/>
1474 </target>
1475
1476 <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni">
1477
1478 <!-- unix: -->
1479 <echo>compile javagdbm</echo>
1480 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
1481 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1482 <arg value="install"/>
1483 </exec>
1484
1485 <!-- windows: Calling without the "compile" argument first will run winMake.bat with
1486 "all" which will then perform both the compile AND link targets in jni/win32.mak
1487 (thereby also generating gdbmjava.dll). Then we run the same command with
1488 the "install" argument to copy the gdbmjava.dll into the correct location. -->
1489 <echo>Windows: compile javagdbm</echo>
1490 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
1491 <env key="GSDLHOME" path="${gs2build.home}"/>
1492 </exec>
1493 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
1494 <env key="GSDLHOME" path="${gs2build.home}"/>
1495 <arg value="install"/>
1496 </exec>
1497
1498 <!-- install the jar file -->
1499 <echo>Install the javagdbm jar file ${javagdbm.home}/javagdbm.jar ${lib.jni}</echo>
1500 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1501 </target>
1502
1503 <target name="compile-search4j">
1504
1505 <!-- windows -->
1506 <if><bool><istrue value="${current.os.iswindows}"/></bool>
1507 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1508 <arg value="/f"/>
1509 <arg value="win32.mak"/>
1510 <arg value='BINDIR="${basedir}\bin"'/>
1511 </exec>
1512 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1513 <arg value="/f"/>
1514 <arg value="win32.mak"/>
1515 <arg value="install"/>
1516 <arg value='BINDIR="${basedir}\bin"'/>
1517 </exec>
1518
1519 <!-- unix -->
1520 <else><if><bool><istrue value="${current.os.isunix}"/></bool>
1521 <exec executable="${src.packages.home}/search4j/configure" dir="${src.packages.home}/search4j" failonerror="true">
1522 <arg value="--bindir=${basedir}/bin"/>
1523 <arg value="${static.arg}"/>
1524 </exec>
1525 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
1526 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true">
1527 <arg value="install"/>
1528 </exec>
1529
1530 <!-- else warn -->
1531 <else>
1532 <fail>this target does not support the current os</fail>
1533
1534 </else></if></else></if>
1535
1536 </target>
1537
1538 <target name="install-auxiliary-jar-files" depends="init">
1539
1540 <if>
1541 <bool><available file="${mg.home}/mg.jar"/></bool>
1542 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1543 </if>
1544
1545 <if>
1546 <bool><available file="${mgpp.home}/mgpp.jar"/></bool>
1547 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1548 </if>
1549
1550 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
1551 </target>
1552
1553 <target name="install-jni-files" depends="init" if="with.jni">
1554 <antcall target="install-jni-files-linux"/>
1555 <antcall target="install-jni-files-windows"/>
1556 <antcall target="install-jni-files-macos"/>
1557 </target>
1558
1559 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
1560 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1561 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
1562 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
1563 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1564 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
1565 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1566 </target>
1567 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
1568 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1569 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
1570 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
1571 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1572 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
1573 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1574 </target>
1575 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
1576 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1577 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
1578 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
1579 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1580 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
1581 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1582 </target>
1583
1584 <!-- ========common-src targets =================================-->
1585 <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
1586 collection building is not enabled -->
1587
1588 <target name="update-common-src" depends="init" if="collection.building.disabled">
1589 </target>
1590
1591 <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1592 <exec executable="svn">
1593 <arg value="update"/>
1594 <arg value="${common.src.home}"/>
1595 <arg value="-r"/><arg value="${branch.revision}"/>
1596 </exec>
1597 </target>
1598
1599 <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
1600 <antcall target="checkout-common-src"/>
1601 <antcall target="unzip-windows-packages"/>
1602 </target>
1603
1604 <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1605 <echo>checking out common-src</echo>
1606 <exec executable="svn">
1607 <arg value="checkout"/>
1608 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src"/>
1609 <arg value="common-src"/>
1610 <arg value="-r"/><arg value="${branch.revision}"/>
1611 </exec>
1612 </target>
1613
1614 <target name="configure-common-src" depends="init">
1615 <exec executable="${common.src.home}/configure" os="${os.unix}"
1616 dir="${common.src.home}" failonerror="true">
1617 <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
1618 <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
1619 <arg line="${gs2.opt.args}"/>
1620 <arg line="${static.arg}"/>
1621 <arg line="${allargs}"/>
1622 </exec>
1623 </target>
1624
1625 <target name="clean-common-src" depends="init">
1626 <!-- unix: -->
1627 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1628 <arg value="clean"/>
1629 </exec>
1630 <!-- windows: -->
1631 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1632 <arg value="/f"/>
1633 <arg value="win32.mak"/>
1634 <arg value="clean"/>
1635 <arg value="GSDLHOME=${gs2build.home}"/>
1636 </exec>
1637 </target>
1638 <target name="distclean-common-src" depends="init">
1639 <!-- unix: -->
1640 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1641 <arg value="distclean"/>
1642 </exec>
1643 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1644 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1645 <arg value="/f"/>
1646 <arg value="win32.mak"/>
1647 <arg value="clean"/>
1648 <arg value="GSDLHOME=${gs2build.home}"/>
1649 </exec>
1650 </target>
1651 <target name="compile-common-src" depends="init">
1652 <!-- unix: -->
1653 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1654 <arg value="${gs2.compile.target}"/>
1655 </exec>
1656 <!-- windows: -->
1657 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1658 <arg value="/f"/>
1659 <arg value="win32.mak"/>
1660 <arg value="GSDLHOME=${gs2build.home}"/>
1661 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1662 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
1663 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
1664 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
1665 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
1666 </exec>
1667 </target>
1668
1669 <!-- ======= collection-building targets ===========================-->
1670
1671 <target name="update-collection-building" if="collection.building.enabled"
1672 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"
1673 description="Update (SVN update, configure, compile etc) only the collection building components"/>
1674
1675 <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
1676 description="SVN update the collection building components">
1677 </target>
1678
1679 <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
1680 </target>
1681
1682 <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
1683 description="Configure the collection building components">
1684 </target>
1685
1686 <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
1687 description="Clean only the collection building components"
1688 if="collection.building.enabled"/>
1689
1690 <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
1691 description="Distclean only the collection building components"
1692 if="collection.building.enabled"/>
1693
1694 <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
1695 description="Compile only the collection building components">
1696 <!-- make install for common-src -->
1697 <!-- unix: -->
1698 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1699 <arg value="${gs2.install.target}"/>
1700 </exec>
1701
1702 <!-- windows: -->
1703 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1704 <arg value="/f"/>
1705 <arg value="win32.mak"/>
1706 <arg value="install"/>
1707 <arg value="GSDLHOME=${gs2build.home}"/>
1708 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1709 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
1710 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
1711 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
1712 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
1713 <!--
1714 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1715 <arg value="USE_SQLITE=0"/>--> <!-- why is this not on by default? -->
1716 </exec>
1717
1718 <!-- install gs2build indexers for windows -->
1719 <if>
1720 <bool><istrue value="${current.os.iswindows}"/></bool>
1721 <copy todir="${gs2build.home}/bin/windows">
1722 <fileset dir="${gs2build.home}/common-src/indexers/bin">
1723 <include name="*.*"/>
1724 </fileset>
1725 </copy>
1726 </if>
1727
1728 <!-- LuceneWrapper jar file not installed by default -->
1729 <mkdir dir="${gs2build.home}/bin/java"/>
1730 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
1731
1732 </target>
1733
1734 <!-- ============== gli targets ================================= -->
1735 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1736
1737 <exec executable="svn">
1738 <arg value="update"/>
1739 <arg value="${gli.home}"/>
1740 <arg value="-r"/><arg value="${branch.revision}"/>
1741 </exec>
1742
1743 <exec executable="svn" dir="web/WEB-INF/cgi">
1744 <arg value="export"/>
1745 <arg value="-r"/><arg value="${branch.revision}"/>
1746 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gliserver.pl"/>
1747 </exec>
1748 <exec executable="svn" dir="web/WEB-INF/cgi">
1749 <arg value="export"/>
1750 <arg value="-r"/><arg value="${branch.revision}"/>
1751 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gsdlCGI.pm"/>
1752 </exec>
1753
1754 </target>
1755
1756 <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
1757 <!-- checkout -->
1758 <if><bool><and><not><istrue value="${nosvn.mode}"/></not><isset property="with.gli.and.gems"/></and></bool>
1759
1760 <exec executable="svn">
1761 <arg value="checkout"/>
1762 <arg value="${svn.root}/main/${branch.path}/gli"/>
1763 <arg value="-r"/><arg value="${branch.revision}"/>
1764 </exec>
1765
1766 <exec executable="svn" dir="web/WEB-INF/cgi">
1767 <arg value="export"/>
1768 <arg value="-r"/><arg value="${branch.revision}"/>
1769 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gliserver.pl"/>
1770 </exec>
1771 <exec executable="svn" dir="web/WEB-INF/cgi">
1772 <arg value="export"/>
1773 <arg value="-r"/><arg value="${branch.revision}"/>
1774 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gsdlCGI.pm"/>
1775 </exec>
1776
1777 </if>
1778 </target>
1779
1780 <target name="clean-gli" depends="init" if="collection.building.enabled">
1781 <!-- gli -->
1782 <property name="gli.home" value="${basedir}/gli"/>
1783 <!-- linux -->
1784 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1785 resolveExecutable="true" failonerror="true"/>
1786 <!-- windows -->
1787 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1788 resolveExecutable="true" failonerror="true"/>
1789 </target>
1790
1791 <target name="compile-gli" depends="init" if="collection.building.enabled">
1792 <if><bool><isset property="with.gli.and.gems"/></bool>
1793 <!-- gli -->
1794 <property name="gli.home" value="${basedir}/gli"/>
1795
1796 <!-- linux -->
1797 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
1798 <!--remote gli-->
1799 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
1800 resolveExecutable="true" failonerror="true"/>
1801 <!-- windows -->
1802 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
1803 <!--remote gli-->
1804 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
1805 resolveExecutable="true" failonerror="true"/>
1806 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
1807 </if>
1808 </target>
1809
1810 <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
1811 <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1812 <env key="gsdl3path" path="${basedir}"/>
1813 <env key="gsdlpath" path="${gs2build.home}"/>
1814 </exec>
1815 <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1816 <env key="gsdl3path" path="${basedir}"/>
1817 <env key="gsdlpath" path="${gs2build.home}"/>
1818 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
1819 </exec>
1820 <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1821 <env key="GSDL3PATH" path="${basedir}"/>
1822 <env key="GSDLPATH" path="${gs2build.home}"/>
1823 </exec>
1824 <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.
1825 </echo>
1826 </target>
1827
1828 <!-- ================ gs2build targets =========================== -->
1829
1830 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1831 <echo>svn updating gs2build</echo>
1832 <exec executable="svn">
1833 <arg value="update"/>
1834 <arg value="${gs2build.home}"/>
1835 <arg value="-r"/><arg value="${branch.revision}"/>
1836 </exec>
1837 </target>
1838
1839 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
1840 <antcall target="checkout-gs2build"/>
1841 <antcall target="unzip-windows-packages"/>
1842 <antcall target="checkout-winbin"/>
1843 <antcall target="get-windows-binaries"/>
1844 <antcall target="delete-winbin"/>
1845 </target>
1846
1847 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
1848 <echo>checking out gs2build</echo>
1849 <exec executable="svn">
1850 <arg value="checkout"/>
1851 <arg value="${svn.root}/main/${branch.path}/gs2build"/>
1852 <arg value="-r"/><arg value="${branch.revision}"/>
1853 </exec>
1854
1855
1856 </target>
1857
1858 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1859 unless="nosvn.mode">
1860
1861 <exec executable="svn">
1862 <arg value="checkout"/>
1863 <arg value="${svn.root}/main/${branch.path}/binaries/windows"/>
1864 <arg value="-r"/><arg value="${branch.revision}"/>
1865 <arg value="winbin"/>
1866 </exec>
1867
1868 </target>
1869
1870 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
1871 <exec executable="svn">
1872 <arg value="update"/>
1873 <arg value="winbin"/>
1874 <arg value="-r"/><arg value="${branch.revision}"/>
1875 </exec>
1876
1877 </target>
1878
1879 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
1880 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1881 <fileset dir="${basedir}/winbin/bin"/>
1882 </move>
1883 </target>
1884
1885 <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
1886 <delete dir="${basedir}/winbin"/>
1887 </target>
1888
1889 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1890 <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
1891 dest="${common.src.home}/packages/windows/crypt"/>
1892 <untar compression="gzip"
1893 src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
1894 dest="${common.src.home}/packages/sqlite"/>
1895 <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
1896 dest="${common.src.home}/indexers/packages/windows/iconv"/>
1897 </target>
1898
1899 <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
1900 <!-- we want a windows path in the setup.bat file -->
1901 <pathconvert targetos="windows" property="gs2build.home.windows">
1902 <path path="${gs2build.home}"/>
1903 </pathconvert>
1904 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
1905 <filterset>
1906 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1907 </filterset>
1908 </move>
1909 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
1910 </target>
1911
1912
1913 <target name="clean-build-src" depends="init" if="collection.building.enabled">
1914 <!-- unix: -->
1915 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
1916 <arg value="clean"/>
1917 </exec>
1918 <!-- windows: -->
1919 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1920 <arg value="/f"/>
1921 <arg value="win32.mak"/>
1922 <arg value="clean"/>
1923 <arg value="GSDLHOME=${gs2build.home}"/>
1924 </exec>
1925 </target>
1926
1927
1928 <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
1929 <!-- unix: -->
1930 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
1931 <arg value="distclean"/>
1932 </exec>
1933 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1934 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1935 <arg value="/f"/>
1936 <arg value="win32.mak"/>
1937 <arg value="clean"/>
1938 <arg value="GSDLHOME=${gs2build.home}"/>
1939 </exec>
1940 </target>
1941
1942 <target name="configure-build-src" depends="init" if="collection.building.enabled"
1943 description="Configure the build-src component">
1944 <exec executable="${build.src.home}/configure" os="${os.unix}"
1945 dir="${build.src.home}" failonerror="true">
1946 <arg value="--prefix=${gs2build.home}"/>
1947 <arg line="${gs2.opt.args} ${static.arg} ${allargs}"/>
1948 </exec>
1949 </target>
1950
1951 <!-- common-src is done separately and needs to be compiled first -->
1952 <target name="compile-build-src" depends="init" if="collection.building.enabled">
1953
1954 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
1955 <arg line="${ldlpath.arg}"/>
1956 </exec>
1957
1958 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
1959 <arg value="install"/>
1960 </exec>
1961
1962 <!-- run the setup script -->
1963 <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}" failonerror="true"/>-->
1964 <!--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-->
1965 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1966 <arg value="/f"/>
1967 <arg value="win32.mak"/>
1968 <arg value="GSDLHOME=${gs2build.home}"/>
1969 </exec>
1970 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1971 <arg value="/f"/>
1972 <arg value="win32.mak"/>
1973 <arg value="install"/>
1974 <arg value="GSDLHOME=${gs2build.home}"/>
1975 </exec>
1976 </target>
1977
1978
1979 <!-- ======================== TESTING Targets ========================= -->
1980
1981 <target name="test" description="Run the (incomplete) JUnit test suite "
1982 depends="init">
1983 <mkdir dir="${basedir}/test"/>
1984 <junit printsummary="withOutAndErr"
1985 errorproperty="test.failed"
1986 failureproperty="test.failed"
1987 fork="${junit.fork}">
1988 <formatter type="plain"/>
1989 <classpath>
1990 <pathelement location="${build.home}/gsdl3test.jar"/>
1991 <path refid="compile.classpath"/>
1992 </classpath>
1993 <test name="${testcase}" if="testcase"/>
1994 <batchtest todir="${basedir}/test" unless="testcase">
1995 <fileset dir="${build.home}" includes="**/*Test.class" />
1996 </batchtest>
1997 </junit>
1998 <echo>
1999 *********************************************
2000 Test output can be found in directory 'test'
2001 *********************************************
2002 </echo>
2003 </target>
2004
2005 <!-- ======================== FLAX Targets ========================= -->
2006 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
2007 <echo>checking out flax ...</echo>
2008 <mkdir dir="${basedir}/src/java/org/flax"/>
2009 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
2010 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/action/flax"/>
2011 <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
2012 <mkdir dir="${web.home}/interfaces/flax"/>
2013 <mkdir dir="${web.home}/sites/flax"/>
2014 <mkdir dir="${basedir}/flax-resources"/>
2015 <mkdir dir="${basedir}/flax-lib"/>
2016 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
2017 <arg value="src/java/org/flax"/></exec>
2018 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
2019 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
2020 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/action/flax"/>
2021 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
2022 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
2023 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
2024 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
2025 <arg value="${web.home}/interfaces/flax"/></exec>
2026 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
2027 <arg value="${web.home}/sites/flax"/></exec>
2028 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
2029 <arg value="flax-resources"/></exec>
2030 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
2031 <arg value="flax-lib"/></exec>
2032 <antcall target="flax-copy-files" />
2033 </target>
2034
2035 <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
2036 <echo>copying flax files ...</echo>
2037 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
2038 <!-- A configuration file containing web service binding information for the axis engine -->
2039 <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
2040 <!-- A static web service wsdl file which is queried by soap client. The reason this file is used (instead of the dynamically generated version) is in case any redirects are used in the Apache configuration (e.g., flax.nzdl.org:80 redirects to harakeke:8080) -->
2041 <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" overwrite="true"/>
2042 <copy todir="${web.home}/WEB-INF/lib">
2043 <fileset dir="${basedir}/flax-lib">
2044 <include name="*.jar"/>
2045 </fileset>
2046 </copy>
2047 </target>
2048 <target name="configure-flax-wsdl" description="Configure flax webservice with tomcat server/port">
2049 <rsr file="${web.home}/FlaxWebService.wsdl" pattern="@flaxpublicserver@:@flaxpublicport@" replacement="${tomcat.server}:${tomcat.port}"/>
2050 </target>
2051
2052 <target name="update-flax" description="update flax from repository">
2053 <echo>updating flax ...</echo>
2054 <exec executable="svn"><arg value="update"/>
2055 <arg value="src/java/org/flax"/></exec>
2056 <exec executable="svn"><arg value="update"/>
2057 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
2058 <exec executable="svn"><arg value="update"/>
2059 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
2060 <exec executable="svn"><arg value="update"/>
2061 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
2062 <exec executable="svn"><arg value="update"/>
2063 <arg value="${web.home}/interfaces/flax"/></exec>
2064 <exec executable="svn"><arg value="update"/>
2065 <arg value="flax-resources"/></exec>
2066 <exec executable="svn"><arg value="update"/>
2067 <arg value="flax-lib"/></exec>
2068 <antcall target="flax-copy-files" />
2069 </target>
2070
2071
2072 <target name="compile-javadocs">
2073 <javadoc packagenames="org.greenstone.*"
2074 sourcepath="src/java"
2075 defaultexcludes="yes"
2076 destdir="docs/javadoc"
2077 author="true"
2078 version="true"
2079 use="true"
2080 windowtitle="Greenstone3 API">
2081 <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
2082 </javadoc>
2083 </target>
2084
2085<!-- ========== Some distribution targets ======================== -->
2086 <target name="remove-source">
2087 <if><bool><isset property="with.gli.and.gems"/></bool>
2088 <delete includeEmptyDirs="true">
2089 <fileset dir="." defaultexcludes="false">
2090 <patternset refid="greenstone3.source.component"/>
2091 </fileset>
2092 </delete>
2093
2094 <else>
2095 <delete includeEmptyDirs="true">
2096 <fileset dir="." defaultexcludes="false">
2097 <patternset refid="greenstone3.source.no.gli.component"/>
2098 </fileset>
2099 </delete>
2100 </else>
2101 </if>
2102 </target>
2103
2104 <target name="dist-tidy"
2105 description="'tidies-up' a greenstone3 installation for distribution.">
2106
2107 <!-- delete unneeded things -->
2108 <delete dir="${packages.home}/axis"/>
2109 <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
2110 <delete file="README-SVN.txt"/>
2111 <delete file="build.properties.in"/>
2112
2113 <!-- delete source files -->
2114 <antcall target="remove-source"/>
2115
2116 <!-- create empty directories -->
2117 <mkdir dir="${web.home}/applet"/>
2118 <mkdir dir="${web.home}/logs"/>
2119
2120 <!-- os specific tidy-ups -->
2121 <!-- linux, mac -->
2122 <if><bool><istrue value="${current.os.isunix}"/></bool>
2123 <delete><fileset dir="." includes="*.bat"/></delete>
2124 <if><bool><isset property="with.gli.and.gems"/></bool>
2125 <delete><fileset dir="gli" includes="*.bat"/></delete>
2126 </if>
2127 <delete><fileset dir="gs2build" includes="*.bat"/></delete>
2128 <delete><fileset dir="bin/script" includes="*.bat"/></delete>
2129 <delete file="${basedir}/gs2build/win32cfg.h"/>
2130 <delete file="${basedir}/gs2build/win32.mak"/>
2131 <delete dir="${basedir}/winutil"/>
2132 <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
2133
2134 <!-- windows -->
2135 <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
2136 <delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>
2137 <if><bool><isset property="with.gli.and.gems"/></bool>
2138 <delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
2139 </if>
2140 <delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>
2141 <delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>
2142 </if></else></if>
2143
2144 </target>
2145
2146 <!-- fix up executable permissions for binary release -->
2147 <target name="fix-execute-permissions">
2148 <echo>Setting binaries to executable</echo>
2149 <chmod perm="775">
2150 <fileset dir="."><patternset refid="greenstone3.executables"/></fileset>
2151 </chmod>
2152 </target>
2153
2154 <!-- fix up executable permissions for source code release -->
2155 <target name="fix-execute-permissions-source">
2156 <chmod perm="775">
2157 <fileset dir="."><patternset refid="greenstone3.source.executables"/></fileset>
2158 </chmod>
2159 </target>
2160
2161
2162 <!-- ============= tweaks for making compilation static ========== -->
2163 <target name="tweak-makefiles" depends="init" if="compile.static">
2164 <antcall target="rtftohtml-add-static" />
2165 </target>
2166
2167 <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
2168 <rsr file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
2169 </target>
2170
2171</project>
2172
Note: See TracBrowser for help on using the repository browser.