source: greenstone3/trunk/build.xml@ 19975

Last change on this file since 19975 was 19975, checked in by oranfry, 15 years ago

changed the source-fileset file to a file for all components, and made some updates to reflect this

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