source: branches/ant-install-branch/gsdl3/build.xml@ 9822

Last change on this file since 9822 was 9792, checked in by kjdon, 19 years ago

added CATALINA_HOME to the environment for tomcat startup and shutdown, and added a deploy-localsite target, which is used during install

  • Property svn:keywords set to Author Date Id Revision
File size: 47.0 KB
Line 
1<?xml version="1.0"?>
2
3<!-- ======================================================================
4 March 2005
5
6 GSDL3 build and install script
7
8 kjdon
9 ====================================================================== -->
10<project name="gsdl3" default="usage" basedir=".">
11
12 <!-- ============ self defined tasks =================== -->
13
14 <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/>
15 <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/>
16
17
18
19<!-- ===================== Property Definitions =========================== -->
20
21<!--
22
23 Each of the following properties are used in the build script.
24 Values for these properties are set by the first place they are
25 defined, from the following list:
26
27 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
28
29 * Definitions from a "build.properties" file in the top level
30 source directory of this application.
31
32 * Definitions from a "build.properties" file in the user's
33 home directory.
34
35 * Default definitions in this build.xml file.
36
37 You will note below that property values can be composed based on the
38 contents of previously defined properties. This is a powerful technique
39 that helps you minimize the number of changes required when your development
40 environment is modified. Note that property composition is allowed within
41 "build.properties" files as well as in the "build.xml" script.
42
43-->
44
45 <property file="build.properties"/>
46 <property file="${user.home}/build.properties"/>
47
48 <!-- get properties from the environment -->
49 <property environment="env"/>
50 <property name="src.home" value="${basedir}/src/java"/>
51 <property name="build.home" value="${basedir}/build"/>
52 <property name="packages.home" value="${basedir}/packages"/>
53 <property name="javalib" value="${basedir}/lib/java"/>
54 <property name="web.home" value="${basedir}/web"/>
55 <property name="web.lib" value="${web.home}/lib"/>
56 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
57
58 <property name="javadocs" value="${basedir}/docs/javadoc"/>
59
60 <property name="app.name" value="gsdl3"/>
61 <property name="app.path" value="/${app.name}"/>
62 <property name="app.version" value="3.00alpha"/>
63 <property name="catalina.home" value="${basedir}/comms/jakarta/tomcat"/>
64
65 <property name="os.linux" value="Linux"/> <!-- mac??-->
66 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows XP, Windows NT,Windows ME"/> <!-- check this!!!-->
67
68 <condition property="current.os.islinux">
69 <os family="unix"/>
70 </condition>
71 <condition property="current.os.iswindows">
72 <os family="windows"/>
73 </condition>
74 <!-- ============= Base dirs for each package and component ============ -->
75 <property name="applet.home" value="${src.home}/org/greenstone/applet"/>
76 <property name="gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
77 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
78 <property name="gs2build.home" value="${basedir}/gs2build"/>
79 <property name="gli.home" value="${basedir}/gli"/>
80 <property name="vishnu.home" value="${packages.home}/vishnu"/>
81 <property name="mg.home" value="${packages.home}/mg"/>
82 <property name="mgpp.home" value="${packages.home}/mgpp"/>
83 <property name="mysql.home" value="${packages.home}/mysql"/>
84 <property name="gsdl-as.home" value="${packages.home}/gsdl-as"/>
85
86<!-- ==================== Compilation Control Options ==================== -->
87
88<!--
89
90 These properties control option settings on the Javac compiler when it
91 is invoked using the <javac> task.
92
93 compile.debug Should compilation include the debug option?
94
95 compile.deprecation Should compilation include the deprecation option?
96
97 compile.optimize Should compilation include the optimize option?
98
99-->
100
101 <property name="compile.debug" value="true"/>
102 <property name="compile.deprecation" value="true"/>
103 <property name="compile.optimize" value="true"/>
104
105<!--
106
107 Rather than relying on the CLASSPATH environment variable, Ant includes
108 features that makes it easy to dynamically construct the classpath you
109 need for each compilation. The example below constructs the compile
110 classpath to include the servlet.jar file, as well as the other components
111 that Tomcat makes available to web applications automatically, plus anything
112 that you explicitly added.
113
114-->
115
116 <path id="compile.classpath">
117 <!-- Include all jar files in our lib directory -->
118 <pathelement location="${javalib}"/>
119 <fileset dir="${javalib}">
120 <include name="*.jar"/>
121 </fileset>
122 <!-- Include the resources directory -->
123 <pathelement location="${basedir}/resources/java"/>
124 <pathelement location="${basedir}/resources/dtd"/>
125
126 <!-- Include the axis jar files -->
127 <fileset dir="${basedir}/comms/soap/axis/lib">
128 <include name="*.jar"/>
129 </fileset>
130
131 <!-- include the jar files from the packages -->
132 <!-- mg and mgpp get installed into lib/java but they may not be there yet -->
133 <pathelement location="${javalib}/mg.jar"/>
134 <pathelement location="${javalib}/mgpp.jar"/>
135 <pathelement location="${vishnu.home}/build/vishnu.jar"/>
136
137 <!-- Include all elements that Tomcat exposes to applications -->
138 <pathelement location="${catalina.home}/common/classes"/>
139 <fileset dir="${catalina.home}/common/endorsed">
140 <include name="*.jar"/>
141 </fileset>
142 <fileset dir="${catalina.home}/common/lib">
143 <include name="*.jar"/>
144 </fileset>
145 <pathelement location="${catalina.home}/shared/classes"/>
146 <fileset dir="${catalina.home}/shared/lib">
147 <include name="*.jar"/>
148 </fileset>
149 </path>
150
151 <path id="running.path">
152 <pathelement location="${mysql.home}/bin"/>
153 <pathelement location="${basedir}/bin/script"/>
154 <pathelement location="${basedir}/bin"/>
155 <pathelement location="${basedir}/lib"/>
156 <pathelement path="${env.PATH}"/>
157 <pathelement path="${env.Path}"/>
158 </path>
159
160 <path id="ld.library.path">
161 <pathelement path="${env.LD_LIBRARY_PATH}"/>
162 <pathelement location="${basedir}/lib"/>
163 <pathelement location="${mysql.home}/lib/mysql"/>
164 </path>
165
166<!-- ==================== Primary and Global Targets ============================= -->
167
168 <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
169
170 <target name="install" depends="accept-properties,init,prepare,cvsupdate,configure,clean,compile,deploy-localsite"
171 description="Install Greenstone 3. Use this when you first checkout the code. Also running this target later on will reinstall Greenstone. Most things will be reset back to their defaults, except for code changes."/>
172
173 <target name="prepare" depends="init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-collections,prepare-extra"/>
174
175 <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building"
176 description="Do a cvs update for all sources. Doesn't reompile the code."/>
177
178 <target name="configure" depends="init,configure-tomcat,configure-files,configure-packages,configure-core,configure-gs2building"
179 description="Configure the installation. Includes setting up config files and configuring the C/C++ packages. This is called from install and update. Should be re-run if you change the build.properties file."/>
180
181 <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building"
182 description="Remove all old compiled code. Includes core, packages and gs2building if necessary"/>
183 <target name="clean-windows-c++" depends="init,clean-windows-c++-gs2building,clean-windows-c++-packages"
184 description="Remove C++ compiled code for Windows. Requires Microsoft Visual Studio"/>
185 <target name="compile" depends="init,compile-extra,compile-packages,compile-core,compile-gs2building"
186 description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/>
187 <target name="compile-windows-c++" depends="init,compile-windows-c++-gs2building,compile-windows-c++-packages"
188 description="Compile the C/C++ code for Windows. Requires Microsoft Visual Studio"/>
189 <target name="update" depends="init,update-packages,update-core,update-gs2building"
190 description="Update (thru CVS) all the source (including core, packages and gs2building) and recompile. Similar to install but doesn't reinstall components such as Tomcat and axis."/>
191
192 <target name="startup" depends="init,startup-mysql,startup-tomcat"
193 description="Startup the (local) Greenstone servers (tomcat,mysql...)" />
194
195 <target name="shutdown" depends="init,shutdown-tomcat,shutdown-mysql"
196 description="Shutdown the (local) Greenstone servers."/>
197
198 <target name="restart" description="Shutdown and restart the Greenstone servers" depends="init,shutdown,startup"/>
199
200
201<!-- =========== Help targets =================================== -->
202
203 <target name="usage" description="Print a help message">
204 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
205 <echo message=" Execute 'ant -help' for Ant help."/>
206 <echo>To install Greenstone, run 'ant [options] install'.
207There 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.
208To log the output, use the '-logfile build.log' option.
209 </echo>
210 </target>
211
212 <target name="help" depends="usage" description="Print a help message"/>
213
214 <target name="debug" depends="init" description="Display all the currently used properties">
215 <echoproperties/>
216 </target>
217
218<!-- ====== initialization and setup targets ================== -->
219
220 <target name="accept-properties" unless="properties.accepted">
221 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
222tomcat.server=${tomcat.server}
223tomcat.port=${tomcat.port}
224tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
225gsdl2.installed.path=${gsdl2.installed.path} (this is the location of Greenstone 2 if you have it)
226proxy.host=${proxy.host}
227proxy.port=${proxy.port}
228mysql.installed.path=${mysql.installed.path} (this is the location of mysql if it is already installed)
229mysql.admin.user=${mysql.admin.user}
230mysql.port=${mysql.port}
231If these are not acceptable, please change them and rerun this target. Continue [y/n]?" />
232 </input>
233 <condition property="do.abort">
234 <equals arg1="n" arg2="${properties.ok}"/>
235 </condition>
236 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
237 </target>
238
239 <target name="check-cvsroot">
240 <condition property="cvsroot.notset">
241 <or>
242 <not>
243 <isset property="env.CVSROOT"/>
244 </not>
245 <equals arg1="" arg2="${env.CVSROOT}"/>
246 </or>
247 </condition>
248 <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/>
249 </target>
250 <!-- this sets up some initial properties -->
251 <target name="init">
252
253 <condition property="java.too.old">
254 <or>
255 <equals arg1="1.1" arg2="${ant.java.version}"/>
256 <equals arg1="1.2" arg2="${ant.java.version}"/>
257 <equals arg1="1.3" arg2="${ant.java.version}"/>
258 </or>
259 </condition>
260 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
261
262 <available file="${basedir}/packages/mgpp/text" property="mgpp.present"/>
263 <available file="${basedir}/packages/mysql/bin" property="mysql.present"/>
264 <available file="${basedir}/gli" property="gli.present"/>
265 <available file="${basedir}/gs2build" property="gs2build.present"/>
266 <available file="${basedir}/comms/soap/axis" property="axis.present"/>
267 <available file="${basedir}/comms/jakarta/tomcat/webapps/axis" property="axis.installed"/>
268 <condition property="gsdl2.islocal">
269 <or>
270 <not>
271 <isset property="gsdl2.installed.path"/>
272 </not>
273 <equals arg1="" arg2="${gsdl2.installed.path}"/>
274 </or>
275 </condition>
276 <condition property="mysql.islocal">
277 <or>
278 <not>
279 <isset property="mysql.installed.path"/>
280 </not>
281 <equals arg1="" arg2="${mysql.installed.path}"/>
282 </or>
283 </condition>
284 <condition property="tomcat.islocal">
285 <or>
286 <not>
287 <isset property="tomcat.installed.path"/>
288 </not>
289 <equals arg1="" arg2="${tomcat.installed.path}"/>
290 </or>
291 </condition>
292
293 <echo>tomcat.port:${tomcat.port}, gli.present:${gli.present} gsdlislocal=${gsdl2.islocal} gs2build.present=${gs2build.present} gsdl2.installed.path = ${gsdl2.installed.path}</echo>
294 <condition property="proxy.present">
295 <not>
296 <equals arg1="" arg2="${proxy.host}"/>
297 </not>
298 </condition>
299 </target>
300
301 <target name="setup-proxy" depends="init" if="proxy.present">
302 <condition property="ask.user">
303 <or>
304 <equals arg1="" arg2="${proxy.user}"/>
305 <equals arg1="" arg2="${proxy.password}"/>
306 </or>
307 </condition>
308 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}"/>
309 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
310 </target>
311
312 <!-- ========== Miscellaneous Targets ================================ -->
313
314 <target name="prepare-collections">
315 <property name="collect.dir" value="${basedir}/web/sites/localsite/collect"/>
316 <!-- gs3mgdemo -->
317 <unzip src="${collect.dir}/gs3mgdemo/import.zip"
318 dest="${collect.dir}/gs3mgdemo"/>
319 <unzip src="${collect.dir}/gs3mgdemo/archives.zip"
320 dest="${collect.dir}/gs3mgdemo"/>
321 <unzip src="${collect.dir}/gs3mgdemo/index/index.zip"
322 dest="${collect.dir}/gs3mgdemo/index"/>
323 <!-- gs2mgdemo -->
324 <unzip src="${collect.dir}/gs2mgdemo/import.zip"
325 dest="${collect.dir}/gs2mgdemo"/>
326 <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
327 dest="${collect.dir}/gs2mgdemo"/>
328 <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
329 dest="${collect.dir}/gs2mgdemo/index"/>
330 <!-- gs2mgppdemo -->
331 <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
332 dest="${collect.dir}/gs2mgppdemo"/>
333 <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
334 dest="${collect.dir}/gs2mgppdemo"/>
335 <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
336 dest="${collect.dir}/gs2mgppdemo/index"/>
337 <!-- gberg -->
338 <unzip src="${collect.dir}/gberg/index/index.zip"
339 dest="${collect.dir}/gberg/index"/>
340 </target>
341
342 <target name="prepare-extra" depends="init">
343 <!-- copy some jar files to web/lib for the phind applet -->
344 <copy file="${catalina.home}/common/endorsed/xml-apis.jar"
345 tofile="${basedir}/web/lib/xml-apis.jar"/>
346 <copy file="${catalina.home}/common/endorsed/xercesImpl.jar"
347 tofile="${basedir}/web/lib/xercesImpl.jar"/>
348 </target>
349 <target name="configure-files" depends="init">
350 <filter token="port" value="${tomcat.port}"/>
351 <filter token="hostname" value="${tomcat.server}"/>
352 <filter token="gsdl3home" value="${basedir}"/>
353 <copy file="${basedir}/web/WEB-INF/web.xml.in" tofile="${basedir}/web/WEB-INF/web.xml" filtering="true"/>
354 <copy file="${basedir}/web/sites/localsite/siteConfig.xml.in" tofile="${basedir}/web/sites/localsite/siteConfig.xml" filtering="true"/>
355 <copy file="${basedir}/web/sites/gateway/siteConfig.xml.in" tofile="${basedir}/web/sites/gateway/siteConfig.xml" filtering="true"/>
356 <copy file="${basedir}/resources/java/SOAPServer.cfg.in" tofile="${basedir}/resources/java/SOAPServer.cfg" filtering="true"/>
357
358 </target>
359
360 <target name="compile-extra" depends="init">
361 <javac srcdir="${web.home}/WEB-INF/classes"
362 destdir="${web.home}/WEB-INF/classes"
363 debug="${compile.debug}"
364 deprecation="${compile.deprecation}"
365 optimize="${compile.optimize}">
366 <classpath>
367 <path refid="compile.classpath"/>
368 </classpath>
369 </javac>
370 </target>
371
372
373
374
375<!-- ======================= Tomcat Targets ========================== -->
376
377 <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
378 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
379 <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7.zip"
380 dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
381 usetimestamp="true"/>
382 <delete dir="${basedir}/comms/jakarta/tomcat.bak"/>
383 <move todir="${basedir}/comms/jakarta/tomcat.bak" failonerror="false">
384 <fileset dir="${basedir}/comms/jakarta/tomcat"/>
385 </move>
386 <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
387 dest="${basedir}/comms/jakarta"/>
388 <condition property="need.tomcat.compat">
389 <equals arg1="1.4" arg2="${ant.java.version}"/>
390 </condition>
391 <antcall target="prepare-tomcat-compat"/>
392 <move todir="${basedir}/comms/jakarta/tomcat">
393 <fileset dir="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7"/>
394 </move>
395 <!-- make sure we have execute permission for the .sh files -->
396 <chmod dir="${basedir}/comms/jakarta/tomcat/bin" perm="ugo+rx"
397 includes="*.sh"/>
398 <copy file="${basedir}/comms/jakarta/setclasspath.bat"
399 tofile="${basedir}/comms/jakarta/tomcat/bin/setclasspath.bat"
400 overwrite="true"/>
401 </target>
402
403
404 <target name="prepare-tomcat-compat" if="need.tomcat.compat">
405 <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7-compat.zip"
406 dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
407 usetimestamp="true"/>
408 <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
409 dest="${basedir}/comms/jakarta"/>
410 </target>
411
412 <target name="configure-tomcat" depends="init" if="tomcat.islocal">
413 <!-- re-setup the server.xml file -->
414 <copy file="${basedir}/comms/jakarta/server.xml.in" tofile="${basedir}/comms/jakarta/tomcat/conf/server.xml" overwrite="true">
415 <filterset>
416 <filter token="port" value="${tomcat.port}"/>
417 <filter token="gsdl3home" value="${basedir}"/>
418 </filterset>
419 </copy>
420 </target>
421
422 <target name="reload" description="Reload web application"
423 depends="init,setup-catalina-ant-tasks">
424 <reload url="http://kanuka:7070/manager" username="admin" password="admin"
425 path="/gsdl3"/>
426 </target>
427
428 <target name="startup-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
429 <property name="tomcat.classpath" refid="compile.classpath"/>
430 <property name="tomcat.path" refid="running.path"/>
431 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
432 <exec executable="${catalina.home}/bin/startup.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false">
433 <env key="GSDLOS" value="linux"/>
434 <env key="GSDL3HOME" value="${basedir}"/>
435 <env key="PATH" path="${tomcat.path}"/>
436 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
437 <env key="CATALINA_HOME" value="${catalina.home}"/>
438 <env key="CLASSPATH" path="${tomcat.classpath}"/>
439 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${basedir}/lib:${mysql.home}/lib/mysql"/>
440 </exec>
441 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
442 <env key="GSDLOS" value="windows"/>
443 <env key="GSDL3HOME" value="${basedir}"/>
444 <env key="Path" path="${tomcat.path}"/>
445 <env key="PATH" path="${tomcat.path}"/>
446 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
447 <env key="CLASSPATH" path="${tomcat.classpath}"/>
448 </exec>
449 <!-- wait for the server to startup in case other targets need it running -->
450 <waitfor maxwait="5" maxwaitunit="second">
451 <and>
452 <socket server="${tomcat.server}" port="${tomcat.port}"/>
453 <http url="http://${tomcat.server}:${tomcat.port}/gsdl3/index.html"/>
454 </and>
455 </waitfor>
456 </target>
457 <!-- windows: do we want to launch a webrowser?? -->
458 <target name="shutdown-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
459 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false">
460 <env key="CATALINA_HOME" value="${catalina.home}"/>
461 </exec>
462 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false"/>
463 </target>
464
465 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,shutdown-tomcat,startup-tomcat"/>
466
467 <target name="setup-catalina-ant-tasks">
468 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
469 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
470 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
471 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
472 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
473 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
474 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
475 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
476 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
477 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
478 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
479 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
480 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
481 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
482 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
483 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
484 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
485 </target>
486
487
488<!-- ======================= Mysql Targets =========================== -->
489
490 <!-- this is one target that we only want to run once. -->
491 <target name="prepare-mysql" depends="init,init-mysql-vars,install-mysql,startup-mysql,setup-mysql,shutdown-mysql"/>
492
493 <target name="init-mysql-vars">
494 <condition property="mysql.islocal.linux">
495 <and>
496 <isset property="mysql.islocal"/>
497 <isset property="current.os.islinux"/>
498 </and>
499 </condition>
500
501 <condition property="mysql.islocal.windows">
502 <and>
503 <isset property="mysql.islocal"/>
504 <isset property="current.os.iswindows"/>
505 </and>
506 </condition>
507 </target>
508
509 <target name="install-mysql" depends="init,init-mysql-vars,install-mysql-linux,install-mysql-windows"/>
510
511 <!-- install and set up the database -->
512 <target name="install-mysql-linux" depends="init,init-mysql-vars" if="mysql.islocal.linux" unless="mysql.present">
513 <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
514 dest="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
515 usetimestamp="true"/>
516 <untar src="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
517 dest="${packages.home}"
518 compression="gzip"/>
519 <move todir="${packages.home}/mysql">
520 <fileset dir="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686"/>
521 </move>
522 <!-- file permissions are screwed up, so make executables executable -->
523 <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
524 <chmod perm="a+x">
525 <fileset dir="${mysql.home}/bin" />
526 </chmod>
527 <mkdir dir="${mysql.home}/var/"/>
528 <mkdir dir="${mysql.home}/var/log/"/>
529 <chmod file="${mysql.home}/var/" perm="777"/>
530 <chmod file="${mysql.home}/var/log/" perm="777"/>
531
532 <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
533 <arg value="--datadir=./data"/>
534 <arg value="--basedir=."/>
535 <arg value="--user=root"/>
536 <arg value="--force"/>
537 </exec>
538 </target>
539
540 <target name="install-mysql-windows" depends="init,init-mysql-vars" if="mysql.islocal.windows" unless="mysql.present">
541 <get src="http://www.greenstone.org/gs3files/mysql-noinstall-4.1.11-win32.zip"
542 dest="${packages.home}/mysql-noinstall-4.1.11-win32.zip"
543 usetimestamp="true"/>
544 <!-- can we run the installer?? -->
545 <unzip src="${packages.home}/mysql-noinstall-4.1.11-win32.zip"
546 dest="${packages.home}"/>
547 <move todir="${packages.home}/mysql">
548 <fileset dir="${packages.home}/mysql-4.1.11-win32"/>
549 </move>
550 </target>
551
552 <!-- is this just linux or both??. also we probably need to do this for external mysql -->
553 <!-- had unless mysql.present -->
554 <target name="setup-mysql" depends="init,init-mysql-vars" if="mysql.islocal">
555 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
556 <arg value="--user=root"/>
557 <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"/>
558 </exec>
559 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
560 <arg value="--user=root"/>
561 <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@'%'"/>
562 </exec>
563 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
564 <arg value="--user=root"/>
565 <arg value="--execute=GRANT SELECT ON *.* TO gsdl3reader@localhost;"/>
566 </exec>
567 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
568 <arg value="--user=root"/>
569 <arg value="--execute=create database localsite_gs3mgdemo;"/>
570 </exec>
571 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
572 input="${basedir}/web/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
573 <arg value="--user=root"/>
574 <arg value="localsite_gs3mgdemo"/>
575 </exec>
576 </target>
577
578 <target name="startup-mysql" depends="init,init-mysql-vars" if="mysql.islocal"
579 description="Startup only mysql">
580 <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
581 spawn="true" os="${os.linux}">
582 <arg value="--user=root"/>
583 <arg value="--datadir=./data"/>
584 <arg value="--basedir=."/>
585 <arg value="--pid_file=gsdl3.pid"/>
586 <arg value="--socket=/tmp/mysql.sock"/>
587 <arg value="--err-log=./var/log/mysql.log"/>
588 </exec>
589 <exec executable="${mysql.home}/bin/mysqld" dir="${mysql.home}" spawn="true" os="${os.windows}">
590 </exec>
591 <sleep seconds="2"/>
592 <!-- need to test that the server has started up -->
593 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
594 failonerror="true" outputproperty="throw.away">
595 <arg value="--user=root"/>
596 <arg value="--execute=show databases;"/>
597 </exec>
598 <echo>MYSQL database server started successfully</echo>
599 </target>
600
601 <target name="shutdown-mysql" depends="init" if="mysql.islocal"
602 description="Shutdown only mysql">
603 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
604 failonerror="true" os="${os.linux}">
605 <arg value="--user=root"/>
606 <arg value="--socket=/tmp/mysql.sock"/>
607 <arg value="shutdown"/>
608 </exec>
609 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
610 failonerror="true" os="${os.windows}">
611 <arg value="--user=root"/>
612 <arg value="shutdown"/>
613 </exec>
614 <echo>MYSQL database server shutdown successfully</echo>
615 </target>
616
617 <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,shutdown-mysql,startup-mysql"/>
618
619
620<!-- ======================= Axis Targets ============================ -->
621
622 <target name="prepare-axis" depends="init">
623 <mkdir dir="${basedir}/comms/soap"/>
624 <get src="http://www.greenstone.org/gs3files/axis-1_1.zip"
625 dest="${basedir}/comms/soap/axis-1_1.zip"
626 usetimestamp="true"/>
627 <delete dir="${basedir}/comms/soap/axis.bak"/>
628 <move todir="${basedir}/comms/soap/axis.bak" failonerror="false">
629 <fileset dir="${basedir}/comms/soap/axis"/>
630 </move>
631 <unzip src="${basedir}/comms/soap/axis-1_1.zip"
632 dest="${basedir}/comms/soap/"/>
633 <move todir="${basedir}/comms/soap/axis">
634 <fileset dir="${basedir}/comms/soap/axis-1_1"/>
635 </move>
636 <!-- install the webapp into tomcat -->
637 <copy todir="${basedir}/comms/jakarta/tomcat/webapps/axis">
638 <fileset dir="${basedir}/comms/soap/axis/webapps/axis"/>
639 </copy>
640 </target>
641
642 <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files,restart-tomcat"
643 description="Deploy a SOAP web service for a local Greenstone site">
644 <java classname="org.apache.axis.client.AdminClient">
645 <classpath refid="compile.classpath"/>
646 <arg value="-p"/>
647 <arg value="${tomcat.port}"/>
648 <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
649 </java>
650 </target>
651
652 <target name="soap-undeploy-site" depends="get-sitename"
653 description="Undeploy a SOAP web service for a local Greenstone site">
654 <java classname="org.apache.axis.client.AdminClient">
655 <classpath refid="compile.classpath"/>
656 <arg value="-p"/>
657 <arg value="${tomcat.port}"/>
658 <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
659 </java>
660 </target>
661
662 <target name="deploy-localsite" depends="init">
663 <antcall target="startup-tomcat"/>
664 <antcall target="soap-deploy-site">
665 <param name="axis.sitename" value="localsite"/>
666 <param name="axis.siteuri" value="localsite"/>
667 </antcall>
668 <antcall target="shutdown-tomcat"/>
669 </target>
670
671 <target name="get-sitename" unless="axis.sitename">
672 <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
673 </target>
674
675 <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri">
676 <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
677 <echo>${axis.sitename}, ${axis.siteuri}</echo>
678 </target>
679 <target name="check-deployment-files" depends="get-sitename">
680 <condition property="deploy.exists">
681 <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
682 </condition>
683 <condition property="undeploy.exists">
684 <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
685 </condition>
686 <echo>${axis.sitename}, ${deploy.exists}, ${undeploy.exists}</echo>
687 </target>
688 <target name="create-deployment-files" depends="get-sitename,check-deployment-files"
689 if="axis.sitename" unless="deploy.exists">
690 <filter token="sitename" value="${axis.sitename}"/>
691 <filter token="siteuri" value="${axis.siteuri}"/>
692 <copy file="${basedir}/resources/soap/site.wsdd.template"
693 tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
694 filtering="true"/>
695 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
696 tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
697 filtering="true"/>
698 <!-- create the java files and compile them -->
699 <copy file="${gsdl3.home}/SOAPServer.java.in"
700 tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
701 filtering="true"/>
702 <javac srcdir="${src.home}"
703 destdir="${build.home}"
704 debug="${compile.debug}"
705 deprecation="${compile.deprecation}"
706 optimize="${compile.optimize}">
707 <classpath refid="compile.classpath"/>
708 <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
709 </javac>
710 <jar destfile="${build.home}/gsdl3.jar">
711 <fileset dir="${build.home}">
712 <include name="org/greenstone/gsdl3/**"/>
713 <exclude name="**/Test.class"/>
714 </fileset>
715 <manifest>
716 <attribute name="Built-By" value="${user.name}" />
717 </manifest>
718 </jar>
719 <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
720 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
721 </target>
722
723
724<!-- ====================== Core targets ============================== -->
725<!-- core targets refer to the core gsdl3 java src -->
726
727 <target name="prepare-core">
728 <!-- just get rid of empty directories-->
729 <cvs command="update -P"/>
730 </target>
731 <target name="configure-core"/>
732 <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
733 description="Update only the Greenstone core" />
734
735 <target name="cvsupdate-core">
736 <cvs command="update -l"/>
737 <cvs command="update -dP bin comms dist-resources docs interfaces lib resources src web winutil"/>
738 </target>
739
740 <target name="clean-core"
741 description="Clean only the Greenstone core">
742 <delete dir="${build.home}"/>
743 </target>
744
745 <target name="compile-core"
746 description="Compile only the Greenstone core">
747 <mkdir dir="${build.home}"/>
748 <javac srcdir="${src.home}"
749 destdir="${build.home}"
750 debug="${compile.debug}"
751 deprecation="${compile.deprecation}"
752 optimize="${compile.optimize}">
753 <classpath>
754 <path refid="compile.classpath"/>
755 </classpath>
756 </javac>
757 <jar destfile="${build.home}/gsdl3.jar">
758 <fileset dir="${build.home}">
759 <include name="org/greenstone/gsdl3/**"/>
760 <exclude name="**/Test.class"/>
761 </fileset>
762 <manifest>
763 <attribute name="Built-By" value="${user.name}" />
764 </manifest>
765 </jar>
766 <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
767 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
768 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
769 <copy file="${build.home}/org/greenstone/gsdl3/LibraryServlet.class"
770 todir="${web.classes}/org/greenstone/gsdl3"/>
771 <jar destfile="${build.home}/phind.jar">
772 <fileset dir="${build.home}">
773 <include name="org/greenstone/applet/phind/**"/>
774 </fileset>
775 <manifest>
776 <attribute name="Built-By" value="${user.name}" />
777 </manifest>
778 </jar>
779 <copy file="${build.home}/phind.jar" todir="${javalib}"/>
780 <copy file="${build.home}/phind.jar" todir="${web.lib}"/>
781 <jar destfile="${build.home}/anttasks.jar">
782 <fileset dir="${build.home}">
783 <include name="org/greenstone/anttasks/**"/>
784 </fileset>
785 <manifest>
786 <attribute name="Built-By" value="${user.name}" />
787 </manifest>
788 </jar>
789 <copy file="${build.home}/anttasks.jar" todir="${javalib}"/>
790 <jar destfile="${build.home}/gsdl3test.jar">
791 <fileset dir="${build.home}">
792 <include name="org/greenstone/gsdl3/**/*Test.class"/>
793 <include name="org/greenstone/testing/**"/>
794 </fileset>
795 <manifest>
796 <attribute name="Built-By" value="${user.name}" />
797 </manifest>
798 </jar>
799 </target>
800
801<!-- ================== Packages targets ================================ -->
802 <!-- these targets refer to the greenstone packages - these need updating
803 less often, so are in separate targets to the core -->
804 <target name="prepare-packages" depends="init,prepare-mgpp,prepare-windows"/>
805
806 <target name="prepare-windows" depends="init" if="current.os.iswindows">
807 <!-- need to download precompiled binaries for mg and mgpp -->
808 </target>
809 <target name="prepare-mgpp" depends="check-cvsroot,init" unless="mgpp.present">
810 <cvs command="checkout -P" package="mgpp" dest="${basedir}/packages/"/>
811 </target>
812
813 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
814 description="Update only the packages"/>
815
816 <target name="cvsupdate-packages">
817 <cvs command="update -dP" dest="${packages.home}"/>
818 </target>
819
820 <target name="configure-packages" description="Configure only the packages.">
821 <echo>
822 Configuring MG
823 </echo>
824 <exec executable="configure" os="${os.linux}"
825 dir="${mg.home}">
826 <arg value="--prefix=${basedir}"/>
827 </exec>
828 <echo>
829 Configuring MGPP
830 </echo>
831 <exec executable="configure" os="${os.linux}"
832 dir="${mgpp.home}">
833 <arg value="--prefix=${basedir}"/>
834 </exec>
835 </target>
836
837 <target name="clean-packages"
838 description="Clean only the packages">
839 <!-- mg : just call the make target -->
840 <exec executable="make" os="${os.linux}"
841 dir="${mg.home}">
842 <arg value="clean"/>
843 </exec>
844 <!-- mgpp -->
845 <exec executable="make" os="${os.linux}"
846 dir="${mg.home}">
847 <arg value="clean"/>
848 </exec>
849 <!-- vishnu : just call the ant target -->
850 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
851 inheritall="false" target="clean"/>
852
853 <!-- gsdl-as : just call the ant target-->
854 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
855 inheritall="false" target="clean"/>
856 </target>
857
858 <target name="clean-windows-c++-packages" depends="init" if="current.os.iswindows"
859 description="Clean only the C/C++ packages">
860 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
861 <arg value="clean"/>
862 </exec>
863 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
864 <arg value="clean"/>
865 </exec>
866 </target>
867
868 <target name="compile-packages"
869 description="Compile only the packages">
870 <echo>Compiling MG</echo>
871 <exec executable="make" os="${os.linux}"
872 dir="${mg.home}">
873 </exec>
874 <exec executable="make" os="${os.linux}"
875 dir="${mg.home}">
876 <arg value="install"/>
877 </exec>
878 <!-- windows: just the java stuff. -->
879 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
880 dir="${mg.home}">
881 <arg value="compile"/>
882 <arg value="javaonly"/>
883 </exec>
884 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
885 dir="${mg.home}">
886 <arg value="install"/>
887 <arg value="javaonly"/>
888 <env key="GSDL3HOME" value="${basedir}"/>
889 </exec>
890
891 <!-- mgpp -->
892 <echo>Compiling MGPP</echo>
893 <exec executable="make" os="${os.linux}"
894 dir="${mgpp.home}">
895 </exec>
896 <exec executable="make" os="${os.linux}"
897 dir="${mgpp.home}">
898 <arg value="install"/>
899 </exec>
900 <!-- windows: just the java stuff. -->
901 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
902 dir="${mgpp.home}">
903 <arg value="compile"/>
904 <arg value="javaonly"/>
905 </exec>
906 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
907 dir="${mgpp.home}">
908 <arg value="install"/>
909 <arg value="javaonly"/>
910 <env key="GSDL3HOME" value="${basedir}"/>
911 </exec>
912
913 <!-- vishnu -->
914 <echo>Compiling Vishnu</echo>
915 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
916 inheritall="false" target="compile"/>
917
918 <!-- gsdl-as -->
919 <echo>Compiling GSDL-AS</echo>
920 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
921 inheritall="false" target="compile"/>
922 </target>
923
924 <target name="compile-windows-c++-packages" depends="init" if="current.os.iswindows"
925 description="Compile only the C/C++ packages">
926 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}"/>
927 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
928 <arg value="install"/>
929 <env key="GSDL3HOME" value="${basedir}"/>
930 </exec>
931 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}"/>
932 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
933 <arg value="install"/>
934 <env key="GSDL3HOME" value="${basedir}"/>
935 </exec>
936 </target>
937
938 <!-- ================== gs2building targets ===============-->
939
940
941 <target name="update-gs2building" if="gsdl2.islocal"
942 depends="init,cvsupdate-gs2building,configure-gs2building,clean-gs2building,compile-gs2building"
943 description="Update only the Greenstone 2 building components"/>
944
945 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init">
946 <cvs command="update -dP" dest="${gli.home}"/>
947 <!-- Note: can't do a -d update here cos it will get all of gsdl
948 also, an update doesn't get new files, so we do a checkout instead. -->
949 <cvs command="co gs2build" dest="${basedir}"/>
950 <!-- rename the .gs2build files - we may have gotten changes to the main
951 gsdl versions - make sure they are set back to the gs2build versions -->
952 <antcall target="rename-gs2build-files"/>
953 </target>
954
955 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
956 <echo>checking out gs2 building stuff</echo>
957 </target>
958
959 <target name="prepare-gs2build" depends="check-cvsroot,init" if="gsdl2.islocal" unless="gs2build.present">
960 <echo>checking out gs2build</echo>
961 <cvs command="checkout -P" package="gs2build"/>
962
963 <!-- rename the .gs2build files -->
964 <antcall target="rename-gs2build-files"/>
965 <antcall target="unzip-windows-packages"/>
966 <antcall target="get-windows-binaries"/>
967 </target>
968
969 <target name="get-windows-binaries" depends="init" if="current.os.iswindows">
970 <cvs command="checkout -P" package="winbin"/>
971 <move todir="${gs2build.home}/bin/windows" failonerror="false">
972 <fileset dir="${basedir}/winbin/bin"/>
973 </move>
974 <delete dir="${basedir}/winbin"/>
975 </target>
976 <target name="unzip-windows-packages" depends="init">
977 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
978 dest="${gs2build.home}/packages/windows/gdbm"/>
979 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
980 dest="${gs2build.home}/packages/windows/crypt"/>
981 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
982 dest="${gs2build.home}/packages/windows/expat"/>
983 </target>
984
985 <target name="rename-gs2build-files" depends="rename-gs2build-files-linux,rename-gs2build-files-windows"/>
986
987 <target name="rename-gs2build-files-windows" if="current.os.iswindows">
988 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
989 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
990 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
991 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat">
992 <filterset>
993 <filter token="gsdlhome" value="${gs2build.home}"/>
994 </filterset>
995 </copy>
996 </target>
997 <target name="rename-gs2build-files-linux" if="current.os.islinux">
998 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
999 <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>
1000 <chmod file="${gs2build.home}/configure" perm="a+x"/>
1001 <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1002 <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/>
1003 <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1004 <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1005 <copy file="${gs2build-extra.home}/packages.Makefile" tofile="${gs2build.home}/packages/Makefile"/>
1006 <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/>
1007
1008 </target>
1009 <target name="prepare-gli" depends="check-cvsroot,init" if="gsdl2.islocal" unless="gli.present">
1010 <echo>checking out gli</echo>
1011 <cvs command="checkout -P" package="gli"/>
1012 </target>
1013
1014 <target name="configure-gs2building" if="gsdl2.islocal"
1015 description="Configure only the Greenstone 2 building components">
1016 <exec executable="${gs2build.home}/configure" os="${os.linux}"
1017 dir="${gs2build.home}">
1018 <arg value="--prefix=${gs2build.home}"/>
1019 </exec>
1020 </target>
1021
1022 <target name="clean-gs2building" depends="init" if="gsdl2.islocal"
1023 description="Clean only the Greenstone 2 building components">
1024 <!-- gli -->
1025 <property name="gli.home" value="${basedir}/gli"/>
1026 <!-- linux -->
1027 <exec executable="clean.sh" os="${os.linux}" dir="${gli.home}"
1028 resolveExecutable="true"/>
1029 <!-- windows -->
1030 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1031 resolveExecutable="true"/>
1032 <!-- gs2build -->
1033 <!--linux: -->
1034 <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
1035 <arg value="clean"/>
1036 </exec>
1037 <!-- windows: -->
1038 </target>
1039
1040 <target name="clean-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1041 description="remove all object files and executables">
1042 <!-- run the setup script -->
1043 <exec executable="${compile.windows.c++.setup}"/>
1044 <exec executable="nmake" dir="${gs2build.home}">
1045 <arg value="/f"/>
1046 <arg value="win32.mak"/>
1047 <arg value="clean"/>
1048 </exec>
1049 </target>
1050
1051 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
1052 description="Compile only the Greenstone 2 building components">
1053 <!-- gli -->
1054 <property name="gli.home" value="${basedir}/gli"/>
1055 <!-- linux -->
1056 <exec executable="makegli.sh" os="${os.linux}" dir="${gli.home}"
1057 resolveExecutable="true"/>
1058 <!-- windows -->
1059 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
1060 resolveExecutable="true"/>
1061 <!-- gs2build -->
1062 <!--linux: make, make install -->
1063 <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
1064 </exec>
1065 <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
1066 <arg value="install"/>
1067 </exec>
1068 </target>
1069 <!-- windows: -->
1070 <target name="compile-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1071 description="Use this if you want to compile the C++ code for the gs2build package">
1072 <!-- run the setup script -->
1073 <exec executable="${compile.windows.c++.setup}"/>
1074 <exec executable="nmake" dir="${gs2build.home}">
1075 <arg value="/f"/>
1076 <arg value="win32.mak"/>
1077 </exec>
1078 </target>
1079 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
1080 <echo>Running GLI from Ant means that you don't get to see any of the terminal output. If you have problems with GLI and want to see the output, please run the script gli4gs3.sh/bat from the gsdl3/gli directory.
1081 </echo>
1082 </target>
1083
1084 <target name="gli-local" depends="init" if="gsdl2.islocal">
1085 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux}" dir="${basedir}/gli" spawn="true">
1086 <env key="GSDLHOME" path="${basedir}/gs2build"/>
1087 <env key="GSDL3HOME" value="${basedir}"/>
1088 </exec>
1089 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1090 <env key="GSDLHOME" value="${basedir}/gs2build"/>
1091 <env key="GSDL3HOME" value="${basedir}"/>
1092 </exec>
1093 </target>
1094
1095 <target name="gli-external" depends="init" unless="gsdl2.islocal">
1096 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.linux}" dir="${gsdl2.installed.path}/gli"/>
1097 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl2.installed.path}/gli"/>
1098 </target>
1099
1100
1101<!-- ======================== TESTING Targets ========================= -->
1102
1103 <target name="test" description="Run the (incomplete) JUnit test suite "
1104 depends="init">
1105 <mkdir dir="${basedir}/test"/>
1106 <junit printsummary="withOutAndErr"
1107 errorproperty="test.failed"
1108 failureproperty="test.failed"
1109 fork="${junit.fork}">
1110 <formatter type="plain"/>
1111 <classpath>
1112 <pathelement location="${build.home}/gsdl3test.jar"/>
1113 <path refid="compile.classpath"/>
1114 </classpath>
1115 <test name="${testcase}" if="testcase"/>
1116 <batchtest todir="${basedir}/test" unless="testcase">
1117 <fileset dir="${build.home}"
1118 includes="**/*Test.class"
1119 />
1120 </batchtest>
1121 </junit>
1122 <echo>
1123 *********************************************
1124 Test output can be found in directory 'test'
1125 *********************************************
1126 </echo>
1127 </target>
1128
1129
1130
1131</project>
1132
1133
Note: See TracBrowser for help on using the repository browser.