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

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

getting there with the build file

  • Property svn:keywords set to Author Date Id Revision
File size: 29.6 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<!-- Configure the custom Ant tasks for the Tomcat Manager application -->
18 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
19 classpath="${basedir}/lib/java/catalina-ant.jar"/>
20 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
21 classpath="${basedir}/lib/java/catalina-ant.jar"/>
22 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
23 classpath="${basedir}/lib/java/catalina-ant.jar"/>
24 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
25 classpath="${basedir}/lib/java/catalina-ant.jar"/>
26 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
27 classpath="${basedir}/lib/java/catalina-ant.jar"/>
28 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
29 classpath="${basedir}/lib/java/catalina-ant.jar"/>
30 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
31 classpath="${basedir}/lib/java/catalina-ant.jar"/>
32 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
33 classpath="${basedir}/lib/java/catalina-ant.jar"/>
34
35
36<!-- ===================== Property Definitions =========================== -->
37
38<!--
39
40 Each of the following properties are used in the build script.
41 Values for these properties are set by the first place they are
42 defined, from the following list:
43
44 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
45
46 * Definitions from a "build.properties" file in the top level
47 source directory of this application.
48
49 * Definitions from a "build.properties" file in the user's
50 home directory.
51
52 * Default definitions in this build.xml file.
53
54 You will note below that property values can be composed based on the
55 contents of previously defined properties. This is a powerful technique
56 that helps you minimize the number of changes required when your development
57 environment is modified. Note that property composition is allowed within
58 "build.properties" files as well as in the "build.xml" script.
59
60-->
61
62 <property file="build.properties"/>
63 <property file="${user.home}/build.properties"/>
64
65 <property name="src.home" value="${basedir}/src/java"/>
66 <property name="build.home" value="${basedir}/build"/>
67 <property name="packages.home" value="${basedir}/packages"/>
68 <property name="javalib" value="${basedir}/lib/java"/>
69 <property name="web.home" value="${basedir}/web"/>
70 <property name="web.lib" value="${web.home}/lib"/>
71 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
72
73 <property name="javadocs" value="${basedir}/docs/javadoc"/>
74
75 <property name="app.name" value="gsdl3"/>
76 <property name="app.path" value="/${app.name}"/>
77 <property name="app.version" value="3.00alpha"/>
78 <property name="catalina.home" value="${basedir}/comms/jakarta/tomcat"/>
79
80 <property name="os.linux" value="Linux"/> <!-- mac??-->
81 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows XP, Windows NT,Windows ME"/> <!-- check this!!!-->
82
83 <!-- ============= Base dirs for each package and component ============ -->
84 <property name="applet.home" value="${src.home}/org/greenstone/applet"/>
85 <property name="gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
86 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
87 <property name="gs2build.home" value="${basedir}/gs2build"/>
88 <property name="gli.home" value="${basedir}/gli"/>
89 <property name="vishnu.home" value="${packages.home}/vishnu"/>
90 <property name="mg.home" value="${packages.home}/mg"/>
91 <property name="mgpp.home" value="${packages.home}/mgpp"/>
92 <property name="gsdl-as.home" value="${packages.home}/gsdl-as"/>
93
94<!-- ==================== Compilation Control Options ==================== -->
95
96<!--
97
98 These properties control option settings on the Javac compiler when it
99 is invoked using the <javac> task.
100
101 compile.debug Should compilation include the debug option?
102
103 compile.deprecation Should compilation include the deprecation option?
104
105 compile.optimize Should compilation include the optimize option?
106
107-->
108
109 <property name="compile.debug" value="true"/>
110 <property name="compile.deprecation" value="true"/>
111 <property name="compile.optimize" value="true"/>
112
113<!--
114
115 Rather than relying on the CLASSPATH environment variable, Ant includes
116 features that makes it easy to dynamically construct the classpath you
117 need for each compilation. The example below constructs the compile
118 classpath to include the servlet.jar file, as well as the other components
119 that Tomcat makes available to web applications automatically, plus anything
120 that you explicitly added.
121
122-->
123
124 <path id="compile.classpath">
125 <!-- Include all jar files in our lib directory -->
126 <fileset dir="${javalib}">
127 <include name="*.jar"/>
128 </fileset>
129
130 <!-- Include all elements that Tomcat exposes to applications -->
131 <pathelement location="${catalina.home}/common/classes"/>
132 <fileset dir="${catalina.home}/common/endorsed">
133 <include name="*.jar"/>
134 </fileset>
135 <fileset dir="${catalina.home}/common/lib">
136 <include name="*.jar"/>
137 </fileset>
138 <pathelement location="${catalina.home}/shared/classes"/>
139 <fileset dir="${catalina.home}/shared/lib">
140 <include name="*.jar"/>
141 </fileset>
142
143 <!-- Include the axis jar files -->
144 <fileset dir="${basedir}/comms/soap/axis/lib">
145 <include name="*.jar"/>
146 </fileset>
147 </path>
148
149<!-- ==================== Primary Targets ============================= -->
150
151
152 <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
153
154 <target name="install" depends="accept-properties,init,prepare,cvsupdate,configure,clean,compile" 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.">
155 </target>
156
157 <target name="all" depends="init,compile"
158 description="Recompile the code?"/>
159
160 <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building"
161 description="Remove all old compiled code. Includes core, packages and gs2building if necessary"/>
162
163 <target name="compile" depends="init,compile-packages,compile-core,compile-gs2building"
164 description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/>
165
166 <target name="update" depends="init,update-packages,update-core,update-gs2building"
167 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."/>
168
169 <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building"
170 description="Do a cvs update for all sources. Doesn't reompile teh code."/>
171 <!-- this is config stuff, that can be done more than once - should be rerun is the build.properties file changes -->
172 <target name="configure" depends="init,configure-tomcat,configure-files,configure-packages,configure-core,configure-gs2building"
173 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."/>
174
175
176<!-- =========== Help targets =================================== -->
177
178 <target name="usage" description="Print a help message">
179 <echo message=" Execute 'ant -projecthelp' for build file help."/>
180 <echo message=" Execute 'ant -help' for Ant help."/>
181 <echo>put the primary targets in here</echo>
182 </target>
183
184 <target name="help" depends="usage" description="Print a help message"/>
185
186 <target name="debug" depends="init" description="Display all the currently used properties">
187 <echoproperties/>
188 </target>
189
190<!-- ====== initialization and setup targets ================== -->
191
192 <target name="accept-properties">
193 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
194tomcat.server=${tomcat.server}
195tomcat.port=${tomcat.port}
196gsdl.path=${gsdl.path} (this is the location of Greenstone 2 if you have it)
197proxy.host=${proxy.host}
198proxy.port=${proxy.port}
199If these are not acceptable, please change them and rerun this target. Continue [y/n]?" />
200 </input>
201 <condition property="do.abort">
202 <equals arg1="n" arg2="${properties.ok}"/>
203 </condition>
204 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
205 </target>
206
207 <!-- this sets up some initial properties -->
208 <target name="init">
209
210 <condition property="java.too.old">
211 <or>
212 <equals arg1="1.1" arg2="${ant.java.version}"/>
213 <equals arg1="1.2" arg2="${ant.java.version}"/>
214 <equals arg1="1.3" arg2="${ant.java.version}"/>
215 </or>
216 </condition>
217 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
218
219 <available file="${basedir}/packages/mgpp/text" property="mgpp.present"/>
220 <available file="${basedir}/comms/jakarta/tomcat" property="tomcat.present"/>
221 <available file="${basedir}/gli" property="gli.present"/>
222 <available file="${basedir}/gs2build" property="gs2build.present"/>
223 <available file="${basedir}/comms/soap/axis" property="axis.present"/>
224 <available file="${basedir}/comms/jakarta/tomcat/webapps/axis" property="axis.installed"/>
225 <condition property="gsdl2.islocal">
226 <or>
227 <not>
228 <isset property="gsdl.path"/>
229 </not>
230 <equals arg1="" arg2="${gsdl.path}"/>
231 </or>
232 </condition>
233
234 <echo>tomcat.port:${tomcat.port}, gli.present:${gli.present} gsdlislocal=${gsdl2.islocal} gs2build.present=${gs2build.present} gsdl.path = ${gsdl.path}</echo>
235 <condition property="proxy.present">
236 <not>
237 <equals arg1="" arg2="${proxy.host}"/>
238 </not>
239 </condition>
240 </target>
241
242 <target name="setup-proxy" depends="init" if="proxy.present">
243 <condition property="ask.user">
244 <or>
245 <equals arg1="" arg2="${proxy.user}"/>
246 <equals arg1="" arg2="${proxy.password}"/>
247 </or>
248 </condition>
249 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}"/>
250 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
251 </target>
252
253 <!-- this is all the do-once things -->
254 <target name="prepare" depends="init,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-collections">
255 </target>
256
257 <target name="prepare-collections">
258 <property name="collect.dir" value="${basedir}/web/sites/localsite/collect"/>
259 <!-- gs3mgdemo -->
260 <unzip src="${collect.dir}/gs3mgdemo/import.zip"
261 dest="${collect.dir}/gs3mgdemo"/>
262 <unzip src="${collect.dir}/gs3mgdemo/archives.zip"
263 dest="${collect.dir}/gs3mgdemo"/>
264 <unzip src="${collect.dir}/gs3mgdemo/index/index.zip"
265 dest="${collect.dir}/gs3mgdemo/index"/>
266 <!-- gs2mgdemo -->
267 <unzip src="${collect.dir}/gs2mgdemo/import.zip"
268 dest="${collect.dir}/gs2mgdemo"/>
269 <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
270 dest="${collect.dir}/gs2mgdemo"/>
271 <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
272 dest="${collect.dir}/gs2mgdemo/index"/>
273 <!-- gs2mgppdemo -->
274 <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
275 dest="${collect.dir}/gs2mgppdemo"/>
276 <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
277 dest="${collect.dir}/gs2mgppdemo"/>
278 <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
279 dest="${collect.dir}/gs2mgppdemo/index"/>
280 <!-- gberg -->
281 <unzip src="${collect.dir}/gberg/index/index.zip"
282 dest="${collect.dir}/gberg/index"/>
283 </target>
284
285
286 <target name="configure-files" depends="init">
287 <filter token="port" value="${tomcat.port}"/>
288 <filter token="hostname" value="${tomcat.server}"/>
289 <filter token="gsdl3home" value="${basedir}"/>
290 <copy file="${basedir}/web/WEB-INF/web.xml.in" tofile="${basedir}/web/WEB-INF/web.xml" filtering="true"/>
291 <copy file="${basedir}/web/sites/localsite/siteConfig.xml.in" tofile="${basedir}/web/sites/localsite/siteConfig.xml" filtering="true"/>
292 <copy file="${basedir}/web/sites/gateway/siteConfig.xml.in" tofile="${basedir}/web/sites/gateway/siteConfig.xml" filtering="true"/>
293 <!--<copy file="${basedir}/resources/java/SOAPServer.cfg.in" tofile="${basedir}/resources/java/SOAPServer.cfg" filtering="true"/>-->
294
295 </target>
296
297 <!-- this target sets up tomcat for teh first time, or resets it any subsequent times -->
298 <target name="prepare-tomcat" depends="init,setup-proxy">
299 <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7.zip"
300 dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
301 usetimestamp="true"/>
302 <delete dir="${basedir}/comms/jakarta/tomcat.bak"/>
303 <move todir="${basedir}/comms/jakarta/tomcat.bak" failonerror="false">
304 <fileset dir="${basedir}/comms/jakarta/tomcat"/>
305 </move>
306 <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
307 dest="${basedir}/comms/jakarta"/>
308 <condition property="need.tomcat.compat">
309 <equals arg1="1.4" arg2="${ant.java.version}"/>
310 </condition>
311 <antcall target="prepare-tomcat-compat"/>
312 <move todir="${basedir}/comms/jakarta/tomcat">
313 <fileset dir="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7"/>
314 </move>
315 <!-- make sure we have execute permission for the .sh files -->
316 <chmod dir="${basedir}/comms/jakarta/tomcat/bin" perm="ugo+rx"
317 includes="*.sh"/>
318 </target>
319
320
321 <target name="prepare-tomcat-compat" if="need.tomcat.compat">
322 <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7-compat.zip"
323 dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
324 usetimestamp="true"/>
325 <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
326 dest="${basedir}/comms/jakarta"/>
327 </target>
328
329 <target name="configure-tomcat" depends="init" if="tomcat.present">
330 <!-- re-setup the server.xml file -->
331 <copy file="${basedir}/comms/jakarta/server.xml.in" tofile="${basedir}/comms/jakarta/tomcat/conf/server.xml" overwrite="true">
332 <filterset>
333 <filter token="port" value="${tomcat.port}"/>
334 <filter token="gsdl3home" value="${basedir}"/>
335 </filterset>
336 </copy>
337 </target>
338
339 <target name="prepare-axis" depends="init">
340 <get src="http://www.greenstone.org/gs3files/axis-1_1.zip"
341 dest="${basedir}/comms/soap/axis-1_1.zip"
342 usetimestamp="true"/>
343 <delete dir="${basedir}/comms/soap/axis.bak"/>
344 <move todir="${basedir}/comms/soap/axis.bak" failonerror="false">
345 <fileset dir="${basedir}/comms/soap/axis"/>
346 </move>
347 <unzip src="${basedir}/comms/soap/axis-1_1.zip"
348 dest="${basedir}/comms/soap/"/>
349 <move todir="${basedir}/comms/soap/axis">
350 <fileset dir="${basedir}/comms/soap/axis-1_1"/>
351 </move>
352 <!-- install the webapp into tomcat -->
353 <copy todir="${basedir}/comms/jakarta/tomcat/webapps/axis">
354 <fileset dir="${basedir}/comms/soap/axis/webapps/axis"/>
355 </copy>
356 </target>
357
358<!-- ====================== Core targets ============================== -->
359<!-- core targets refer to the core gsdl3 java src -->
360
361 <target name="prepare-core"/>
362 <target name="configure-core"/>
363 <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
364 description="Update only the Greenstone core" />
365
366 <target name="cvsupdate-core">
367 <cvs command="update -l"/>
368 <cvs command="update -dP bin comms dist-resources docs interfaces lib resources src web winutil"/>
369 </target>
370
371 <target name="clean-core"
372 description="Clean only the Greenstone core">
373 <delete dir="${applet.home}/phind/classes"/>
374 <delete file="${applet.home}/phind/phind.jar"/>
375 <delete dir="${gsdl3.home}/classes"/>
376 <delete file="${gsdl3.home}/gsdl3.jar"/>
377 </target>
378
379 <target name="compile-core"
380 description="Compile only the Greenstone core">
381 <mkdir dir="${build.home}"/>
382 <javac srcdir="${src.home}"
383 destdir="${build.home}"
384 debug="${compile.debug}"
385 deprecation="${compile.deprecation}"
386 optimize="${compile.optimize}">
387 <classpath>
388 <path refid="compile.classpath"/>
389 <!-- need to add in package jar files to classpath -->
390 <pathelement location="${mg.home}/java/mg.jar"/>
391 <pathelement location="${mgpp.home}/java/mgpp.jar"/>
392 <pathelement location="${vishnu.home}/vishnu.jar"/>
393 </classpath>
394 </javac>
395 <jar destfile="${build.home}/gsdl3.jar">
396 <fileset dir="${build.home}">
397 <include name="org/greenstone/gsdl3/**"/>
398 <exclude name="**/Test.class"/>
399 </fileset>
400 <manifest>
401 <attribute name="Built-By" value="${user.name}" />
402 </manifest>
403 </jar>
404 <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
405 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
406 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
407 <copy file="${build.home}/org/greenstone/gsdl3/LibraryServlet.class"
408 todir="${web.classes}/org/greenstone/gsdl3"/>
409 <jar destfile="${build.home}/phind.jar">
410 <fileset dir="${build.home}">
411 <include name="org/greenstone/applet/phind/**"/>
412 </fileset>
413 <manifest>
414 <attribute name="Built-By" value="${user.name}" />
415 </manifest>
416 </jar>
417 <copy file="${build.home}/phind.jar" todir="${javalib}"/>
418 <copy file="${build.home}/phind.jar" todir="${web.lib}"/>
419 <jar destfile="${build.home}/anttasks.jar">
420 <fileset dir="${build.home}">
421 <include name="org/greenstone/anttasks/**"/>
422 </fileset>
423 <manifest>
424 <attribute name="Built-By" value="${user.name}" />
425 </manifest>
426 </jar>
427 <copy file="${build.home}/anttasks.jar" todir="${javalib}"/>
428 <jar destfile="${build.home}/gsdl3test.jar">
429 <fileset dir="${build.home}">
430 <include name="org/greenstone/gsdl3/**/*Test.class"/>
431 <include name="org/greenstone/testing/**"/>
432 </fileset>
433 <manifest>
434 <attribute name="Built-By" value="${user.name}" />
435 </manifest>
436 </jar>
437 </target>
438
439<!-- ================== Packages targets ================================ -->
440 <!-- these targets refer to the greenstone packages - these need updating
441 less often, so are in separate targets to the core -->
442 <target name="prepare-packages" depends="init,prepare-mgpp"/>
443
444 <target name="prepare-mgpp" depends="init" unless="mgpp.present">
445 <cvs command="checkout -P" package="mgpp" dest="${basedir}/packages/"/>
446 </target>
447
448 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
449 description="Update only the packages"/>
450
451 <target name="cvsupdate-packages">
452 <cvs command="update -dP" dest="${packages.home}"/>
453 </target>
454
455 <target name="configure-packages" description="Configure only the packages.">
456 <echo>
457 Configuring MG
458 </echo>
459 <exec executable="configure" os="Linux"
460 dir="${mg.home}">
461 <arg value="--prefix=${basedir}"/>
462 </exec>
463 <echo>
464 Configuring MGPP
465 </echo>
466 <exec executable="configure" os="Linux"
467 dir="${mgpp.home}">
468 <arg value="--prefix=${basedir}"/>
469 </exec>
470 </target>
471
472 <target name="clean-packages"
473 description="Clean only the packages">
474 <!-- mg -->
475 <exec executable="make" os="Linux"
476 dir="${mg.home}">
477 <arg value="clean"/>
478 </exec>
479 <delete dir="${mg.home}/java/classes"/>
480 <delete file="${mg.home}/java/mg.jar"/>
481 <delete file="${mg.home}/jni/org_greenstone_mg_MGWrapper.h"/>
482 <delete file="${mg.home}/jni/org_greenstone_mg_MGPassesWrapper.h"/>
483 <!-- mgpp -->
484 <exec executable="make" os="Linux"
485 dir="${mg.home}">
486 <arg value="clean"/>
487 </exec>
488 <delete dir="${mgpp.home}/java/classes"/>
489 <delete file="${mgpp.home}/java/mgpp.jar"/>
490 <delete file="${mgpp.home}/jni/org_greenstone_mgpp_MGPPWrapper.h"/>
491 <delete file="${mgpp.home}/jni/org_greenstone_mgpp_MGPPPassesWrapper.h"/>
492 <!-- vishnu -->
493 <delete dir="${vishnu.home}/src/classes"/>
494 <delete file="${vishnu.home}/src/vishnu.jar"/>
495
496 <!-- gsdl-as : just call the ant target-->
497 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
498 inheritall="false" target="clean"/>
499 </target>
500
501 <target name="compile-packages"
502 description="Compile only the packages">
503 <!-- mg -->
504 <echo>Compiling MG</echo>
505 <!-- c code -->
506 <!-- javacode -->
507 <mkdir dir="${mg.home}/java/classes"/>
508 <javac srcdir="${mg.home}/java"
509 destdir="${mg.home}/java/classes"
510 debug="${compile.debug}"
511 deprecation="${compile.deprecation}"
512 optimize="${compile.optimize}">
513 </javac>
514 <javah classpath="${mg.home}/java/classes"
515 destdir="${mg.home}/jni">
516 <class name="org.greenstone.mg.MGWrapper"/>
517 <class name="org.greenstone.mg.MGPassesWrapper"/>
518 </javah>
519 <jar destfile="${mg.home}/java/mg.jar">
520 <fileset dir="${mg.home}/java/classes"/>
521 <manifest>
522 <attribute name="Built-By" value="${user.name}" />
523 </manifest>
524 </jar>
525 <copy file="${mg.home}/java/mg.jar" todir="${javalib}"/>
526 <!-- make the c code -->
527 <exec executable="make" os="Linux"
528 dir="${mg.home}">
529 </exec>
530 <exec executable="make" os="Linux"
531 dir="${mg.home}">
532 <arg value="install"/>
533 </exec>
534
535 <!-- mgpp -->
536 <echo>Compiling MGPP</echo>
537 <!-- javacode -->
538 <mkdir dir="${mgpp.home}/java/classes"/>
539 <javac srcdir="${mgpp.home}/java"
540 destdir="${mgpp.home}/java/classes"
541 debug="${compile.debug}"
542 deprecation="${compile.deprecation}"
543 optimize="${compile.optimize}">
544 </javac>
545 <javah classpath="${mgpp.home}/java/classes"
546 destdir="${mgpp.home}/jni">
547 <class name="org.greenstone.mgpp.MGPPWrapper"/>
548 <class name="org.greenstone.mgpp.MGPPPassesWrapper"/>
549 </javah>
550 <jar destfile="${mgpp.home}/java/mgpp.jar">
551 <fileset dir="${mgpp.home}/java/classes"/>
552 <manifest>
553 <attribute name="Built-By" value="${user.name}" />
554 </manifest>
555 </jar>
556 <copy file="${mgpp.home}/java/mgpp.jar" todir="${javalib}"/>
557 <!-- c++ code -->
558 <exec executable="make" os="Linux"
559 dir="${mgpp.home}">
560 </exec>
561 <exec executable="make" os="Linux"
562 dir="${mg.home}">
563 <arg value="install"/>
564 </exec>
565
566 <!-- vishnu -->
567 <echo>Compiling Vishnu</echo>
568 <mkdir dir="${vishnu.home}/classes"/>
569 <javac srcdir="${vishnu.home}/src"
570 destdir="${vishnu.home}/classes"
571 debug="${compile.debug}"
572 deprecation="${compile.deprecation}"
573 optimize="${compile.optimize}">
574 <classpath>
575 <path refid="compile.classpath"/>
576 <pathelement location="${mg.home}/java/mg.jar"/>
577 </classpath>
578 </javac>
579 <jar destfile="${vishnu.home}/vishnu.jar">
580 <fileset dir="${vishnu.home}/classes"/>
581 <manifest>
582 <attribute name="Built-By" value="${user.name}" />
583 </manifest>
584 </jar>
585 <copy file="${vishnu.home}/vishnu.jar" todir="${javalib}"/>
586 <copy file="${vishnu.home}/vishnu.jar" todir="${web.lib}"/>
587 <mkdir dir="${web.classes}/vishnu/server"/>
588 <copy file="${vishnu.home}/classes/vishnu/server/VisServlet.class"
589 todir="${web.classes}/vishnu/server"/>
590
591 <!-- gsdl-as -->
592 <echo>Compiling GSDL-AS</echo>
593 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
594 inheritall="false" target="compile"/>
595 </target>
596
597<!-- ===================== setup target ===================== -->
598
599
600 <!-- ================== gs2building targets ===============-->
601
602
603 <target name="update-gs2building" if="gsdl2.islocal"
604 depends="init,cvsupdate-gs2building,configure-gs2building,clean-gs2building,compile-gs2building"
605 description="Update only the Greenstone 2 building components"/>
606
607 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init">
608 <cvs command="update -dP" dest="${gli.home}"/>
609 <!-- Note: can't do a -d update here cos it will get all of gsdl-->
610 <cvs command="update -P" dest="${gs2build.home}"/>
611 <!-- rename the .gs2build files - we may have gotten changes to the main
612 gsdl versions - make sure they are set back to the gs2build versions -->
613 <antcall target="rename-gs2build-files"/>
614 </target>
615
616 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
617 <echo>checking out gs2 building stuff</echo>
618 </target>
619
620 <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
621 <echo>checking out gs2build</echo>
622 <cvs command="co -P" package="gs2build"/>
623
624 <!-- rename the .gs2build files -->
625 <antcall target="rename-gs2build-files"/>
626 </target>
627
628 <target name="rename-gs2build-files">
629 <move file="${gs2build.home}/configure.gs2build" tofile="${gs2build.home}/configure"/>
630 <move file="${gs2build.home}/configure.in.gs2build" tofile="${gs2build.home}/configure.in"/>
631 <move file="${gs2build.home}/Makefile.in.gs2build" tofile="${gs2build.home}/Makefile.in"/>
632 <move file="${gs2build.home}/packages/configure.gs2build" tofile="${gs2build.home}/packages/configure"/>
633 <move file="${gs2build.home}/packages/Makefile.gs2build" tofile="${gs2build.home}/packages/Makefile"/>
634 <move file="${gs2build.home}/lib/Makefile.in.gs2build" tofile="${gs2build.home}/lib/Makefile.in"/>
635 </target>
636 <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
637 <echo>checking out gli</echo>
638 <cvs command="co -P" package="gli"/>
639 </target>
640
641 <target name="configure-gs2building" if="gsdl2.islocal"
642 description="Configure only the Greenstone 2 building components">
643 <exec executable="${gs2build.home}/configure" os="${os.linux}"
644 dir="${gs2build.home}">
645 <arg value="--prefix=${gs2build.home}"/>
646 </exec>
647 </target>
648
649 <target name="clean-gs2building" depends="init" if="gsdl2.islocal"
650 description="Clean only the Greenstone 2 building components">
651 <!-- gli -->
652 <property name="gli.home" value="${basedir}/gli"/>
653 <!-- linux -->
654 <exec executable="clean.sh" os="${os.linux}" dir="${gli.home}"
655 resolveExecutable="true"/>
656 <!-- windows -->
657 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
658 resolveExecutable="true"/>
659 <!-- gs2build -->
660 <!--linux: -->
661 <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
662 <arg value="clean"/>
663 </exec>
664 <!-- windows: -->
665 </target>
666
667 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
668 description="Compile only the Greenstone 2 building components">
669 <!-- gli -->
670 <property name="gli.home" value="${basedir}/gli"/>
671 <!-- linux -->
672 <exec executable="makegli.sh" os="${os.linux}" dir="${gli.home}"
673 resolveExecutable="true"/>
674 <!-- windows -->
675 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
676 resolveExecutable="true"/>
677 <!-- gs2build -->
678 <!--linux: make, make install -->
679 <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
680 </exec>
681 <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
682 <arg value="install"/>
683 </exec>
684
685 <!-- windows: -->
686 </target>
687
688
689
690
691
692
693<!-- ============ running targets ========================-->
694 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external"/>
695
696 <target name="gli-local" depends="init" if="gsdl2.islocal">
697 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux}" dir="${basedir}/gli" spawn="true">
698 <env key="GSDLHOME" path="${basedir}/gs2build"/>
699 <env key="GSDL3HOME" value="${basedir}"/>
700 </exec>
701 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
702 <env key="GSDLHOME" value="${basedir}/gs2build"/>
703 <env key="GSDL3HOME" value="${basedir}"/>
704 </exec>
705 </target>
706
707 <target name="gli-external" depends="init" unless="gsdl2.islocal">
708 <exec executable="${gsdl.path}/gli/gli4gs3.sh" os="${os.linux}" dir="${gsdl.path}/gli"/>
709 <exec executable="${gsdl.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl.path}/gli"/>
710 </target>
711
712
713 <target name="reload" description="Reload web application"
714 depends="">
715 <reload url="http://kanuka:7070/manager" username="admin" password="admin"
716 path="/gsdl3"/>
717 </target>
718
719 <target name="launch" description="Launch the Tomcat server" depends="init">
720
721 </target>
722
723
724 <target name="test" description="Run the JUnit test suite (incomplete)"
725 depends="init">
726 <mkdir dir="${basedir}/test"/>
727 <junit printsummary="withOutAndErr"
728 errorproperty="test.failed"
729 failureproperty="test.failed"
730 fork="${junit.fork}">
731 <formatter type="plain"/>
732 <classpath>
733 <pathelement location="${build.home}/gsdl3test.jar"/>
734 <path refid="compile.classpath"/>
735 </classpath>
736 <test name="${testcase}" if="testcase"/>
737 <batchtest todir="${basedir}/test" unless="testcase">
738 <fileset dir="${build.home}"
739 includes="**/*Test.class"
740 />
741 </batchtest>
742 </junit>
743 <echo>
744 *********************************************
745 Test output can be found in directory 'test'
746 *********************************************
747 </echo>
748 </target>
749</project>
750
751
Note: See TracBrowser for help on using the repository browser.