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

Last change on this file since 23442 was 23442, checked in by xiao, 13 years ago

modified target flax-copy-files

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