source: trunk/gsdl3/build.xml@ 10770

Last change on this file since 10770 was 10770, checked in by kjdon, 18 years ago

changed the get-mysql-xxx-password targets - there is now one for each password, and has 'unless=mysql.xxx.password' - so you can't have an empty password property and still get the prompt. the java getuserandpassword property doesn't work if no windows (eg ssh login) and it craps out even if you don't need to run it, so you need to test for the existence of the password before running it

  • Property svn:keywords set to Author Date Id Revision
File size: 64.2 KB
Line 
1<?xml version="1.0"?>
2
3<!-- ======================================================================
4 March 2005
5
6 GSDL3 build and install script
7
8 kjdon
9 ====================================================================== -->
10<project name="greenstone3" default="usage" basedir=".">
11
12 <!-- ============ self defined tasks =================== -->
13
14 <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/>
15 <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/>
16
17
18
19<!-- ===================== Property Definitions =========================== -->
20
21<!--
22
23 Each of the following properties are used in the build script.
24 Values for these properties are set by the first place they are
25 defined, from the following list:
26
27 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
28
29 * Definitions from a "build.properties" file in the top level
30 source directory of this application.
31
32 * Definitions from a "build.properties" file in the user's
33 home directory.
34
35 * Default definitions in this build.xml file.
36
37 You will note below that property values can be composed based on the
38 contents of previously defined properties. This is a powerful technique
39 that helps you minimize the number of changes required when your development
40 environment is modified. Note that property composition is allowed within
41 "build.properties" files as well as in the "build.xml" script.
42
43-->
44
45 <property file="build.properties"/>
46 <property file="${user.home}/build.properties"/>
47
48 <!-- get properties from the environment -->
49 <property environment="env"/>
50 <property name="src.home" value="${basedir}/src/java"/>
51 <property name="build.home" value="${basedir}/build"/>
52 <property name="packages.home" value="${basedir}/packages"/>
53 <!-- this may be set in build.properties, eg if you move the web dir to
54 tomcats webapps directory -->
55 <property name="web.home" value="${basedir}/web"/>
56 <!-- jar files needed by applets go here -->
57 <property name="web.applet" value="${web.home}/applet"/>
58 <!-- jar files needed by the servlet (and extra ones) go here -->
59 <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
60 <!-- other files needed by the servlet go here -->
61 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
62 <!-- jni libraries and java wrappers go here -->
63 <property name="lib.jni" value="${basedir}/lib/jni"/>
64
65 <property name="javadocs" value="${basedir}/docs/javadoc"/>
66
67 <property name="app.name" value="greenstone3"/>
68 <property name="app.path" value="/${app.name}"/>
69 <property name="app.version" value="3.00alpha"/>
70
71 <!-- catalina home is set to tomcat basedir is already installed, otherwise
72 use greenstone's tomcat -->
73 <condition property="catalina.home" value="${tomcat.installed.path}">
74 <and>
75 <isset property="tomcat.installed.path"/>
76 <not>
77 <equals arg1="" arg2="${tomcat.installed.path}"/>
78 </not>
79 </and>
80 </condition>
81 <property name="catalina.home" value="${basedir}/comms/jakarta/tomcat"/>
82
83 <property name="os.linux" value="Linux"/>
84 <property name="os.mac" value="Mac OS X"/>
85 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows XP,Windows NT,Windows ME"/> <!-- check this!!!-->
86
87 <!-- this is true for linux and macs -->
88 <condition property="current.os.isunix">
89 <os family="unix"/>
90 </condition>
91
92 <condition property="current.os.isunixnotmac">
93 <and>
94 <os family="unix"/>
95 <not>
96 <os family="mac"/>
97 </not>
98 </and>
99 </condition>
100 <condition property="current.os.ismac">
101 <os family="mac"/>
102 </condition>
103
104 <condition property="current.os.iswindows">
105 <os family="windows"/>
106 </condition>
107
108 <!-- ============= Base dirs for each package and component ============ -->
109 <property name="applet.home" value="${src.home}/org/greenstone/applet"/>
110 <property name="gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
111 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
112 <property name="gs2build.home" value="${basedir}/gs2build"/>
113 <property name="gli.home" value="${basedir}/gli"/>
114 <property name="vishnu.home" value="${packages.home}/vishnu"/>
115 <property name="mg.home" value="${packages.home}/mg"/>
116 <property name="mgpp.home" value="${packages.home}/mgpp"/>
117 <property name="javagdbm.home" value="${packages.home}/javagdbm"/>
118 <property name="mysql.home" value="${packages.home}/mysql"/>
119 <property name="gsdl-as.home" value="${packages.home}/gsdl-as"/>
120
121<!-- ==================== Compilation Control Options ==================== -->
122
123<!--
124
125 These properties control option settings on the Javac compiler when it
126 is invoked using the <javac> task.
127
128 compile.debug Should compilation include the debug option?
129
130 compile.deprecation Should compilation include the deprecation option?
131
132 compile.optimize Should compilation include the optimize option?
133
134-->
135
136 <property name="compile.debug" value="true"/>
137 <property name="compile.deprecation" value="true"/>
138 <property name="compile.optimize" value="true"/>
139
140<!--
141
142 Rather than relying on the CLASSPATH environment variable, Ant includes
143 features that makes it easy to dynamically construct the classpath you
144 need for each compilation. The example below constructs the compile
145 classpath to include the servlet.jar file, as well as the other components
146 that Tomcat makes available to web applications automatically, plus anything
147 that you explicitly added.
148
149-->
150
151 <path id="compile.classpath">
152 <!-- Include all jar files and libraries in our jni lib directory -->
153 <pathelement location="${lib.jni}"/>
154 <fileset dir="${lib.jni}">
155 <include name="*.jar"/>
156 </fileset>
157 <!-- Include all jar files in our web lib directory -->
158 <pathelement location="${web.lib}"/>
159 <fileset dir="${web.lib}">
160 <include name="*.jar"/>
161 </fileset>
162
163 <!-- Include the axis jar files -->
164 <!--<fileset dir="${basedir}/comms/soap/axis/lib">
165 <include name="*.jar"/>
166 </fileset>-->
167
168 <!-- include the jar files from the packages -->
169 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
170 so we add them in by name -->
171 <pathelement location="${lib.jni}/mg.jar"/>
172 <pathelement location="${lib.jni}/mgpp.jar"/>
173 <pathelement location="${vishnu.home}/build/vishnu.jar"/>
174
175 <!-- Include all elements that Tomcat exposes to applications -->
176 <pathelement location="${catalina.home}/common/classes"/>
177 <fileset dir="${catalina.home}/common/endorsed">
178 <include name="*.jar"/>
179 </fileset>
180 <fileset dir="${catalina.home}/common/lib">
181 <include name="*.jar"/>
182 </fileset>
183 <pathelement location="${catalina.home}/shared/classes"/>
184 <fileset dir="${catalina.home}/shared/lib">
185 <include name="*.jar"/>
186 </fileset>
187 </path>
188
189 <path id="local.tomcat.classpath">
190 <!-- explicitly include the jni java wrappers in the classpath -->
191 <pathelement location="${lib.jni}"/>
192 <fileset dir="${lib.jni}">
193 <include name="*.jar"/>
194 </fileset>
195 </path>
196
197 <path id="local.tomcat.path">
198 <pathelement location="${mysql.home}/bin"/>
199 <pathelement location="${basedir}/bin/script"/>
200 <pathelement location="${basedir}/bin"/>
201 <pathelement location="${lib.jni}"/>
202 <pathelement path="${env.PATH}"/>
203 <pathelement path="${env.Path}"/>
204 </path>
205
206 <target name="test-setup">
207 <echo>ant java version=${ant.java.version}</echo>
208 <echo>is linux : ${current.os.isunix}</echo>
209 <echo>is mac : ${current.os.ismac}</echo>
210 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
211 <echo>is windows : ${current.os.iswindows}</echo>
212 </target>
213<!-- ==================== Primary and Global Targets ============================= -->
214
215 <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
216
217 <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-web"
218 description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this."/>
219
220 <target name="install" depends="init,configure-mysql,configure,configure-c++,compile,deploy-localsite"
221 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/>
222
223 <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web"
224 description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>
225
226 <target name="configure-c++" depends="init,configure-packages,configure-core,configure-gs2building"
227 description="Configure any C/C++ package code and gs2building code if necessary"/>
228
229 <target name="configure" depends="init,configure-tomcat,configure-web"
230 description="Configure the installation. Includes setting up config files. Should be re-run if you change the build.properties file."/>
231
232 <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building"
233 description="Remove all old compiled code. Includes core, packages and gs2building if necessary"/>
234 <target name="clean-windows-c++" depends="init,clean-windows-c++-gs2building,clean-windows-c++-packages"
235 description="Remove C++ compiled code for Windows. Requires Microsoft Visual Studio"/>
236
237 <target name="compile" depends="init,compile-web,compile-packages,compile-core,compile-gs2building"
238 description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/>
239
240 <target name="compile-windows-c++" depends="init,compile-windows-c++-gs2building,compile-windows-c++-packages"
241 description="Compile the C/C++ code for Windows. Requires Microsoft Visual Studio"/>
242
243 <target name="update" depends="init,cvsupdate,clean,configure,configure-c++,compile"
244 description="Update (thru CVS) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
245
246 <target name="start" depends="init,start-mysql,start-tomcat"
247 description="Startup the (local) Greenstone servers (tomcat,mysql...)" />
248
249 <target name="stop" depends="init,stop-tomcat,stop-mysql"
250 description="Shutdown the (local) Greenstone servers."/>
251
252 <target name="restart" description="Shutdown and restart the (local) Greenstone servers" depends="init,stop,start"/>
253
254
255<!-- =========== Help targets =================================== -->
256
257 <property name="install-command" value="ant [options] prepare install"/>
258
259 <target name="usage" description="Print a help message">
260 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
261 <echo message=" Execute 'ant -help' for Ant help."/>
262 <echo>To install Greenstone3, run '${install-command}'.
263There 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.
264To log the output, use the '-logfile build.log' option.
265The README.txt file has more information about the ant targets and install process.
266 </echo>
267 </target>
268
269 <target name="help" depends="usage" description="Print a help message"/>
270
271 <target name="debug" depends="init" description="Display all the currently used properties">
272 <echoproperties/>
273 </target>
274
275<!-- ====== initialization and setup targets ================== -->
276
277 <target name="accept-properties" unless="properties.accepted">
278 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
279tomcat.server=${tomcat.server}
280tomcat.port=${tomcat.port}
281tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
282gsdl2.installed.path=${gsdl2.installed.path} (this is the location of Greenstone 2 if you have it)
283proxy.host=${proxy.host}
284proxy.port=${proxy.port}
285mysql.installed.path=${mysql.installed.path} (this is the location of mysql if it is already installed)
286mysql.port=${mysql.port}
287If these are not acceptable, please change them and rerun this target. Continue [y/n]? />
288 </input>
289 <condition property="do.abort">
290 <equals arg1="n" arg2="${properties.ok}"/>
291 </condition>
292 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
293 </target>
294
295 <target name="check-cvsroot">
296 <condition property="cvsroot.notset">
297 <or>
298 <not>
299 <isset property="env.CVSROOT"/>
300 </not>
301 <equals arg1="" arg2="${env.CVSROOT}"/>
302 </or>
303 </condition>
304 <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/>
305 </target>
306
307 <!-- this sets up some initial properties -->
308 <target name="init">
309
310 <condition property="java.too.old">
311 <or>
312 <equals arg1="1.1" arg2="${ant.java.version}"/>
313 <equals arg1="1.2" arg2="${ant.java.version}"/>
314 <equals arg1="1.3" arg2="${ant.java.version}"/>
315 </or>
316 </condition>
317 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
318
319 <available file="${basedir}/packages/mgpp/text" property="mgpp.present"/>
320 <available file="${basedir}/packages/mysql/bin" property="mysql.present"/>
321 <available file="${basedir}/gli" property="gli.present"/>
322 <available file="${basedir}/gs2build" property="gs2build.present"/>
323 <available file="${basedir}/comms/soap/axis" property="axis.present"/>
324 <condition property="gsdl2.islocal">
325 <or>
326 <not>
327 <isset property="gsdl2.installed.path"/>
328 </not>
329 <equals arg1="" arg2="${gsdl2.installed.path}"/>
330 </or>
331 </condition>
332 <condition property="mysql.islocal">
333 <or>
334 <not>
335 <isset property="mysql.installed.path"/>
336 </not>
337 <equals arg1="" arg2="${mysql.installed.path}"/>
338 </or>
339 </condition>
340 <condition property="tomcat.islocal">
341 <or>
342 <not>
343 <isset property="tomcat.installed.path"/>
344 </not>
345 <equals arg1="" arg2="${tomcat.installed.path}"/>
346 </or>
347 </condition>
348
349 <echo>tomcat.port:${tomcat.port}, gli.present:${gli.present} gsdlislocal=${gsdl2.islocal} gs2build.present=${gs2build.present} gsdl2.installed.path = ${gsdl2.installed.path}</echo>
350 <condition property="proxy.present">
351 <and>
352 <isset property="proxy.host"/>
353 <not>
354 <equals arg1="" arg2="${proxy.host}"/>
355 </not>
356 </and>
357 </condition>
358 </target>
359
360 <target name="setup-proxy" depends="init" if="proxy.present">
361 <condition property="ask.user">
362 <or>
363 <equals arg1="" arg2="${proxy.user}"/>
364 <equals arg1="" arg2="${proxy.password}"/>
365 </or>
366 </condition>
367 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
368 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
369 </target>
370
371 <!-- ========== Web app Targets ================================ -->
372
373 <target name="prepare-web">
374 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
375 <!-- gs3mgdemo -->
376 <unzip src="${collect.dir}/gs3mgdemo/import.zip"
377 dest="${collect.dir}/gs3mgdemo"/>
378 <unzip src="${collect.dir}/gs3mgdemo/archives.zip"
379 dest="${collect.dir}/gs3mgdemo"/>
380 <unzip src="${collect.dir}/gs3mgdemo/index/index.zip"
381 dest="${collect.dir}/gs3mgdemo/index"/>
382 <delete file="${collect.dir}/gs3mgdemo/import.zip"/>
383 <delete file="${collect.dir}/gs3mgdemo/archives.zip"/>
384 <delete file="${collect.dir}/gs3mgdemo/index/index.zip"/>
385 <!-- gs2mgdemo -->
386 <unzip src="${collect.dir}/gs2mgdemo/import.zip"
387 dest="${collect.dir}/gs2mgdemo"/>
388 <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
389 dest="${collect.dir}/gs2mgdemo"/>
390 <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
391 dest="${collect.dir}/gs2mgdemo/index"/>
392 <delete file="${collect.dir}/gs2mgdemo/import.zip"/>
393 <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/>
394 <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/>
395 <!-- gs2mgppdemo -->
396 <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
397 dest="${collect.dir}/gs2mgppdemo"/>
398 <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
399 dest="${collect.dir}/gs2mgppdemo"/>
400 <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
401 dest="${collect.dir}/gs2mgppdemo/index"/>
402 <delete file="${collect.dir}/gs2mgppdemo/import.zip"/>
403 <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/>
404 <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/>
405 <!-- gberg -->
406 <unzip src="${collect.dir}/gberg/index/index.zip"
407 dest="${collect.dir}/gberg/index"/>
408 <delete file="${collect.dir}/gberg/index/index.zip"/>
409 <mkdir dir="${web.home}/applet"/>
410
411 <condition property="need.xml.jars">
412 <equals arg1="1.5" arg2="${ant.java.version}"/>
413 </condition>
414 <antcall target="rename-xml-jars"/>
415 </target>
416
417 <target name="rename-xml-jars" if="need.xml.jars">
418 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
419 <copy file="${web.lib}/xercesImpl.jar.tmp" tofile="${web.lib}/xercesImpl.jar"/>
420 </target>
421
422 <target name="configure-web" depends="init,get-mysql-reader-password,get-mysql-admin-password"
423 description="Configure only the web app config files">
424 <!-- we want a unix path in the global.properties file -->
425 <pathconvert targetos="unix" property="gsdl3.home.unix">
426 <path path="${web.home}"/>
427 </pathconvert>
428 <!-- just in case these haven't been defined, we need something to write to
429 the file -->
430 <property name="mysql.admin.password" value=" "/>
431 <property name="mysql.reader.password" value=" "/>
432 <filter token="gsdl3home" value="${gsdl3.home.unix}"/>
433 <filter token="mysql.port" value="${mysql.port}"/>
434 <filter token="mysql.server" value="${mysql.server}"/>
435 <filter token="mysql.admin.pword" value="${mysql.admin.password}"/>
436 <filter token="mysql.reader.pword" value="${mysql.reader.password}"/>
437 <filter token="tomcat.server" value="${tomcat.server}"/>
438 <filter token="tomcat.port" value="${tomcat.port}"/>
439 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
440 <chmod file="${web.classes}/global.properties" perm="600"/>
441 </target>
442
443 <target name="compile-web" depends="init">
444 <javac srcdir="${web.classes}"
445 destdir="${web.classes}"
446 debug="${compile.debug}"
447 deprecation="${compile.deprecation}"
448 optimize="${compile.optimize}">
449 <classpath>
450 <path refid="compile.classpath"/>
451 </classpath>
452 </javac>
453 </target>
454
455 <target name="cvsupdate-web" unless="nocvs.mode">
456 <cvs command="update -dP" dest="${web.home}"/>
457 </target>
458
459 <target name="update-web" depends="init,cvsupdate-web,configure-web"
460 description="update only the web stuff (config files)"/>
461
462
463<!-- ======================= Tomcat Targets ========================== -->
464
465 <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
466 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
467 <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7.zip"
468 dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
469 usetimestamp="true"/>
470 <delete dir="${basedir}/comms/jakarta/tomcat.bak"/>
471 <move todir="${basedir}/comms/jakarta/tomcat.bak" failonerror="false">
472 <fileset dir="${basedir}/comms/jakarta/tomcat"/>
473 </move>
474 <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
475 dest="${basedir}/comms/jakarta"/>
476 <condition property="need.tomcat.compat">
477 <equals arg1="1.4" arg2="${ant.java.version}"/>
478 </condition>
479 <antcall target="prepare-tomcat-compat"/>
480 <move todir="${basedir}/comms/jakarta/tomcat">
481 <fileset dir="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7"/>
482 </move>
483 <copy file="${basedir}/comms/jakarta/setclasspath.bat"
484 tofile="${basedir}/comms/jakarta/tomcat/bin/setclasspath.bat"
485 overwrite="true"/>
486 <copy file="${basedir}/comms/jakarta/setclasspath.sh"
487 tofile="${basedir}/comms/jakarta/tomcat/bin/setclasspath.sh"
488 overwrite="true"/>
489 <!-- make sure we have execute permission for the .sh files -->
490 <chmod dir="${basedir}/comms/jakarta/tomcat/bin" perm="ugo+rx"
491 includes="*.sh"/>
492 </target>
493
494
495 <target name="prepare-tomcat-compat" if="need.tomcat.compat">
496 <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7-compat.zip"
497 dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
498 usetimestamp="true"/>
499 <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
500 dest="${basedir}/comms/jakarta"/>
501 <copy file="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7/common/endorsed/xml-apis.jar"
502 tofile="${web.applet}/xml-apis.jar"/>
503 <copy file="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7/common/endorsed/xercesImpl.jar"
504 tofile="${web.applet}/xercesImpl.jar"/>
505 </target>
506
507 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
508
509 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
510 <!-- re-setup the server.xml file -->
511 <copy file="${basedir}/comms/jakarta/server.xml.in" tofile="${basedir}/comms/jakarta/tomcat/conf/server.xml" overwrite="true">
512 <filterset>
513 <filter token="port" value="${tomcat.port}"/>
514 <filter token="gsdl3home" value="${basedir}"/>
515 </filterset>
516 </copy>
517 </target>
518
519 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
520 <!-- re-setup the server.xml file -->
521 <!-- need to edit the config file, or do we get the user to do this???-->
522 </target>
523
524 <target name="reload" description="Reload web application"
525 depends="init,setup-catalina-ant-tasks">
526 <reload url="http://kanuka:7070/manager" username="admin" password="admin"
527 path="${app.path}"/>
528 </target>
529
530 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
531 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
532 <property name="tomcat.path" refid="local.tomcat.path"/>
533 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
534 <exec executable="${catalina.home}/bin/startup.sh" os="${os.linux},${os.mac}" dir="${catalina.home}/bin" spawn="false">
535 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
536 <env key="GSDL3HOME" value="${basedir}"/>
537 <env key="PATH" path="${tomcat.path}"/>
538 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
539 <env key="CATALINA_HOME" value="${catalina.home}"/>
540 <env key="CLASSPATH" path="${tomcat.classpath}"/>
541 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
542 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}"/>
543<!-- <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}:${mysql.home}/lib/mysql"/>
544
545 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${mysql.home}/lib/mysql"/>--> <!-- for mac-->
546 </exec>
547 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
548 <env key="GSDLOS" value="windows"/>
549 <env key="GSDL3HOME" value="${basedir}"/>
550 <env key="Path" path="${tomcat.path}"/>
551 <env key="PATH" path="${tomcat.path}"/>
552 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
553 <env key="CLASSPATH" path="${tomcat.classpath}"/>
554 </exec>
555 <!-- wait for the server to startup in case other targets need it running -->
556 <waitfor maxwait="5" maxwaitunit="second">
557 <and>
558 <socket server="${tomcat.server}" port="${tomcat.port}"/>
559 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
560 </and>
561 </waitfor>
562 </target>
563 <!-- windows: do we want to launch a webrowser?? -->
564 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
565 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.linux},${os.mac}" dir="${catalina.home}/bin" spawn="false">
566 <env key="CATALINA_HOME" value="${catalina.home}"/>
567 </exec>
568 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false"/>
569 </target>
570
571 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
572
573 <target name="setup-catalina-ant-tasks">
574 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
575 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
576 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
577 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
578 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
579 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
580 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
581 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
582 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
583 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
584 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
585 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
586 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
587 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
588 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
589 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
590 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
591 </target>
592
593
594<!-- ======================= Mysql Targets =========================== -->
595
596 <!-- this is one target that we only want to run once. -->
597 <target name="prepare-mysql" depends="init,init-mysql-vars,install-mysql,start-mysql,setup-mysql,stop-mysql-no-password-force"/>
598
599 <target name="init-mysql-vars">
600 <condition property="mysql.islocal.linux">
601 <and>
602 <isset property="mysql.islocal"/>
603 <isset property="current.os.isunixnotmac"/>
604 </and>
605 </condition>
606 <condition property="mysql.islocal.mac">
607 <and>
608 <isset property="mysql.islocal"/>
609 <isset property="current.os.ismac"/>
610 </and>
611 </condition>
612 <condition property="mysql.islocal.windows">
613 <and>
614 <isset property="mysql.islocal"/>
615 <isset property="current.os.iswindows"/>
616 </and>
617 </condition>
618 <condition property="mysql.islocal.usepassword">
619 <and>
620 <isset property="mysql.islocal"/>
621 <isset property="mysql.use.passwords"/>
622 <equals arg1="yes" arg2="${mysql.use.passwords}"/>
623 </and>
624 </condition>
625 <condition property="mysql.islocal.usepassword.windows">
626 <and>
627 <isset property="mysql.islocal.usepassword"/>
628 <isset property="current.os.iswindows"/>
629 </and>
630 </condition>
631 <condition property="mysql.islocal.usepassword.unix">
632 <and>
633 <isset property="mysql.islocal.usepassword"/>
634 <isset property="current.os.isunix"/>
635 </and>
636 </condition>
637 <condition property="mysql.islocal.nopassword">
638 <and>
639 <isset property="mysql.islocal"/>
640 <or>
641 <not>
642 <isset property="mysql.use.passwords"/>
643 </not>
644 <equals arg1="no" arg2="${mysql.use.passwords}"/>
645 </or>
646 </and>
647 </condition>
648 </target>
649
650 <target name="configure-mysql" depends="init,init-mysql-vars,start-mysql,set-mysql-account-passwords,stop-mysql" description="sets up the mysql account passwords"/>
651
652 <target name="get-mysql-root-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.root.password">
653 <getuserandpassword message="Please specify a password for the root mysql user: this is to secure your database." username="root" pwordproperty="mysql.root.password"/>
654 </target>
655
656 <target name="get-mysql-reader-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.reader.password" >
657 <getuserandpassword message="Please specify the password for the gsdl3reader mysql user: this is used by greenstone" username="gsdl3reader" pwordproperty="mysql.reader.password"/>
658 </target>
659
660 <target name="get-mysql-admin-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.admin.password" >
661 <getuserandpassword message="Please specify the password for the gsdl3admin mysql user: this is used by greenstone" username="gsdl3admin" pwordproperty="mysql.admin.password"/>
662 </target>
663
664 <target name="install-mysql" depends="init,init-mysql-vars,install-mysql-linux,install-mysql-windows,install-mysql-mac"/>
665
666 <!-- install the database : linux-->
667 <target name="install-mysql-linux" depends="init,init-mysql-vars" if="mysql.islocal.linux" unless="mysql.present">
668 <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
669 dest="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
670 usetimestamp="true"/>
671 <untar src="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
672 dest="${packages.home}"
673 compression="gzip"/>
674 <move todir="${packages.home}/mysql">
675 <fileset dir="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686"/>
676 </move>
677 <!-- file permissions are screwed up, so make executables executable -->
678 <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
679 <chmod perm="a+x">
680 <fileset dir="${mysql.home}/bin" />
681 </chmod>
682 <mkdir dir="${mysql.home}/var/"/>
683 <mkdir dir="${mysql.home}/var/log/"/>
684 <chmod file="${mysql.home}/var/" perm="777"/>
685 <chmod file="${mysql.home}/var/log/" perm="777"/>
686
687 <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
688 <arg value="--datadir=./data"/>
689 <arg value="--basedir=."/>
690 <arg value="--user=root"/>
691 <arg value="--force"/>
692 </exec>
693 </target>
694
695
696 <!-- install the database : mac-->
697 <target name="install-mysql-mac" depends="init,init-mysql-vars" if="mysql.islocal.mac" unless="mysql.present">
698 <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.12-apple-darwin7.9.0-powerpc.tar.gz"
699 dest="${packages.home}/mysql-standard-4.1.12-apple-darwin7.9.0-powerpc.tar.gz"
700 usetimestamp="true"/>
701 <untar src="${packages.home}/mysql-standard-4.1.12-apple-darwin7.9.0-powerpc.tar.gz"
702 dest="${packages.home}"
703 compression="gzip"/>
704 <move todir="${packages.home}/mysql">
705 <fileset dir="${packages.home}/mysql-standard-4.1.12-apple-darwin7.9.0-powerpc"/>
706 </move>
707 <!-- file permissions are screwed up, so make executables executable -->
708 <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
709 <chmod perm="a+x">
710 <fileset dir="${mysql.home}/bin" />
711 </chmod>
712 <mkdir dir="${mysql.home}/var/"/>
713 <mkdir dir="${mysql.home}/var/log/"/>
714 <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
715 <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
716 <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
717 <arg value="--datadir=./data"/>
718 <arg value="--basedir=."/>
719 <!--<arg value="- -user=root"/>
720 <arg value="- -force"/>-->
721 </exec>
722 </target>
723
724 <!-- install the database : windows -->
725 <target name="install-mysql-windows" depends="init,init-mysql-vars" if="mysql.islocal.windows" unless="mysql.present">
726 <get src="http://www.greenstone.org/gs3files/mysql-noinstall-4.1.11-win32.zip"
727 dest="${packages.home}/mysql-noinstall-4.1.11-win32.zip"
728 usetimestamp="true"/>
729 <!-- can we run the installer?? -->
730 <unzip src="${packages.home}/mysql-noinstall-4.1.11-win32.zip"
731 dest="${packages.home}"/>
732 <move todir="${packages.home}/mysql">
733 <fileset dir="${packages.home}/mysql-4.1.11-win32"/>
734 </move>
735 </target>
736
737 <target name="setup-mysql" depends="init" if="mysql.islocal">
738 <!-- setup the gsdl3 accounts -->
739 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
740 <arg value="--user=root"/>
741 <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost"/>
742 </exec>
743 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
744 <arg value="--user=root"/>
745 <arg value="--execute=GRANT SELECT ON *.* TO gsdl3reader@localhost"/>
746 </exec>
747 <!--<exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
748 <arg value="- -user=root"/>
749 <arg value="- -execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@'%';"/>
750 </exec>-->
751
752 <!-- remove the anonymous user -->
753 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
754 <arg value="--user=root"/>
755 <arg value="--execute=delete from mysql.user where Host='localhost' and User='';"/>
756 </exec>
757 <!-- load in the demo collection database -->
758 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
759 <arg value="--user=root"/>
760 <arg value="--execute=create database localsite_gs3mgdemo;"/>
761 </exec>
762 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
763 input="${web.home}/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
764 <arg value="--user=root"/>
765 <arg value="localsite_gs3mgdemo"/>
766 </exec>
767 </target>
768
769 <target name="set-mysql-account-passwords" depends="init,init-mysql-vars,get-mysql-root-password,get-mysql-reader-password,get-mysql-admin-password" if="mysql.islocal.usepassword">
770 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
771 <arg value="--user=root"/>
772 <arg value="--execute=set password for 'root'@'localhost' = PASSWORD('${mysql.root.password}'); set password for 'gsdl3reader'@'localhost' = PASSWORD('${mysql.reader.password}'); set password for 'gsdl3admin'@'localhost' = PASSWORD('${mysql.admin.password}'); flush privileges;"/>
773 </exec>
774 </target>
775
776 <target name="start-mysql" depends="init,init-mysql-vars" if="mysql.islocal"
777 description="Startup only mysql">
778 <echo>Starting up the mysql server</echo>
779 <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
780 spawn="true" os="${os.linux},${os.mac}">
781 <arg value="--datadir=./data"/>
782 <arg value="--basedir=."/>
783 <arg value="--pid_file=gsdl3.pid"/>
784 <arg value="--socket=/tmp/mysql.sock"/>
785 <arg value="--port=${mysql.port}"/>
786 <arg value="--err-log=./var/log/mysql.log"/>
787 </exec>
788 <exec executable="${mysql.home}/bin/mysqld" dir="${mysql.home}" spawn="true" os="${os.windows}">
789 <arg value="--port=${mysql.port}"/>
790 </exec>
791 <sleep seconds="2"/>
792 </target>
793
794 <target name="stop-mysql" depends="init,init-mysql-vars,stop-mysql-use-password-unix,stop-mysql-use-password-windows,stop-mysql-no-password" if="mysql.islocal"
795 description="Shutdown only mysql">
796 <echo>MYSQL database server shutdown successfully</echo>
797 </target>
798
799 <target name="stop-mysql-no-password" depends="init" if="mysql.islocal.nopassword">
800 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
801 failonerror="true" os="${os.linux},${os.mac}">
802 <arg value="--user=root"/>
803 <arg value="--socket=/tmp/mysql.sock"/>
804 <arg value="shutdown"/>
805 </exec>
806 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
807 failonerror="true" os="${os.windows}">
808 <arg value="--user=root"/>
809 <arg value="shutdown"/>
810 </exec>
811 </target>
812
813 <target name="stop-mysql-no-password-force" depends="init">
814 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
815 failonerror="true" os="${os.linux},${os.mac}">
816 <arg value="--user=root"/>
817 <arg value="--socket=/tmp/mysql.sock"/>
818 <arg value="shutdown"/>
819 </exec>
820 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
821 failonerror="true" os="${os.windows}">
822 <arg value="--user=root"/>
823 <arg value="shutdown"/>
824 </exec>
825 </target>
826
827 <target name="stop-mysql-use-password-unix" depends="init" if="mysql.islocal.usepassword.unix">
828 <echo>At the password prompt, enter the mysql root password.</echo>
829 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
830 failonerror="true" os="${os.linux},${os.mac}">
831 <arg value="--user=root"/>
832 <arg value="-p"/>
833 <arg value="--socket=/tmp/mysql.sock"/>
834 <arg value="shutdown"/>
835 </exec>
836 </target>
837
838 <target name="stop-mysql-use-password-windows" depends="init" if="mysql.islocal.usepassword.windows">
839 <!--<antcall target="get-mysql-root-password"/>
840 antcall doesn't set the property in teh callign project. if put this in the depends list, it will always be called, even if not windows. so copy it in here.-->
841 <condition property="ask.root.password">
842 <or>
843 <not>
844 <isset property="mysql.root.password"/>
845 </not>
846 <equals arg1="" arg2="${mysql.root.password}"/>
847 </or>
848 </condition>
849 <getuserandpassword message="Please enter the mysql root password:" if="ask.root.password" username="root" pwordproperty="mysql.root.password"/>
850 <!-- on windows it doesn't work unless the password is specified here -->
851 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
852 failonerror="true" os="${os.windows}">
853 <arg value="--user=root"/>
854 <arg value="-p${mysql.root.password}"/>
855 <arg value="shutdown"/>
856 </exec>
857 </target>
858
859 <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,stop-mysql,start-mysql"/>
860
861
862<!-- ======================= Axis Targets ============================ -->
863
864 <target name="prepare-axis" depends="init">
865 <mkdir dir="${basedir}/comms/soap"/>
866 <get src="http://www.greenstone.org/gs3files/axis-bin-1_2_1.zip"
867 dest="${basedir}/comms/soap/axis-bin-1_2_1.zip"
868 usetimestamp="true"/>
869 <delete dir="${basedir}/comms/soap/axis.bak"/>
870 <move todir="${basedir}/comms/soap/axis.bak" failonerror="false">
871 <fileset dir="${basedir}/comms/soap/axis"/>
872 </move>
873 <unzip src="${basedir}/comms/soap/axis-bin-1_2_1.zip"
874 dest="${basedir}/comms/soap/"/>
875 <move todir="${basedir}/comms/soap/axis">
876 <fileset dir="${basedir}/comms/soap/axis-1_2_1"/>
877 </move>
878 <!-- install axis into greenstone web app -->
879 <copy todir="${web.lib}">
880 <fileset dir="${basedir}/comms/soap/axis/webapps/axis/WEB-INF/lib">
881 <include name="*.jar"/>
882 </fileset>
883 </copy>
884 <copy todir="${web.home}">
885 <fileset dir="${basedir}/comms/soap/axis/webapps/axis/">
886 <include name="*.jsp"/>
887 <include name="*.jws"/>
888 </fileset>
889 </copy>
890 <copy tofile="${web.home}/axis.html" file="${basedir}/comms/soap/axis/webapps/axis/index.html"/>
891 <copy todir="${web.classes}">
892 <fileset dir="${basedir}/comms/soap/axis/webapps/axis/WEB-INF/classes">
893 <include name="*.properties"/>
894 </fileset>
895 </copy>
896 </target>
897
898 <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files"
899 description="Deploy a SOAP web service for a local Greenstone site">
900 <java classname="org.apache.axis.client.AdminClient">
901 <classpath refid="compile.classpath"/>
902 <arg value="-l"/>
903 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
904 <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
905 </java>
906 </target>
907
908 <target name="soap-undeploy-site" depends="get-sitename"
909 description="Undeploy a SOAP web service for a local Greenstone site">
910 <java classname="org.apache.axis.client.AdminClient">
911 <classpath refid="compile.classpath"/>
912 <arg value="-l"/>
913 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
914 <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
915 </java>
916 </target>
917
918 <!-- this target used to deploy the localsite server for the default installation -->
919 <target name="deploy-localsite" depends="init">
920 <antcall target="start-tomcat"/>
921 <antcall target="soap-deploy-site">
922 <param name="axis.sitename" value="localsite"/>
923 <param name="axis.siteuri" value="localsite"/>
924 </antcall>
925 <antcall target="stop-tomcat"/>
926 </target>
927
928 <target name="get-sitename" unless="axis.sitename">
929 <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
930 </target>
931
932 <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri">
933 <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
934 <echo>${axis.sitename}, ${axis.siteuri}</echo>
935 </target>
936 <target name="check-deployment-files" depends="get-sitename">
937 <condition property="deploy.exists">
938 <and>
939 <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
940 <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
941 <available file="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class"/>
942 </and>
943 </condition>
944 </target>
945
946 <target name="create-deployment-files" depends="get-sitename,get-siteuri,check-deployment-files"
947 if="axis.sitename" unless="deploy.exists">
948 <filter token="sitename" value="${axis.sitename}"/>
949 <filter token="siteuri" value="${axis.siteuri}"/>
950 <copy file="${basedir}/resources/soap/site.wsdd.template"
951 tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
952 filtering="true"/>
953 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
954 tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
955 filtering="true"/>
956 <!-- create the java files and compile them -->
957 <copy file="${gsdl3.home}/SOAPServer.java.in"
958 tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
959 filtering="true"/>
960 <javac srcdir="${src.home}"
961 destdir="${build.home}"
962 debug="${compile.debug}"
963 deprecation="${compile.deprecation}"
964 optimize="${compile.optimize}">
965 <classpath refid="compile.classpath"/>
966 <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
967 </javac>
968 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
969 <copy file="${build.home}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" />
970 </target>
971
972
973<!-- ====================== Core targets ============================== -->
974<!-- core targets refer to the core gsdl3 java src -->
975
976 <target name="prepare-core" unless="nocvs.mode">
977 <!-- just get rid of empty directories-->
978 <cvs command="update -P"/>
979 </target>
980
981 <target name="configure-core"/>
982
983 <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
984 description="Update only the Greenstone core" />
985
986 <target name="cvsupdate-core" unless="nocvs.mode">
987 <cvs command="update -l"/>
988 <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/>
989 </target>
990
991 <target name="clean-core"
992 description="Clean only the Greenstone core">
993 <delete dir="${build.home}"/>
994 </target>
995
996 <target name="compile-core"
997 description="Compile only the Greenstone core">
998 <mkdir dir="${build.home}"/>
999 <javac srcdir="${src.home}"
1000 destdir="${build.home}"
1001 debug="${compile.debug}"
1002 deprecation="${compile.deprecation}"
1003 optimize="${compile.optimize}">
1004 <classpath>
1005 <path refid="compile.classpath"/>
1006 </classpath>
1007 </javac>
1008 <jar destfile="${build.home}/gsdl3.jar">
1009 <fileset dir="${build.home}">
1010 <include name="org/greenstone/gsdl3/**"/>
1011 <exclude name="**/Test.class"/>
1012 </fileset>
1013 <manifest>
1014 <attribute name="Built-By" value="${user.name}" />
1015 </manifest>
1016 </jar>
1017 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1018 <jar destfile="${build.home}/phind.jar">
1019 <fileset dir="${build.home}">
1020 <include name="org/greenstone/applet/phind/**"/>
1021 </fileset>
1022 <manifest>
1023 <attribute name="Built-By" value="${user.name}" />
1024 </manifest>
1025 </jar>
1026 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1027 <jar destfile="${build.home}/anttasks.jar">
1028 <fileset dir="${build.home}">
1029 <include name="org/greenstone/anttasks/**"/>
1030 </fileset>
1031 <manifest>
1032 <attribute name="Built-By" value="${user.name}" />
1033 </manifest>
1034 </jar>
1035 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
1036 <jar destfile="${build.home}/gsdl3test.jar">
1037 <fileset dir="${build.home}">
1038 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1039 <include name="org/greenstone/testing/**"/>
1040 </fileset>
1041 <manifest>
1042 <attribute name="Built-By" value="${user.name}" />
1043 </manifest>
1044 </jar>
1045 </target>
1046
1047<!-- ================== Packages targets ================================ -->
1048 <!-- these targets refer to the greenstone packages - these need updating
1049 less often, so are in separate targets to the core -->
1050 <target name="prepare-packages" depends="init,prepare-mgpp,prepare-windows"/>
1051
1052 <target name="prepare-windows" depends="init" if="current.os.iswindows">
1053 <!-- need to download precompiled binaries for mg and mgpp -->
1054 </target>
1055
1056 <target name="checkout-mgpp" depends="check-cvsroot,init" unless="nocvs.mode">
1057 <cvs command="checkout -P" package="mgpp" dest="${basedir}/packages/"/>
1058 </target>
1059
1060 <target name="prepare-mgpp" depends="init" unless="mgpp.present">
1061 <antcall target="checkout-mgpp"/>
1062 </target>
1063
1064 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
1065 description="Update only the packages"/>
1066
1067 <target name="cvsupdate-packages" unless="nocvs.mode">
1068 <cvs command="update -dP" dest="${packages.home}"/>
1069 </target>
1070
1071 <target name="configure-packages" description="Configure only the packages.">
1072 <echo>
1073 Configuring MG
1074 </echo>
1075 <exec executable="${mg.home}/configure" os="${os.linux},${os.mac}"
1076 dir="${mg.home}">
1077 <arg value="--prefix=${basedir}"/>
1078 <arg value="--libdir=${lib.jni}"/>
1079 </exec>
1080 <echo>
1081 Configuring MGPP
1082 </echo>
1083 <exec executable="${mgpp.home}/configure" os="${os.linux},${os.mac}"
1084 dir="${mgpp.home}">
1085 <arg value="--prefix=${basedir}"/>
1086 <arg value="--libdir=${lib.jni}"/>
1087 </exec>
1088 <echo>
1089 Configuring JavaGDBM
1090 </echo>
1091 <exec executable="${javagdbm.home}/configure" os="${os.linux},${os.mac}"
1092 dir="${javagdbm.home}">
1093 <arg value="--prefix=${basedir}"/>
1094 <arg value="--libdir=${lib.jni}"/>
1095 </exec>
1096 </target>
1097
1098 <target name="clean-packages" depends="init,clean-packages-c++,clean-packages-java" description="Clean only the packages"/>
1099
1100 <target name="clean-packages-c++" depends="init">
1101 <!-- mg : just call the make target -->
1102 <exec executable="make" os="${os.linux},${os.mac}"
1103 dir="${mg.home}">
1104 <arg value="clean"/>
1105 </exec>
1106 <!-- mgpp -->
1107 <exec executable="make" os="${os.linux},${os.mac}"
1108 dir="${mgpp.home}">
1109 <arg value="clean"/>
1110 </exec>
1111 <!-- javagdbm -->
1112 <exec executable="make" os="${os.linux},${os.mac}"
1113 dir="${javagdbm.home}">
1114 <arg value="clean"/>
1115 </exec>
1116 </target>
1117
1118 <target name="clean-packages-java" depends="init">
1119 <!-- vishnu : just call the ant target -->
1120 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1121 inheritall="false" target="clean">
1122 <property name="catalina.home" value="${catalina.home}"/>
1123 </ant>
1124 <!-- gsdl-as : just call the ant target-->
1125 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1126 inheritall="false" target="clean">
1127 <property name="catalina.home" value="${catalina.home}"/>
1128 </ant>
1129 </target>
1130
1131 <target name="clean-windows-c++-packages" depends="init" if="current.os.iswindows"
1132 description="Clean only the C/C++ packages">
1133 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1134 <arg value="clean"/>
1135 </exec>
1136 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1137 <arg value="clean"/>
1138 </exec>
1139 </target>
1140
1141 <target name="compile-packages"
1142 description="Compile only the packages">
1143 <echo>Compiling MG</echo>
1144 <exec executable="make" os="${os.linux},${os.mac}"
1145 dir="${mg.home}">
1146 </exec>
1147 <exec executable="make" os="${os.linux},${os.mac}"
1148 dir="${mg.home}">
1149 <arg value="install"/>
1150 </exec>
1151 <!-- windows: just the java stuff. -->
1152 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
1153 dir="${mg.home}">
1154 <arg value="compile"/>
1155 <arg value="javaonly"/>
1156 </exec>
1157 <!-- install the jar file -->
1158 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1159
1160 <!-- mgpp -->
1161 <echo>Compiling MGPP</echo>
1162 <exec executable="make" os="${os.linux},${os.mac}"
1163 dir="${mgpp.home}">
1164 </exec>
1165 <exec executable="make" os="${os.linux},${os.mac}"
1166 dir="${mgpp.home}">
1167 <arg value="install"/>
1168 </exec>
1169 <!-- windows: just the java stuff. -->
1170 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
1171 dir="${mgpp.home}">
1172 <arg value="compile"/>
1173 <arg value="javaonly"/>
1174 </exec>
1175 <!-- install the jar file -->
1176 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1177
1178 <!-- javagdbm -->
1179 <exec executable="make" os="${os.linux},${os.mac}"
1180 dir="${javagdbm.home}">
1181 </exec>
1182 <exec executable="make" os="${os.linux},${os.mac}"
1183 dir="${javagdbm.home}">
1184 <arg value="install"/>
1185 </exec>
1186 <!-- windows: just the java stuff. -->
1187 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}"
1188 dir="${javagdbm.home}">
1189 <arg value="compile"/>
1190 <arg value="javaonly"/>
1191 </exec>
1192 <!-- install the jar file -->
1193 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1194
1195 <!-- vishnu -->
1196 <echo>Compiling Vishnu</echo>
1197 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1198 inheritall="false" target="compile">
1199 <property name="catalina.home" value="${catalina.home}"/>
1200 </ant>
1201
1202 <!-- gsdl-as -->
1203 <echo>Compiling GSDL-AS</echo>
1204 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1205 inheritall="false" target="compile">
1206 <property name="catalina.home" value="${catalina.home}"/>
1207 </ant>
1208 </target>
1209
1210 <target name="compile-windows-c++-packages" depends="init" if="current.os.iswindows"
1211 description="Compile only the C/C++ packages">
1212 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}"/>
1213 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1214 <arg value="install"/>
1215 <env key="GSDL3HOME" value="${basedir}"/>
1216 </exec>
1217 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}"/>
1218 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1219 <arg value="install"/>
1220 <env key="GSDL3HOME" value="${basedir}"/>
1221 </exec>
1222 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}"/>
1223 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
1224 <arg value="install"/>
1225 <env key="GSDL3HOME" value="${basedir}"/>
1226 </exec>
1227 </target>
1228
1229 <!-- ================== gs2building targets ===============-->
1230
1231
1232 <target name="update-gs2building" if="gsdl2.islocal"
1233 depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
1234 description="Update only the Greenstone 2 building components"/>
1235
1236 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init" unless="nocvs.mode">
1237 <cvs command="update -dP" dest="${gli.home}"/>
1238 <!-- Note: can't do a -d update here cos it will get all of gsdl
1239 also, an update doesn't get new files, so we do a checkout instead. -->
1240 <cvs command="co gs2build" dest="${basedir}"/>
1241 </target>
1242
1243 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
1244 </target>
1245
1246 <target name="checkout-gs2build" depends="check-cvsroot,init" unless="nocvs.mode">
1247 <echo>checking out gs2build</echo>
1248 <cvs command="checkout -P" package="gs2build"/>
1249 </target>
1250
1251 <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
1252 <antcall target="checkout-gs2build"/>
1253 <!-- rename the .gs2build files -->
1254 <antcall target="rename-gs2build-files"/>
1255 <antcall target="unzip-windows-packages"/>
1256 <antcall target="get-windows-binaries"/>
1257 <antcall target="get-macos-extra"/>
1258 </target>
1259
1260 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1261 unless="nocvs.mode">
1262 <cvs command="checkout -P" package="winbin"/>
1263 </target>
1264
1265 <target name="get-windows-binaries" depends="init,checkout-winbin" if="current.os.iswindows">
1266 <copy todir="${basedir}/bin">
1267 <fileset dir="${basedir}/winbin/bin" includes="mg*.exe"/>
1268 </copy>
1269 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1270 <fileset dir="${basedir}/winbin/bin"/>
1271 </move>
1272 <delete dir="${basedir}/winbin"/>
1273 </target>
1274
1275 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1276 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
1277 dest="${gs2build.home}/packages/windows/gdbm"/>
1278 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
1279 dest="${gs2build.home}/packages/windows/crypt"/>
1280 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
1281 dest="${gs2build.home}/packages/windows/expat"/>
1282 </target>
1283 <target name="get-macos-extra" depends="init" if="current.os.ismac">
1284 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1285 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1286 usetimestamp="true"/>
1287 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1288 dest="${gs2build.home}/perllib/cpan/"
1289 compression="gzip"/>
1290 </target>
1291 <target name="rename-gs2build-files" depends="rename-gs2build-files-unix,rename-gs2build-files-windows"/>
1292
1293 <target name="rename-gs2build-files-windows" if="current.os.iswindows">
1294 <!-- we want a windows path in the setup.bat file -->
1295 <pathconvert targetos="windows" property="gs2build.home.windows">
1296 <path path="${gs2build.home}"/>
1297 </pathconvert>
1298
1299 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1300 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
1301 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
1302 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat">
1303 <filterset>
1304 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1305 </filterset>
1306 </copy>
1307 </target>
1308 <target name="rename-gs2build-files-unix" if="current.os.isunix">
1309 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1310 <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>
1311 <chmod file="${gs2build.home}/configure" perm="a+x"/>
1312 <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1313 <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/>
1314 <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1315 <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1316 <copy file="${gs2build-extra.home}/packages.Makefile" tofile="${gs2build.home}/packages/Makefile"/>
1317 <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/>
1318
1319 </target>
1320 <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
1321 <antcall target="checkout-gli"/>
1322 </target>
1323
1324 <target name="checkout-gli" depends="check-cvsroot,init" if="gsdl2.islocal" unless="nocvs.mode">
1325 <echo>checking out gli</echo>
1326 <cvs command="checkout -P" package="gli"/>
1327 </target>
1328
1329 <target name="configure-gs2building" depends="init" if="gsdl2.islocal"
1330 description="Configure only the Greenstone 2 building components">
1331 <exec executable="${gs2build.home}/configure" os="${os.linux}"
1332 dir="${gs2build.home}">
1333 <arg value="--prefix=${gs2build.home}"/>
1334 </exec>
1335 <exec executable="${gs2build.home}/configure" os="${os.mac}"
1336 dir="${gs2build.home}">
1337 <arg value="--prefix=${gs2build.home}"/>
1338 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1339 </exec>
1340 </target>
1341
1342 <target name="clean-gs2building" depends="init,clean-gli,clean-gs2build" if="gsdl2.islocal"
1343 description="Clean only the Greenstone 2 building components"/>
1344 <target name="clean-gli" depends="init">
1345 <!-- gli -->
1346 <property name="gli.home" value="${basedir}/gli"/>
1347 <!-- linux -->
1348 <exec executable="clean.sh" os="${os.linux},${os.mac}" dir="${gli.home}"
1349 resolveExecutable="true"/>
1350 <!-- windows -->
1351 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1352 resolveExecutable="true"/>
1353 </target>
1354 <target name="clean-gs2build" depends="init">
1355 <!-- gs2build -->
1356 <!--linux: -->
1357 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1358 <arg value="clean"/>
1359 </exec>
1360 <!-- windows: -->
1361 </target>
1362
1363 <target name="clean-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1364 description="remove all object files and executables">
1365 <!-- run the setup script -->
1366 <exec executable="${compile.windows.c++.setup}"/>
1367 <exec executable="nmake" dir="${gs2build.home}">
1368 <arg value="/f"/>
1369 <arg value="win32.mak"/>
1370 <arg value="clean"/>
1371 </exec>
1372 </target>
1373
1374 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
1375 description="Compile only the Greenstone 2 building components">
1376 <!-- gli -->
1377 <property name="gli.home" value="${basedir}/gli"/>
1378 <!-- linux -->
1379 <exec executable="makegli.sh" os="${os.linux},${os.mac}" dir="${gli.home}"
1380 resolveExecutable="true"/>
1381 <!-- windows -->
1382 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
1383 resolveExecutable="true"/>
1384 <!-- gs2build -->
1385 <!--linux: make, make install -->
1386 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1387 </exec>
1388 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1389 <arg value="install"/>
1390 </exec>
1391 </target>
1392 <!-- windows: -->
1393 <target name="compile-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1394 description="Use this if you want to compile the C++ code for the gs2build package">
1395 <!-- run the setup script -->
1396 <exec executable="${compile.windows.c++.setup}"/>
1397 <exec executable="nmake" dir="${gs2build.home}">
1398 <arg value="/f"/>
1399 <arg value="win32.mak"/>
1400 </exec>
1401 </target>
1402 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
1403 </target>
1404
1405 <target name="gli-local" depends="init" if="gsdl2.islocal">
1406 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux}" dir="${basedir}/gli" spawn="true">
1407 <env key="gsdl3path" path="${basedir}"/>
1408 <env key="gsdlpath" path="${basedir}/gs2build"/>
1409 </exec>
1410 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1411 <env key="gsdl3path" path="${basedir}"/>
1412 <env key="gsdlpath" path="${basedir}/gs2build"/>
1413 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1414 </exec>
1415 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1416 <env key="GSDL3PATH" path="${basedir}"/>
1417 <env key="GSDLPATH" path="${basedir}/gs2build"/>
1418 </exec>
1419 <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 gli4gs3.sh/bat from the gsdl3/gli directory.
1420 </echo>
1421 </target>
1422
1423 <target name="gli-external" depends="init" unless="gsdl2.islocal">
1424 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.linux},${os.mac}" dir="${gsdl2.installed.path}/gli" spawn="true">
1425 <env key="gsdl3path" path="${basedir}"/>
1426 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1427 </exec>
1428 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl2.installed.path}/gli" spawn="true">
1429 <env key="GSDL3PATH" path="${basedir}"/>
1430 <env key="GSDLPATH" path="${gsdl2.installed.path}"/>
1431 </exec>
1432 <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 following in a terminal/command prompt:
1433 (Linux/Mac OS X / Windows)
1434in gsdl3 directory: source gs3-setup.sh / gs3-setup
1435in gsdl directory: source setup.bash / setup
1436in gli directory: gli4gs3.sh / gli4gs3
1437 </echo>
1438 </target>
1439
1440
1441<!-- ======================== TESTING Targets ========================= -->
1442
1443 <target name="test" description="Run the (incomplete) JUnit test suite "
1444 depends="init">
1445 <mkdir dir="${basedir}/test"/>
1446 <junit printsummary="withOutAndErr"
1447 errorproperty="test.failed"
1448 failureproperty="test.failed"
1449 fork="${junit.fork}">
1450 <formatter type="plain"/>
1451 <classpath>
1452 <pathelement location="${build.home}/gsdl3test.jar"/>
1453 <path refid="compile.classpath"/>
1454 </classpath>
1455 <test name="${testcase}" if="testcase"/>
1456 <batchtest todir="${basedir}/test" unless="testcase">
1457 <fileset dir="${build.home}"
1458 includes="**/*Test.class"
1459 />
1460 </batchtest>
1461 </junit>
1462 <echo>
1463 *********************************************
1464 Test output can be found in directory 'test'
1465 *********************************************
1466 </echo>
1467 </target>
1468
1469
1470<!-- ====================== DISTRIBUTION Targets ========================= -->
1471
1472 <target name="prepare-for-dist-1" depends="init">
1473 <cvs command="export -D '1 second ago'" package="mgpp"
1474 dest="${basedir}/packages/"
1475 cvsRoot=":pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src" />
1476 <cvs command="export -D '1 second ago'" package="gs2build"
1477 cvsRoot=":pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src" />
1478 <cvs command="export -D '1 second ago'" package="gli"
1479 cvsRoot=":pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src" />
1480 <antcall target="rename-gs2build-files-unix"/>
1481 <antcall target="unzip-windows-packages"/>
1482 <antcall target="get-windows-binaries"/>
1483 <antcall target="get-perl-for-windows"/>
1484 <antcall target="prepare-mysql"/>
1485 <delete file="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"/>
1486 <delete dir="${packages.home}/mysql/sql-bench"/>
1487 <delete dir="${packages.home}/mysql/tests"/>
1488 <delete dir="${packages.home}/mysql/mysql-test"/>
1489 <antcall target="prepare-tomcat"/>
1490 <delete file="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"/>
1491 <delete file="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"/>
1492 <antcall target="configure-tomcat"/>
1493 <antcall target="prepare-axis"/>
1494 <delete file="${basedir}/comms/soap/axis-bin-1_2_1.zip"/>
1495 <!-- delete old axis dir -->
1496 <delete dir="${basedir}/comms/soap/axis"/>
1497 <antcall target="prepare-web"/>
1498 </target>
1499
1500 <target name="prepare-for-dist-2" depends="init">
1501 <antcall target="configure-c++"/>
1502 </target>
1503
1504 <target name="prepare-for-dist-3" depends="init">
1505 <antcall target="compile"/>
1506 <antcall target="clean-packages-c++"/>
1507 <antcall target="clean-gs2build"/>
1508 <antcall target="deploy-localsite"/>
1509 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml.xsl"/>
1510 <delete dir="${basedir}/dist-resources"/>
1511 </target>
1512
1513 <target name="get-perl-for-windows" if="current.os.iswindows">
1514 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
1515 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
1516 usetimestamp="true"/>
1517 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
1518 dest="${gs2build.home}/bin/windows"/>
1519 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
1520 </target>
1521
1522 <target name="install-for-dist" depends="accept-properties,init,configure-mysql,configure,configure-tomcat">
1523 <condition property="need.xml.jars">
1524 <equals arg1="1.5" arg2="${ant.java.version}"/>
1525 </condition>
1526 <antcall target="rename-xml-jars"/>
1527 <antcall target="rename-gs2build-files-windows"/>
1528 </target>
1529</project>
1530
1531
Note: See TracBrowser for help on using the repository browser.