source: greenstone3/trunk/build.xml@ 19911

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

minor simplification

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