source: main/branches/stable_trunk/greenstone3/build.xml@ 21986

Last change on this file since 21986 was 21986, checked in by xiao, 14 years ago

changed branch.path to branches/stable_trunk

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