source: trunk/gsdl3/build.xml@ 11266

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

added in creation of GAI.jar in compile-core

  • Property svn:keywords set to Author Date Id Revision
File size: 69.3 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 <jar destfile="${build.home}/GAI.jar">
1022 <fileset dir="${build.home}">
1023 <include name="org/greenstone/admin/**"/>
1024 </fileset>
1025 <manifest>
1026 <attribute name="Built-By" value="${user.name}" />
1027 </manifest>
1028 </jar>
1029
1030 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1031 <jar destfile="${build.home}/phind.jar">
1032 <fileset dir="${build.home}">
1033 <include name="org/greenstone/applet/phind/**"/>
1034 </fileset>
1035 <manifest>
1036 <attribute name="Built-By" value="${user.name}" />
1037 </manifest>
1038 </jar>
1039 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1040 <jar destfile="${build.home}/anttasks.jar">
1041 <fileset dir="${build.home}">
1042 <include name="org/greenstone/anttasks/**"/>
1043 </fileset>
1044 <manifest>
1045 <attribute name="Built-By" value="${user.name}" />
1046 </manifest>
1047 </jar>
1048 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
1049 <jar destfile="${build.home}/gsdl3test.jar">
1050 <fileset dir="${build.home}">
1051 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1052 <include name="org/greenstone/testing/**"/>
1053 </fileset>
1054 <manifest>
1055 <attribute name="Built-By" value="${user.name}" />
1056 </manifest>
1057 </jar>
1058 </target>
1059
1060<!-- ================== Packages targets ================================ -->
1061 <!-- these targets refer to the greenstone source packages - these need
1062 updating less often, so are in separate targets to the core -->
1063 <target name="prepare-packages" depends="init,prepare-mgpp,prepare-windows"/>
1064
1065 <target name="prepare-windows" depends="init" if="current.os.iswindows">
1066 <!-- need to download precompiled binaries for mg and mgpp -->
1067 </target>
1068
1069 <target name="checkout-mgpp" depends="check-cvsroot,init" unless="nocvs.mode">
1070 <cvs command="checkout -P" package="mgpp" dest="${src.packages.home}"/>
1071 </target>
1072
1073 <target name="prepare-mgpp" depends="init" unless="mgpp.present">
1074 <antcall target="checkout-mgpp"/>
1075 </target>
1076
1077 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
1078 description="Update only the source packages"/>
1079
1080 <target name="cvsupdate-packages" unless="nocvs.mode">
1081 <cvs command="update -dP" dest="${src.packages.home}"/>
1082 </target>
1083
1084 <target name="configure-packages" description="Configure only the packages.">
1085 <echo>
1086 Configuring MG
1087 </echo>
1088 <exec executable="${mg.home}/configure" os="${os.unix}"
1089 dir="${mg.home}">
1090 <arg value="--prefix=${basedir}"/>
1091 <arg value="--libdir=${lib.jni}"/>
1092 </exec>
1093 <echo>
1094 Configuring MGPP
1095 </echo>
1096 <exec executable="${mgpp.home}/configure" os="${os.unix}"
1097 dir="${mgpp.home}">
1098 <arg value="--prefix=${basedir}"/>
1099 <arg value="--libdir=${lib.jni}"/>
1100 </exec>
1101 <echo>
1102 Configuring JavaGDBM
1103 </echo>
1104 <exec executable="${javagdbm.home}/configure" os="${os.linux},${os.solaris}"
1105 dir="${javagdbm.home}">
1106 <arg value="--prefix=${basedir}"/>
1107 <arg value="--libdir=${lib.jni}"/>
1108 </exec>
1109 <exec executable="${javagdbm.home}/configure" os="${os.mac}"
1110 dir="${javagdbm.home}">
1111 <arg value="--prefix=${basedir}"/>
1112 <arg value="--libdir=${lib.jni}"/>
1113 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1114 </exec>
1115
1116 </target>
1117
1118 <target name="clean-packages" depends="init,clean-packages-c++" description="Clean only the packages"/>
1119
1120 <target name="clean-packages-c++" depends="init">
1121 <!-- mg : just call the make target -->
1122 <exec executable="make" os="${os.unix}"
1123 dir="${mg.home}">
1124 <arg value="clean"/>
1125 </exec>
1126 <!-- mgpp -->
1127 <exec executable="make" os="${os.unix}"
1128 dir="${mgpp.home}">
1129 <arg value="clean"/>
1130 </exec>
1131 <!-- javagdbm -->
1132 <exec executable="make" os="${os.unix}"
1133 dir="${javagdbm.home}">
1134 <arg value="clean"/>
1135 </exec>
1136 </target>
1137
1138 <target name="distclean-packages-c++" depends="init">
1139 <!-- mg : just call the make target -->
1140 <exec executable="make" os="${os.unix}"
1141 dir="${mg.home}">
1142 <arg value="distclean"/>
1143 </exec>
1144 <!-- mgpp -->
1145 <exec executable="make" os="${os.unix}"
1146 dir="${mgpp.home}">
1147 <arg value="distclean"/>
1148 </exec>
1149 <!-- javagdbm -->
1150 <exec executable="make" os="${os.unix}"
1151 dir="${javagdbm.home}">
1152 <arg value="distclean"/>
1153 </exec>
1154 </target>
1155
1156 <target name="clean-windows-c++-packages" depends="init" if="current.os.iswindows"
1157 description="Clean only the C/C++ packages">
1158 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1159 <arg value="clean"/>
1160 </exec>
1161 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1162 <arg value="clean"/>
1163 </exec>
1164 </target>
1165
1166 <target name="compile-packages"
1167 description="Compile only the packages">
1168 <echo>Compiling MG</echo>
1169 <exec executable="make" os="${os.unix}"
1170 dir="${mg.home}">
1171 </exec>
1172 <exec executable="make" os="${os.unix}"
1173 dir="${mg.home}">
1174 <arg value="install"/>
1175 </exec>
1176 <!-- windows: just the java stuff. -->
1177 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
1178 dir="${mg.home}">
1179 <arg value="compile"/>
1180 <arg value="javaonly"/>
1181 </exec>
1182 <!-- install the jar file -->
1183 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1184
1185 <!-- mgpp -->
1186 <echo>Compiling MGPP</echo>
1187 <exec executable="make" os="${os.unix}"
1188 dir="${mgpp.home}">
1189 </exec>
1190 <exec executable="make" os="${os.unix}"
1191 dir="${mgpp.home}">
1192 <arg value="install"/>
1193 </exec>
1194 <!-- windows: just the java stuff. -->
1195 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
1196 dir="${mgpp.home}">
1197 <arg value="compile"/>
1198 <arg value="javaonly"/>
1199 </exec>
1200 <!-- install the jar file -->
1201 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1202
1203 <!-- javagdbm -->
1204 <exec executable="make" os="${os.unix}"
1205 dir="${javagdbm.home}">
1206 </exec>
1207 <exec executable="make" os="${os.unix}"
1208 dir="${javagdbm.home}">
1209 <arg value="install"/>
1210 </exec>
1211 <!-- windows: just the java stuff. -->
1212 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}"
1213 dir="${javagdbm.home}">
1214 <arg value="compile"/>
1215 <arg value="javaonly"/>
1216 </exec>
1217 <!-- install the jar file -->
1218 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1219
1220 </target>
1221
1222 <target name="compile-windows-c++-packages" depends="init" if="current.os.iswindows"
1223 description="Compile only the C/C++ packages">
1224 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1225 <env key="GSDL3HOME" value="${basedir}"/>
1226 </exec>
1227 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1228 <arg value="install"/>
1229 <env key="GSDL3HOME" value="${basedir}"/>
1230 </exec>
1231 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1232 <env key="GSDL3HOME" value="${basedir}"/>
1233 </exec>
1234 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1235 <arg value="install"/>
1236 <env key="GSDL3HOME" value="${basedir}"/>
1237 </exec>
1238 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
1239 <env key="GSDL3HOME" value="${basedir}"/>
1240 </exec>
1241 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
1242 <arg value="install"/>
1243 <env key="GSDL3HOME" value="${basedir}"/>
1244 </exec>
1245 </target>
1246
1247 <!-- =============== Extensions targets ==================== -->
1248
1249 <target name="prepare-extensions" depends="init"/>
1250
1251 <target name="cvsupdate-extensions" depends="init">
1252 <cvs command="update -dP" dest="${extensions.home}"/>
1253 </target>
1254
1255 <target name="configure-extensions"/>
1256
1257 <target name="clean-extensions" depends="init">
1258 <!-- vishnu : just call the ant target -->
1259 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1260 inheritall="false" target="clean">
1261 <property name="catalina.home" value="${catalina.home}"/>
1262 </ant>
1263 <!-- gsdl-as : just call the ant target-->
1264 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1265 inheritall="false" target="clean">
1266 <property name="catalina.home" value="${catalina.home}"/>
1267 </ant>
1268 </target>
1269
1270 <target name="compile-extensions">
1271 <!-- vishnu -->
1272 <echo>Compiling Vishnu</echo>
1273 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1274 inheritall="false" target="compile">
1275 <property name="catalina.home" value="${catalina.home}"/>
1276 </ant>
1277
1278 <!-- gsdl-as -->
1279 <echo>Compiling GSDL-AS</echo>
1280 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1281 inheritall="false" target="compile">
1282 <property name="catalina.home" value="${catalina.home}"/>
1283 </ant>
1284 </target>
1285
1286 <!-- ================== gs2building targets ===============-->
1287
1288
1289 <target name="update-gs2building" if="gsdl2.islocal"
1290 depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
1291 description="Update only the Greenstone 2 building components"/>
1292
1293 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init" unless="nocvs.mode">
1294 <cvs command="update -dP" dest="${gli.home}"/>
1295 <!-- Note: can't do a -d update here cos it will get all of gsdl
1296 also, an update doesn't get new files, so we do a checkout instead. -->
1297 <cvs command="co gs2build" dest="${basedir}"/>
1298 </target>
1299
1300 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
1301 </target>
1302
1303 <target name="checkout-gs2build" depends="check-cvsroot,init" unless="nocvs.mode">
1304 <echo>checking out gs2build</echo>
1305 <cvs command="checkout -P" package="gs2build"/>
1306 </target>
1307
1308 <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
1309 <antcall target="checkout-gs2build"/>
1310 <!-- rename the .gs2build files -->
1311 <antcall target="rename-gs2build-files"/>
1312 <antcall target="unzip-windows-packages"/>
1313 <antcall target="checkout-winbin"/>
1314 <antcall target="get-windows-binaries"/>
1315 <antcall target="get-macos-extra"/>
1316 </target>
1317
1318 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1319 unless="nocvs.mode">
1320 <cvs command="checkout -P" package="winbin"/>
1321 </target>
1322
1323 <target name="get-windows-binaries" depends="init" if="current.os.iswindows">
1324 <copy todir="${basedir}/bin">
1325 <fileset dir="${basedir}/winbin/bin" includes="mg*.exe"/>
1326 </copy>
1327 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1328 <fileset dir="${basedir}/winbin/bin"/>
1329 </move>
1330 <delete dir="${basedir}/winbin"/>
1331 </target>
1332
1333 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1334 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
1335 dest="${gs2build.home}/packages/windows/gdbm"/>
1336 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
1337 dest="${gs2build.home}/packages/windows/crypt"/>
1338 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
1339 dest="${gs2build.home}/packages/windows/expat"/>
1340 </target>
1341
1342 <!-- downloads a good XML-Parser -->
1343 <target name="get-macos-extra" depends="init" if="need.macos.extra">
1344 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1345 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1346 usetimestamp="true"/>
1347 </target>
1348
1349 <!-- untars the XML-Parser. need to do this after compiling in gs2build-->
1350 <target name="install-macos-extra" depends="init" if="need.macos.extra">
1351 <!-- make sure these directories are present, otherwise chmod craps out
1352 this chmod is needed in case we are unpacking for a second time -->
1353 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.8"/>
1354 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.6"/>
1355 <chmod dir="${gs2build.home}/perllib/cpan/perl-5.8" perm="ug+w" includes="**"/>
1356 <chmod dir="${gs2build.home}/perllib/cpan/perl-5.6" perm="ug+w" includes="**"/>
1357 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1358 dest="${gs2build.home}/perllib/cpan/"
1359 compression="gzip"/>
1360 </target>
1361
1362 <target name="rename-gs2build-files" depends="rename-gs2build-files-unix,rename-gs2build-files-windows"/>
1363
1364 <target name="rename-gs2build-files-windows" if="current.os.iswindows">
1365 <!-- we want a windows path in the setup.bat file -->
1366 <pathconvert targetos="windows" property="gs2build.home.windows">
1367 <path path="${gs2build.home}"/>
1368 </pathconvert>
1369
1370 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1371 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
1372 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
1373 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat">
1374 <filterset>
1375 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1376 </filterset>
1377 </copy>
1378 </target>
1379 <target name="rename-gs2build-files-unix" if="current.os.isunix">
1380 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1381 <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>
1382 <chmod file="${gs2build.home}/configure" perm="a+x"/>
1383 <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1384 <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/>
1385 <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1386 <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1387 <copy file="${gs2build-extra.home}/packages.Makefile" tofile="${gs2build.home}/packages/Makefile"/>
1388 <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/>
1389
1390 </target>
1391 <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
1392 <antcall target="checkout-gli"/>
1393 </target>
1394
1395 <target name="checkout-gli" depends="check-cvsroot,init" if="gsdl2.islocal" unless="nocvs.mode">
1396 <echo>checking out gli</echo>
1397 <cvs command="checkout -P" package="gli"/>
1398 </target>
1399
1400 <target name="configure-gs2building" depends="init" if="gsdl2.islocal"
1401 description="Configure only the Greenstone 2 building components">
1402 <exec executable="${gs2build.home}/configure" os="${os.linux},${os.solaris}"
1403 dir="${gs2build.home}">
1404 <arg value="--prefix=${gs2build.home}"/>
1405 </exec>
1406 <exec executable="${gs2build.home}/configure" os="${os.mac}"
1407 dir="${gs2build.home}">
1408 <arg value="--prefix=${gs2build.home}"/>
1409 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1410 </exec>
1411 </target>
1412
1413 <target name="clean-gs2building" depends="init,clean-gli,clean-gs2build" if="gsdl2.islocal"
1414 description="Clean only the Greenstone 2 building components"/>
1415 <target name="clean-gli" depends="init">
1416 <!-- gli -->
1417 <property name="gli.home" value="${basedir}/gli"/>
1418 <!-- linux -->
1419 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1420 resolveExecutable="true"/>
1421 <!-- windows -->
1422 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1423 resolveExecutable="true"/>
1424 </target>
1425 <target name="clean-gs2build" depends="init">
1426 <!-- gs2build -->
1427 <!--linux: -->
1428 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1429 <arg value="clean"/>
1430 </exec>
1431 <!-- windows: -->
1432 </target>
1433 <target name="distclean-gs2build" depends="init">
1434 <!-- gs2build -->
1435 <!--linux: -->
1436 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1437 <arg value="distclean"/>
1438 </exec>
1439 <!-- windows: -->
1440 </target>
1441
1442 <target name="clean-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1443 description="remove all object files and executables">
1444 <!-- run the setup script -->
1445 <exec executable="${compile.windows.c++.setup}"/>
1446 <exec executable="nmake" dir="${gs2build.home}">
1447 <arg value="/f"/>
1448 <arg value="win32.mak"/>
1449 <arg value="clean"/>
1450 </exec>
1451 </target>
1452
1453 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
1454 description="Compile only the Greenstone 2 building components">
1455 <!-- gli -->
1456 <property name="gli.home" value="${basedir}/gli"/>
1457 <!-- linux -->
1458 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}"
1459 resolveExecutable="true"/>
1460 <!-- windows -->
1461 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
1462 resolveExecutable="true"/>
1463 <!-- gs2build -->
1464 <!--linux: make, make install -->
1465 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1466 </exec>
1467 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1468 <arg value="install"/>
1469 </exec>
1470 <antcall target="install-macos-extra"/>
1471 </target>
1472 <!-- windows: -->
1473 <target name="compile-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1474 description="Use this if you want to compile the C++ code for the gs2build package">
1475 <!-- run the setup script -->
1476 <exec executable="${compile.windows.c++.setup}"/>
1477 <exec executable="nmake" dir="${gs2build.home}">
1478 <arg value="/f"/>
1479 <arg value="win32.mak"/>
1480 </exec>
1481 </target>
1482 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
1483 </target>
1484
1485 <target name="gli-local" depends="init" if="gsdl2.islocal">
1486 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1487 <env key="gsdl3path" path="${basedir}"/>
1488 <env key="gsdlpath" path="${basedir}/gs2build"/>
1489 </exec>
1490 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1491 <env key="gsdl3path" path="${basedir}"/>
1492 <env key="gsdlpath" path="${basedir}/gs2build"/>
1493 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1494 </exec>
1495 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1496 <env key="GSDL3PATH" path="${basedir}"/>
1497 <env key="GSDLPATH" path="${basedir}/gs2build"/>
1498 </exec>
1499 <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.
1500 </echo>
1501 </target>
1502
1503 <target name="gli-external" depends="init" unless="gsdl2.islocal">
1504 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.linux},${os.solaris}" dir="${gsdl2.installed.path}/gli" spawn="true">
1505 <env key="gsdl3path" path="${basedir}"/>
1506 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1507 </exec>
1508 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.mac}" dir="${gsdl2.installed.path}/gli" spawn="true">
1509 <env key="gsdl3path" path="${basedir}"/>
1510 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1511 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1512 </exec>
1513 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl2.installed.path}/gli" spawn="true">
1514 <env key="GSDL3PATH" path="${basedir}"/>
1515 <env key="GSDLPATH" path="${gsdl2.installed.path}"/>
1516 </exec>
1517 <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:
1518 (Linux/Mac OS X / Windows)
1519in greenstone3 directory: source gs3-setup.sh / gs3-setup
1520in gsdl directory: source setup.bash / setup
1521in gli directory: gli4gs3.sh / gli4gs3
1522 </echo>
1523 </target>
1524
1525
1526<!-- ======================== TESTING Targets ========================= -->
1527
1528 <target name="test" description="Run the (incomplete) JUnit test suite "
1529 depends="init">
1530 <mkdir dir="${basedir}/test"/>
1531 <junit printsummary="withOutAndErr"
1532 errorproperty="test.failed"
1533 failureproperty="test.failed"
1534 fork="${junit.fork}">
1535 <formatter type="plain"/>
1536 <classpath>
1537 <pathelement location="${build.home}/gsdl3test.jar"/>
1538 <path refid="compile.classpath"/>
1539 </classpath>
1540 <test name="${testcase}" if="testcase"/>
1541 <batchtest todir="${basedir}/test" unless="testcase">
1542 <fileset dir="${build.home}"
1543 includes="**/*Test.class"
1544 />
1545 </batchtest>
1546 </junit>
1547 <echo>
1548 *********************************************
1549 Test output can be found in directory 'test'
1550 *********************************************
1551 </echo>
1552 </target>
1553
1554
1555<!-- ====================== DISTRIBUTION Targets ========================= -->
1556
1557 <target name="prepare-for-dist-1" depends="init">
1558 <cvs command="export -D '1 second ago'" package="mgpp"
1559 dest="${src.packages.home}"
1560 cvsRoot="${cvs.root}" />
1561 <cvs command="export -D '1 second ago'" package="gs2build"
1562 cvsRoot="${cvs.root}" />
1563 <cvs command="export -D '1 second ago'" package="gli"
1564 cvsRoot="${cvs.root}" />
1565 <delete file="${gli.home}/gli.bat"/>
1566 <delete file="${gli.home}/gli.sh"/>
1567 <antcall target="rename-gs2build-files-unix"/>
1568 <antcall target="unzip-windows-packages"/>
1569 <antcall target="checkout-winbin"/>
1570 <antcall target="get-windows-binaries"/>
1571 <antcall target="get-perl-for-windows"/>
1572 <antcall target="get-macos-extra"/>
1573 <antcall target="delete-windows-files"/>
1574 <antcall target="prepare-tomcat"/>
1575 <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
1576 <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
1577 <antcall target="configure-tomcat"/>
1578 <antcall target="prepare-axis"/>
1579 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
1580 <!-- delete old axis dir -->
1581 <delete dir="${packages.home}/axis"/>
1582 <antcall target="prepare-web"/>
1583 <antcall target="prepare-collections"/>
1584 </target>
1585
1586 <target name="prepare-for-dist-2" depends="init">
1587 <antcall target="prepare-mysql"/>
1588 <delete file="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"/>
1589 <delete file="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"/>
1590 <delete file="${packages.home}/mysql-noinstall-4.1.15-win32.zip"/>
1591 <delete dir="${packages.home}/mysql/sql-bench"/>
1592 <delete dir="${packages.home}/mysql/tests"/>
1593 <delete dir="${packages.home}/mysql/mysql-test"/>
1594 <delete file="${packages.home}/mysql/var/log/mysql.log"/>
1595 </target>
1596
1597 <target name="prepare-for-dist-3" depends="init">
1598 <antcall target="configure-c++"/>
1599 </target>
1600
1601 <target name="prepare-for-dist-4" depends="init">
1602 <antcall target="compile"/>
1603 <antcall target="clean-packages-c++"/>
1604 <antcall target="distclean-packages-c++"/>
1605 <antcall target="clean-gs2build"/>
1606 <antcall target="distclean-gs2build"/>
1607 <antcall target="install-macos-extra"/>
1608 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml.xsl"/>
1609 <delete dir="${basedir}/build"/>
1610 <delete dir="${basedir}/dist-resources"/>
1611 </target>
1612
1613 <target name="get-perl-for-windows" if="current.os.iswindows">
1614 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
1615 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
1616 usetimestamp="true"/>
1617 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
1618 dest="${gs2build.home}/bin/windows"/>
1619 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
1620 </target>
1621
1622 <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
1623 <delete dir="${basedir}/winutil"/>
1624 <delete>
1625 <fileset dir="${lib.jni}" includes="*.dll"/>
1626 </delete>
1627 </target>
1628
1629 <target name="install-for-dist" depends="accept-properties,init,configure-mysql,configure,configure-tomcat">
1630 <condition property="need.xml.jars">
1631 <equals arg1="1.5" arg2="${ant.java.version}"/>
1632 </condition>
1633 <antcall target="rename-xml-jars"/>
1634 <antcall target="rename-gs2build-files-windows"/>
1635 <antcall target="deploy-localsite"/>
1636 </target>
1637
1638 <target name="prepare-for-source-dist" depends="init">
1639 <cvs command="export -D '1 second ago'" package="mgpp"
1640 dest="${src.packages.home}"
1641 cvsRoot="${cvs.root}" />
1642 <cvs command="export -D '1 second ago'" package="gs2build"
1643 cvsRoot="${cvs.root}" />
1644 <cvs command="export -D '1 second ago'" package="gli"
1645 cvsRoot="${cvs.root}" />
1646 <delete file="${gli.home}/gli.bat"/>
1647 <delete file="${gli.home}/gli.sh"/>
1648 <antcall target="rename-gs2build-files-unix"/>
1649 <antcall target="prepare-collections"/>
1650 <antcall target="prepare-axis"/>
1651 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
1652 <!-- delete old axis dir -->
1653 <delete dir="${packages.home}/axis"/>
1654 <!-- download the mac XML parser just in case: it will only be unpacked if on a mac -->
1655 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1656 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1657 usetimestamp="true"/>
1658 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml-source.xsl"/>
1659 <delete dir="${basedir}/dist-resources"/>
1660
1661 </target>
1662
1663 <target name="prepare-for-source" depends="init,unzip-windows-packages,rename-gs2build-files-windows,prepare-tomcat,prepare-mysql,prepare-web"/>
1664</project>
1665
1666
Note: See TracBrowser for help on using the repository browser.