source: greenstone3/trunk/build.xml@ 20215

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

delete build.properties.in from binary release

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