source: main/tags/3.01-src/gsdl3/build.xml@ 24204

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

split old prepare-web into two - prepare-web and prepare-collections

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