1 | <?xml version="1.0"?>
|
---|
2 | <!-- ======================================================================
|
---|
3 | March 2005
|
---|
4 |
|
---|
5 | Greenstone3 build and install script
|
---|
6 |
|
---|
7 | kjdon
|
---|
8 | ====================================================================== -->
|
---|
9 | <project name="greenstone3" default="usage" basedir=".">
|
---|
10 | <echo>os.name: ${os.name}</echo>
|
---|
11 |
|
---|
12 | <!-- ============ classpath =================== -->
|
---|
13 | <path id="project.classpath">
|
---|
14 | <fileset dir="lib/java">
|
---|
15 | <include name="**/*.jar"/>
|
---|
16 | </fileset>
|
---|
17 | </path>
|
---|
18 |
|
---|
19 | <!-- ============ self defined tasks =================== -->
|
---|
20 | <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpathref="project.classpath"/>
|
---|
21 | <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpathref="project.classpath"/>
|
---|
22 | <taskdef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
|
---|
23 | <!--<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>-->
|
---|
24 | <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
|
---|
25 | <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="project.classpath"/>
|
---|
26 | <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpathref="project.classpath"/>
|
---|
27 |
|
---|
28 |
|
---|
29 | <!-- ===================== Property Definitions =========================== -->
|
---|
30 |
|
---|
31 | <!--
|
---|
32 |
|
---|
33 | Each of the following properties are used in the build script.
|
---|
34 | Values for these properties are set by the first place they are
|
---|
35 | defined, from the following list:
|
---|
36 |
|
---|
37 | * Definitions on the "ant" command line (ant -Dfoo=bar compile).
|
---|
38 |
|
---|
39 | * Definitions from a "build.properties" file in the top level
|
---|
40 | source directory of this application.
|
---|
41 |
|
---|
42 | * Definitions from a "build.properties" file in the user's
|
---|
43 | home directory.
|
---|
44 |
|
---|
45 | * Default definitions in this build.xml file.
|
---|
46 |
|
---|
47 | You will note below that property values can be composed based on the
|
---|
48 | contents of previously defined properties. This is a powerful technique
|
---|
49 | that helps you minimize the number of changes required when your development
|
---|
50 | environment is modified. Note that property composition is allowed within
|
---|
51 | "build.properties" files as well as in the "build.xml" script.
|
---|
52 |
|
---|
53 | -->
|
---|
54 |
|
---|
55 | <!-- create build.properties if it has not been created yet -->
|
---|
56 | <if>
|
---|
57 | <bool><not><available file="build.properties"/></not></bool>
|
---|
58 | <copy file="build.properties.in" tofile="build.properties"/>
|
---|
59 | </if>
|
---|
60 |
|
---|
61 | <!-- create the packages dir if it has not been created yet -->
|
---|
62 | <mkdir dir="packages"/>
|
---|
63 |
|
---|
64 | <!--the first three properties have to be put on the top to be used by build.properties-->
|
---|
65 | <property name="gs2build.home" value="${basedir}${file.separator}gs2build"/>
|
---|
66 | <property name="src.packages.home" value="${basedir}/src/packages"/>
|
---|
67 | <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
|
---|
68 |
|
---|
69 | <property file="build.properties"/>
|
---|
70 | <if><bool><available file="${user.home}/build.properties"/></bool>
|
---|
71 | <property file="${user.home}/build.properties"/>
|
---|
72 | </if>
|
---|
73 |
|
---|
74 | <!-- now we've read in properties, apply defaults -->
|
---|
75 | <property name="disable.collection.building" value="false"/>
|
---|
76 |
|
---|
77 | <!-- get properties from the environment -->
|
---|
78 | <property environment="env"/>
|
---|
79 |
|
---|
80 | <!-- get the filesets defining components and executables -->
|
---|
81 | <import file="resources/xml/components.xml"/>
|
---|
82 | <import file="resources/xml/executables.xml"/>
|
---|
83 |
|
---|
84 | <!-- version properties for external packages -->
|
---|
85 | <!-- for Java versions < 1.4, we print out the message that Java is too old.
|
---|
86 | For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 7.0-->
|
---|
87 | <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-7.0.26">
|
---|
88 | <equals arg1="1.4" arg2="${ant.java.version}"/>
|
---|
89 | </condition>
|
---|
90 | <condition property="tomcat.version.major" value="5" else="7">
|
---|
91 | <equals arg1="1.4" arg2="${ant.java.version}"/>
|
---|
92 | </condition>
|
---|
93 | <condition property="privileged.attribute" value="privileged='true'" else="">
|
---|
94 | <equals arg1="7" arg2="${tomcat.version.major}"/>
|
---|
95 | </condition>
|
---|
96 |
|
---|
97 | <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
|
---|
98 | <property name="axis.dir.version" value="axis-1_4"/>
|
---|
99 | <property name="sqlite.targz.version" value="sqlite-autoconf-3070602.tar.gz"/>
|
---|
100 |
|
---|
101 | <property name="build.home" value="${basedir}/build"/>
|
---|
102 | <property name="src.home" value="${basedir}/src/java"/>
|
---|
103 | <property name="packages.home" value="${basedir}/packages"/>
|
---|
104 | <!-- this may be set in build.properties, eg if you move the web dir to
|
---|
105 | tomcats webapps directory -->
|
---|
106 | <property name="web.home" value="${basedir}/web"/>
|
---|
107 | <!-- jar files needed by applets go here -->
|
---|
108 | <property name="web.applet" value="${web.home}/applet"/>
|
---|
109 |
|
---|
110 | <!-- jar files needed by the servlet (and extra ones) go here -->
|
---|
111 | <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
|
---|
112 | <!-- other files needed by the servlet go here -->
|
---|
113 | <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
|
---|
114 | <!--- flax: the WordNet home -->
|
---|
115 | <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
|
---|
116 |
|
---|
117 | <!-- jni libraries and java wrappers go here -->
|
---|
118 | <property name="lib.jni" value="${basedir}/lib/jni"/>
|
---|
119 |
|
---|
120 | <!-- other jar files needed for installation (but not runtime) go here -->
|
---|
121 | <property name="lib.java" value="${basedir}/lib/java"/>
|
---|
122 |
|
---|
123 | <property name="javadocs" value="${basedir}/docs/javadoc"/>
|
---|
124 |
|
---|
125 | <property name="app.name" value="greenstone3"/>
|
---|
126 | <property name="app.path" value="/${app.name}"/>
|
---|
127 |
|
---|
128 | <property name="admin.dir" value="${basedir}/admin"/>
|
---|
129 |
|
---|
130 | <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
|
---|
131 | <property name="app.version" value="trunk"/>
|
---|
132 | <property name="branch.path" value="trunk"/>
|
---|
133 | <property name="branch.revision" value="HEAD"/>
|
---|
134 |
|
---|
135 | <!--constants -->
|
---|
136 | <property name="svn.root" value="http://svn.greenstone.org"/>
|
---|
137 |
|
---|
138 | <!-- catalina home is set to tomcat basedir if already installed, otherwise
|
---|
139 | use greenstone's tomcat -->
|
---|
140 | <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
|
---|
141 | <and>
|
---|
142 | <isset property="tomcat.installed.path"/>
|
---|
143 | <not>
|
---|
144 | <equals arg1="" arg2="${tomcat.installed.path}"/>
|
---|
145 | </not>
|
---|
146 | </and>
|
---|
147 | </condition>
|
---|
148 |
|
---|
149 | <property name="os.linux" value="Linux"/>
|
---|
150 | <property name="os.mac" value="Mac OS X"/>
|
---|
151 | <property name="os.solaris" value="SunOS"/>
|
---|
152 | <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
|
---|
153 | <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows 2003,Windows XP,Windows NT,Windows ME,Windows Vista,Windows 7"/> <!-- check this!!!-->
|
---|
154 |
|
---|
155 | <!-- this is true for linux and macs -->
|
---|
156 | <condition property="current.os.isunix">
|
---|
157 | <os family="unix"/>
|
---|
158 | </condition>
|
---|
159 |
|
---|
160 | <condition property="current.os.isunixnotmac">
|
---|
161 | <and>
|
---|
162 | <os family="unix"/>
|
---|
163 | <not>
|
---|
164 | <os family="mac"/>
|
---|
165 | </not>
|
---|
166 | </and>
|
---|
167 | </condition>
|
---|
168 |
|
---|
169 | <condition property="current.os.ismac">
|
---|
170 | <os family="mac"/>
|
---|
171 | </condition>
|
---|
172 |
|
---|
173 | <condition property="current.os.iswindows">
|
---|
174 | <os family="windows"/>
|
---|
175 | </condition>
|
---|
176 |
|
---|
177 | <!-- is there a better way to do this?? what about solaris?? -->
|
---|
178 | <condition property="os.bin.dir" value="windows">
|
---|
179 | <os family="windows"/>
|
---|
180 | </condition>
|
---|
181 | <condition property="os.bin.dir" value="darwin">
|
---|
182 | <os family="mac"/>
|
---|
183 | </condition>
|
---|
184 | <condition property="os.bin.dir" value="linux">
|
---|
185 | <and>
|
---|
186 | <os family="unix"/>
|
---|
187 | <not>
|
---|
188 | <os family="mac"/>
|
---|
189 | </not>
|
---|
190 | </and>
|
---|
191 | </condition>
|
---|
192 |
|
---|
193 |
|
---|
194 | <condition property="collection.building.disabled">
|
---|
195 | <and>
|
---|
196 | <isset property="disable.collection.building"/>
|
---|
197 | <istrue value="${disable.collection.building}"/>
|
---|
198 | </and>
|
---|
199 | </condition>
|
---|
200 |
|
---|
201 | <condition property="collection.building.enabled">
|
---|
202 | <not>
|
---|
203 | <istrue value="${disable.collection.building}"/>
|
---|
204 | </not>
|
---|
205 | </condition>
|
---|
206 |
|
---|
207 | <condition property="collection.building.enabled.windows">
|
---|
208 | <and>
|
---|
209 | <istrue value="${collection.building.enabled}"/>
|
---|
210 | <isset property="current.os.iswindows"/>
|
---|
211 | </and>
|
---|
212 | </condition>
|
---|
213 |
|
---|
214 | <condition property="collection.building.enabled.unix">
|
---|
215 | <and>
|
---|
216 | <istrue value="${collection.building.enabled}"/>
|
---|
217 | <isset property="current.os.isunix"/>
|
---|
218 | </and>
|
---|
219 | </condition>
|
---|
220 |
|
---|
221 | <condition property="static.arg" value="LDFLAGS=-static" else=" ">
|
---|
222 | <isset property="compile.static"/>
|
---|
223 | </condition>
|
---|
224 |
|
---|
225 | <!-- If building a release then we want to adjust environment variables so that the support library can be see during compilation -->
|
---|
226 | <if><bool><isset property="use.support.lib"/></bool>
|
---|
227 | <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
|
---|
228 |
|
---|
229 | <if><bool><isset property="env.CFLAGS"/></bool>
|
---|
230 | <property name="cflags.arg" value="CFLAGS="-I${gnome-lib-dir}/include ${env.CFLAGS}""/>
|
---|
231 | <else>
|
---|
232 | <property name="cflags.arg" value="CFLAGS="-I${gnome-lib-dir}/include""/>
|
---|
233 | </else>
|
---|
234 | </if>
|
---|
235 |
|
---|
236 | <if><bool><isset property="env.CPPFLAGS"/></bool>
|
---|
237 | <property name="cppflags.arg" value="CPPFLAGS="-I${gnome-lib-dir}/include ${env.CPPFLAGS}""/>
|
---|
238 | <else>
|
---|
239 | <property name="cppflags.arg" value="CPPFLAGS="-I${gnome-lib-dir}/include""/>
|
---|
240 | </else>
|
---|
241 | </if>
|
---|
242 |
|
---|
243 | <if><bool><isset property="env.CXXFLAGS"/></bool>
|
---|
244 | <property name="cxxflags.arg" value="CXXFLAGS="-I${gnome-lib-dir}/include ${env.CXXFLAGS}""/>
|
---|
245 | <else>
|
---|
246 | <property name="cxxflags.arg" value="CXXFLAGS="-I${gnome-lib-dir}/include""/>
|
---|
247 | </else>
|
---|
248 | </if>
|
---|
249 |
|
---|
250 | <if><bool><isset property="env.LDFLAGS"/></bool>
|
---|
251 | <property name="ldflags.arg" value="LDFLAGS="-L${gnome-lib-dir}/lib ${env.LDFLAGS}""/>
|
---|
252 | <else>
|
---|
253 | <property name="ldflags.arg" value="LDFLAGS="-L${gnome-lib-dir}/lib""/>
|
---|
254 | </else>
|
---|
255 | </if>
|
---|
256 |
|
---|
257 | <if><bool><isset property="env.PATH"/></bool>
|
---|
258 | <property name="path.arg" value="PATH="${gnome-lib-dir}/bin:${env.PATH}""/>
|
---|
259 | <else>
|
---|
260 | <property name="path.arg" value="PATH="${gnome-lib-dir}/bin""/>
|
---|
261 | </else>
|
---|
262 | </if>
|
---|
263 |
|
---|
264 | <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
|
---|
265 | <property name="pcpath.arg" value="PKG_CONFIG_PATH="${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}""/>
|
---|
266 | <else>
|
---|
267 | <property name="pcpath.arg" value="PKG_CONFIG_PATH="${gnome-lib-dir}/lib/pkgconfig""/>
|
---|
268 | </else>
|
---|
269 | </if>
|
---|
270 |
|
---|
271 | <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
|
---|
272 | <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
|
---|
273 | <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH="${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}""/>
|
---|
274 | <else>
|
---|
275 | <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH="${gnome-lib-dir}/lib""/>
|
---|
276 | </else>
|
---|
277 | </if>
|
---|
278 | <else>
|
---|
279 | <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
|
---|
280 | <property name="ldlpath.arg" value="LD_LIBRARY_PATH="${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}""/>
|
---|
281 | <else>
|
---|
282 | <property name="ldlpath.arg" value="LD_LIBRARY_PATH="${gnome-lib-dir}/lib""/>
|
---|
283 | </else>
|
---|
284 | </if>
|
---|
285 | </else>
|
---|
286 | </if>
|
---|
287 |
|
---|
288 | <else>
|
---|
289 | <if><bool><isset property="env.CFLAGS"/></bool>
|
---|
290 | <property name="cflags.arg" value="CFLAGS="${env.CFLAGS}""/>
|
---|
291 | <else>
|
---|
292 | <property name="cflags.arg" value=" "/>
|
---|
293 | </else>
|
---|
294 | </if>
|
---|
295 |
|
---|
296 | <if><bool><isset property="env.CPPFLAGS"/></bool>
|
---|
297 | <property name="cppflags.arg" value="CPPFLAGS="${env.CPPFLAGS}""/>
|
---|
298 | <else>
|
---|
299 | <property name="cppflags.arg" value=" "/>
|
---|
300 | </else>
|
---|
301 | </if>
|
---|
302 |
|
---|
303 | <if><bool><isset property="env.CXXFLAGS"/></bool>
|
---|
304 | <property name="cxxflags.arg" value="CXXFLAGS="${env.CXXFLAGS}""/>
|
---|
305 | <else>
|
---|
306 | <property name="cxxflags.arg" value=" "/>
|
---|
307 | </else>
|
---|
308 | </if>
|
---|
309 |
|
---|
310 | <if><bool><isset property="env.LDFLAGS"/></bool>
|
---|
311 | <property name="ldflags.arg" value="LDFLAGS="${env.LDFLAGS}""/>
|
---|
312 | <else>
|
---|
313 | <property name="ldflags.arg" value=" "/>
|
---|
314 | </else>
|
---|
315 | </if>
|
---|
316 |
|
---|
317 | <if><bool><isset property="env.PATH"/></bool>
|
---|
318 | <property name="path.arg" value="PATH="${env.PATH}""/>
|
---|
319 | <else>
|
---|
320 | <property name="path.arg" value=" "/>
|
---|
321 | </else>
|
---|
322 | </if>
|
---|
323 |
|
---|
324 | <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
|
---|
325 | <property name="pcpath.arg" value="PKG_CONFIG_PATH="${env.PKG_CONFIG_PATH}""/>
|
---|
326 | <else>
|
---|
327 | <property name="pcpath.arg" value=" "/>
|
---|
328 | </else>
|
---|
329 | </if>
|
---|
330 |
|
---|
331 | <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
|
---|
332 | <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
|
---|
333 | <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH="${env.DYLD_LIBRARY_PATH}""/>
|
---|
334 | <else>
|
---|
335 | <property name="ldlpath.arg" value=" "/>
|
---|
336 | </else>
|
---|
337 | </if>
|
---|
338 | <else>
|
---|
339 | <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
|
---|
340 | <property name="ldlpath.arg" value="LD_LIBRARY_PATH="${env.LD_LIBRARY_PATH}""/>
|
---|
341 | <else>
|
---|
342 | <property name="ldlpath.arg" value=" "/>
|
---|
343 | </else>
|
---|
344 | </if>
|
---|
345 | </else>
|
---|
346 | </if>
|
---|
347 | </else>
|
---|
348 | </if>
|
---|
349 | <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
|
---|
350 |
|
---|
351 | <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
|
---|
352 | <istrue value="${with.jni}"/>
|
---|
353 | </condition>
|
---|
354 | <condition property="gs2.compile.target" value="with-jni" else="without-jni">
|
---|
355 | <istrue value="${with.jni}"/>
|
---|
356 | </condition>
|
---|
357 | <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni">
|
---|
358 | <istrue value="${with.jni}"/>
|
---|
359 | </condition>
|
---|
360 | <condition property="gs2.windows.enablejni" value="1" else="0">
|
---|
361 | <istrue value="${with.jni}"/>
|
---|
362 | </condition>
|
---|
363 | <condition property="gs2.windows.enablemg" value="1" else="0">
|
---|
364 | <istrue value="${with.jni}"/>
|
---|
365 | </condition>
|
---|
366 | <condition property="gs2.windows.enablemgpp" value="1" else="0">
|
---|
367 | <istrue value="${with.jni}"/>
|
---|
368 | </condition>
|
---|
369 | <!-- Should accent folding not also be set here ?? -->
|
---|
370 | <condition property="gs2.windows.usegdbm" value="1" else="0">
|
---|
371 | <istrue value="${with.jni}"/>
|
---|
372 | </condition>
|
---|
373 | <condition property="gs2.windows.usesqlite" value="1" else="0">
|
---|
374 | <istrue value="${with.jni}"/>
|
---|
375 | </condition>
|
---|
376 |
|
---|
377 | <!-- where is search4j tool -->
|
---|
378 | <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
|
---|
379 | <isset property="current.os.iswindows"/>
|
---|
380 | </condition>
|
---|
381 |
|
---|
382 |
|
---|
383 | <!-- ============= Base dirs for each package and component ============ -->
|
---|
384 | <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
|
---|
385 | <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
|
---|
386 | <property name="gli.home" value="${basedir}/gli"/>
|
---|
387 | <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
|
---|
388 |
|
---|
389 | <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}${file.separator}common-src">
|
---|
390 | <istrue value="${disable.collection.building}"/>
|
---|
391 | </condition>
|
---|
392 |
|
---|
393 | <property name="build.src.home" value="${gs2build.home}/build-src"/>
|
---|
394 | <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
|
---|
395 | <property name="mg.home" value="${common.src.home}/indexers/mg"/>
|
---|
396 | <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
|
---|
397 | <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
|
---|
398 |
|
---|
399 | <!-- ==================== Compilation Control Options ==================== -->
|
---|
400 |
|
---|
401 | <!--
|
---|
402 |
|
---|
403 | These properties control option settings on the Javac compiler when it
|
---|
404 | is invoked using the <javac> task.
|
---|
405 |
|
---|
406 | compile.debug Should compilation include the debug option?
|
---|
407 |
|
---|
408 | compile.deprecation Should compilation include the deprecation option?
|
---|
409 |
|
---|
410 | compile.optimize Should compilation include the optimize option?
|
---|
411 |
|
---|
412 | -->
|
---|
413 |
|
---|
414 | <property name="compile.debug" value="true"/>
|
---|
415 | <property name="compile.deprecation" value="true"/>
|
---|
416 | <property name="compile.optimize" value="true"/>
|
---|
417 |
|
---|
418 | <!--
|
---|
419 |
|
---|
420 | Rather than relying on the CLASSPATH environment variable, Ant includes
|
---|
421 | features that makes it easy to dynamically construct the classpath you
|
---|
422 | need for each compilation. The example below constructs the compile
|
---|
423 | classpath to include the servlet.jar file, as well as the other components
|
---|
424 | that Tomcat makes available to web applications automatically, plus anything
|
---|
425 | that you explicitly added.
|
---|
426 |
|
---|
427 | -->
|
---|
428 |
|
---|
429 | <!-- All elements that Tomcat 5 exposes to applications -->
|
---|
430 | <path id="tomcat5">
|
---|
431 | <pathelement location="${catalina.home}/common/classes"/>
|
---|
432 | <fileset dir="${catalina.home}/common/endorsed">
|
---|
433 | <include name="*.jar"/>
|
---|
434 | </fileset>
|
---|
435 | <fileset dir="${catalina.home}/common/lib">
|
---|
436 | <include name="*.jar"/>
|
---|
437 | </fileset>
|
---|
438 | <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
|
---|
439 | <pathelement location="${catalina.home}/shared/classes"/>
|
---|
440 | <fileset dir="${catalina.home}/shared/lib">
|
---|
441 | <include name="*.jar"/>
|
---|
442 | </fileset>
|
---|
443 | </path>
|
---|
444 |
|
---|
445 | <!-- All elements that Tomcat 7 exposes to applications -->
|
---|
446 | <path id="tomcat7">
|
---|
447 | <fileset dir="${catalina.home}/lib">
|
---|
448 | <include name="*.jar"/>
|
---|
449 | </fileset>
|
---|
450 | </path>
|
---|
451 |
|
---|
452 | <path id="compile.classpath">
|
---|
453 | <!-- Include all jar files and libraries in our jni lib directory -->
|
---|
454 | <pathelement location="${lib.jni}"/>
|
---|
455 | <fileset dir="${lib.jni}">
|
---|
456 | <include name="*.jar"/>
|
---|
457 | </fileset>
|
---|
458 | <!-- Include all jar files in our web lib directory -->
|
---|
459 | <pathelement location="${web.lib}"/>
|
---|
460 | <fileset dir="${web.lib}">
|
---|
461 | <include name="*.jar"/>
|
---|
462 | </fileset>
|
---|
463 |
|
---|
464 | <pathelement location="${lib.java}"/>
|
---|
465 | <fileset dir="${lib.java}">
|
---|
466 | <include name="*.jar"/>
|
---|
467 | </fileset>
|
---|
468 |
|
---|
469 | <!-- include the jar files from the source packages -->
|
---|
470 | <!-- mg and mgpp get installed into lib/jni but they may not be there yet
|
---|
471 | so we add them in by name -->
|
---|
472 | <!-- *** is there any way to make this optional, based on ${with.jni}? -->
|
---|
473 | <pathelement location="${lib.jni}/mg.jar"/>
|
---|
474 | <pathelement location="${lib.jni}/mgpp.jar"/>
|
---|
475 |
|
---|
476 | <!-- Include all elements that Tomcat exposes to applications -->
|
---|
477 | <path refid="tomcat${tomcat.version.major}"/>
|
---|
478 |
|
---|
479 | </path>
|
---|
480 |
|
---|
481 | <path id="local.tomcat.classpath">
|
---|
482 | <!-- explicitly include the jni java wrappers in the classpath -->
|
---|
483 | <pathelement location="${lib.jni}"/>
|
---|
484 | <fileset dir="${lib.jni}">
|
---|
485 | <include name="*.jar"/>
|
---|
486 | </fileset>
|
---|
487 |
|
---|
488 | <pathelement location="${web.lib}"/>
|
---|
489 | <fileset dir="${web.lib}">
|
---|
490 | <include name="derby.jar"/>
|
---|
491 | </fileset>
|
---|
492 | </path>
|
---|
493 |
|
---|
494 | <path id="local.tomcat.path">
|
---|
495 | <pathelement location="${basedir}/bin/script"/>
|
---|
496 | <pathelement location="${basedir}/bin"/>
|
---|
497 | <pathelement location="${lib.jni}"/>
|
---|
498 | <pathelement path="${env.PATH}"/>
|
---|
499 | <pathelement path="${env.Path}"/>
|
---|
500 | <pathelement path="${wn.home}/bin"/>
|
---|
501 | </path>
|
---|
502 |
|
---|
503 | <target name="test-setup">
|
---|
504 | <echo>ant java version=${ant.java.version}</echo>
|
---|
505 | <echo>is unix : ${current.os.isunix}</echo>
|
---|
506 | <echo>is mac : ${current.os.ismac}</echo>
|
---|
507 | <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
|
---|
508 | <echo>is windows : ${current.os.iswindows}</echo>
|
---|
509 | <echo>os.unix: ${os.unix}</echo>
|
---|
510 | </target>
|
---|
511 |
|
---|
512 | <!-- ==================== Primary and Global Targets ============================= -->
|
---|
513 |
|
---|
514 | <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
|
---|
515 | description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this.">
|
---|
516 |
|
---|
517 | <!-- make sure .sh files are executable -->
|
---|
518 | <chmod dir="${basedir}" perm="ugo+rx"
|
---|
519 | includes="*.sh"/>
|
---|
520 | <chmod dir="${basedir}/bin/script" perm="ugo+rx"
|
---|
521 | includes="*.sh,*.pl"/>
|
---|
522 | </target>
|
---|
523 |
|
---|
524 | <!-- install-common-src and install-collection-building are mutually exclusive and either one or the other will be done depending on whether collection building is enabled or not -->
|
---|
525 | <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
|
---|
526 | description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
|
---|
527 |
|
---|
528 | <target name="install-common-src" depends="init"
|
---|
529 | description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2). " >
|
---|
530 | <antcall target="configure-common-src"/>
|
---|
531 | <antcall target="compile-common-src"/>
|
---|
532 | <antcall target="install-auxiliary-jar-files"/>
|
---|
533 | <antcall target="install-jni-files"/>
|
---|
534 | </target>
|
---|
535 |
|
---|
536 | <target name="install-collection-building" depends="init" if="collection.building.enabled"
|
---|
537 | description="Install (configure, compile, install) the Greenstone 2 collection building package." >
|
---|
538 | <antcall target="configure-collection-building"/>
|
---|
539 | <antcall target="tweak-makefiles" />
|
---|
540 | <antcall target="compile-collection-building"/>
|
---|
541 | </target>
|
---|
542 |
|
---|
543 |
|
---|
544 | <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core,compile-classpath-jars"
|
---|
545 | description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
|
---|
546 |
|
---|
547 | <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
|
---|
548 | description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
|
---|
549 |
|
---|
550 | <target name="configure" depends="init,configure-tomcat,configure-web"
|
---|
551 | description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file, including if you change the port number."/>
|
---|
552 |
|
---|
553 | <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
|
---|
554 | description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
|
---|
555 |
|
---|
556 | <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building,clean-classpath-jars"
|
---|
557 | description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
|
---|
558 |
|
---|
559 | <target name="update" depends="init,svnupdate,clean,install"
|
---|
560 | description="Update (thru Subversion) all the source (including common-src or collection-building, and runtime), then clean, and re-install. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
|
---|
561 |
|
---|
562 |
|
---|
563 | <target name="perl-for-building" depends="init">
|
---|
564 | <!-- uses perl.path if set in build.properties, otherwise try for
|
---|
565 | environment variable PERLPATH, and failing that assumes 'perl'
|
---|
566 | is on environment PATH -->
|
---|
567 | <!-- if, outside build.properties, we only set perl.path if we have gs2build/build-src (collection building), then we won't set perl.path in a (flax) binary, since it doesn't have build-src -->
|
---|
568 | <if><bool><available file="${gs2build.home}"/></bool>
|
---|
569 |
|
---|
570 | <if><bool><not><isset property="perl.path"/></not></bool>
|
---|
571 |
|
---|
572 | <if>
|
---|
573 | <bool>
|
---|
574 | <and>
|
---|
575 | <isset property="env.PERLPATH"/>
|
---|
576 | <not><equals arg1="${env.PERLPATH}" arg2=""/></not>
|
---|
577 | </and>
|
---|
578 | </bool>
|
---|
579 | <property name="perl.path" value="${env.PERLPATH}"/>
|
---|
580 | <else>
|
---|
581 | <echo>
|
---|
582 | Using PATH environment variable to locate Perl.
|
---|
583 | </echo>
|
---|
584 | <exec executable="which" os="${os.unix}" spawn="false" outputproperty="full.perl.path">
|
---|
585 | <arg value="perl" />
|
---|
586 | </exec>
|
---|
587 |
|
---|
588 | <exec executable="${gs2build.home}/bin/windows/which" os="${os.windows}" spawn="false" outputproperty="full.perl.path">
|
---|
589 | <arg value="perl" />
|
---|
590 | </exec>
|
---|
591 |
|
---|
592 | <stringutil string="${full.perl.path}" property="partial.perl.path">
|
---|
593 | <replace regex="\/[^\/]*$" replacement="/" />
|
---|
594 | </stringutil>
|
---|
595 | <stringutil string="${partial.perl.path}" property="perl.path">
|
---|
596 | <replace regex="\\[^\\]*$" replacement="\\" />
|
---|
597 | </stringutil>
|
---|
598 | <if><bool><istrue value="${current.os.isunix}"/></bool>
|
---|
599 |
|
---|
600 | <if><bool><not><equals arg1="${full.perl.path}" arg2="/usr/bin/perl"/></not></bool>
|
---|
601 | <echo>
|
---|
602 | Non-standard location of Perl found: ${full.perl.path}
|
---|
603 | Set the environment variable PERLPATH or the perl.path property in
|
---|
604 | build.properties to explicitly control the version of Perl used.
|
---|
605 | </echo>
|
---|
606 | </if>
|
---|
607 | </if>
|
---|
608 | </else>
|
---|
609 | </if>
|
---|
610 | </if>
|
---|
611 |
|
---|
612 | <!-- full.perl.path is for pretty-printing only, e.g. used in target "start" -->
|
---|
613 | <if><bool><isset property="perl.path"/></bool>
|
---|
614 | <property name="full.perl.path" value="${perl.path}${file.separator}perl"/>
|
---|
615 | <else>
|
---|
616 | <property name="full.perl.path" value="perl (will use the enviroment variable PATH to find this executable)"/>
|
---|
617 | </else>
|
---|
618 | </if>
|
---|
619 |
|
---|
620 | <!-- gs2build not available, perl.path -->
|
---|
621 | <else>
|
---|
622 | <property name="perl.path" value=""/>
|
---|
623 | </else>
|
---|
624 | </if>
|
---|
625 | </target>
|
---|
626 |
|
---|
627 | <target name="get-default-servlet-url">
|
---|
628 | <echo>http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}</echo>
|
---|
629 | </target>
|
---|
630 |
|
---|
631 | <target name="start" depends="init,configure-web,start-tomcat"
|
---|
632 | description="Startup the Tomcat server." >
|
---|
633 | <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
|
---|
634 | <echo>Tomcat: ${catalina.home}</echo>
|
---|
635 | <echo>Java : ${java.home}</echo>
|
---|
636 | <if><bool><available file="${build.src.home}"/></bool>
|
---|
637 | <echo>Perl : ${full.perl.path}</echo>
|
---|
638 | </if>
|
---|
639 | <if><bool><isset property="install.flax"/></bool>
|
---|
640 | <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/flax"/>
|
---|
641 | <else>
|
---|
642 | <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/"/>
|
---|
643 | </else>
|
---|
644 | </if>
|
---|
645 | <echo>URL : ${url}</echo>
|
---|
646 | <!-- assuming that index.html is not needed here -->
|
---|
647 |
|
---|
648 | <!--Now write out the url with oaiserver suffix as the baseURL property in OAIConfig.xml-->
|
---|
649 | <available file="${web.classes}/OAIConfig.xml" property="oaiconfig.present"/>
|
---|
650 | <antcall target="init-oaiconfig">
|
---|
651 | <param name="url" value="${url}"/>
|
---|
652 | </antcall>
|
---|
653 | </target>
|
---|
654 |
|
---|
655 | <target name="init-oaiconfig" if="oaiconfig.present">
|
---|
656 | <echo>Writing out baseURL ${url}oaiserver to ${web.classes}/OAIConfig.xml</echo>
|
---|
657 | <rsr file="${web.classes}/OAIConfig.xml" pattern="<baseURL>.*</baseURL>" replacement="<baseURL>${url}oaiserver</baseURL>" />
|
---|
658 | </target>
|
---|
659 |
|
---|
660 | <target name="stop" depends="init,stop-tomcat"
|
---|
661 | description="Shutdown the Tomcat server."/>
|
---|
662 |
|
---|
663 | <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
|
---|
664 |
|
---|
665 |
|
---|
666 | <!-- =========== Help targets =================================== -->
|
---|
667 |
|
---|
668 | <property name="install-command" value="ant [options] prepare install"/>
|
---|
669 |
|
---|
670 | <target name="usage" description="Print a help message">
|
---|
671 | <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
|
---|
672 | <echo message=" Execute 'ant -help' for Ant help."/>
|
---|
673 | <echo>
|
---|
674 | To install Greenstone3, run '${install-command}'.
|
---|
675 | There are properties defined in build.properties. The install
|
---|
676 | process will ask you if these properties are set correctly.
|
---|
677 | To avoid this prompt, use the '-Dproperties.accepted=yes'
|
---|
678 | option.
|
---|
679 | To log the output, use the '-logfile build.log' option.
|
---|
680 | The README.txt file has more information about the ant targets
|
---|
681 | and install process.
|
---|
682 | </echo>
|
---|
683 | </target>
|
---|
684 |
|
---|
685 | <target name="help" depends="usage" description="Print a help message"/>
|
---|
686 |
|
---|
687 | <target name="debug" depends="init" description="Display all the currently used properties">
|
---|
688 | <echoproperties/>
|
---|
689 | </target>
|
---|
690 |
|
---|
691 | <!-- ====== initialization and setup targets ================== -->
|
---|
692 |
|
---|
693 | <target name="accept-properties" unless="properties.accepted">
|
---|
694 | <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
|
---|
695 | tomcat.server=${tomcat.server}
|
---|
696 | tomcat.port=${tomcat.port}
|
---|
697 | tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
|
---|
698 | proxy.host=${proxy.host}
|
---|
699 | proxy.port=${proxy.port}
|
---|
700 | disable.collection.building=${disable.collection.building}
|
---|
701 | If these are not acceptable, please change them and rerun this target. Continue [y/n]?
|
---|
702 | </input>
|
---|
703 | <condition property="do.abort">
|
---|
704 | <equals arg1="n" arg2="${properties.ok}"/>
|
---|
705 | </condition>
|
---|
706 | <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
|
---|
707 | </target>
|
---|
708 |
|
---|
709 | <!-- this sets up some initial properties -->
|
---|
710 | <target name="init">
|
---|
711 |
|
---|
712 | <!-- has the gs3-setup script been run?? -->
|
---|
713 | <condition property="gs3-setup-not-done">
|
---|
714 | <not>
|
---|
715 | <isset property="env.GSDL3HOME"/>
|
---|
716 | </not>
|
---|
717 | </condition>
|
---|
718 |
|
---|
719 | <!--<fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>-->
|
---|
720 |
|
---|
721 | <condition property="java.too.old">
|
---|
722 | <or>
|
---|
723 | <equals arg1="1.1" arg2="${ant.java.version}"/>
|
---|
724 | <equals arg1="1.2" arg2="${ant.java.version}"/>
|
---|
725 | <equals arg1="1.3" arg2="${ant.java.version}"/>
|
---|
726 | </or>
|
---|
727 | </condition>
|
---|
728 | <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
|
---|
729 |
|
---|
730 | <available file="${basedir}/gli" property="gli.present"/>
|
---|
731 | <available file="${basedir}/common-src" property="common.src.present"/>
|
---|
732 | <available file="${basedir}/gs2build" property="gs2build.present"/>
|
---|
733 |
|
---|
734 | <condition property="tomcat.islocal">
|
---|
735 | <or>
|
---|
736 | <not><isset property="tomcat.installed.path"/></not>
|
---|
737 | <equals arg1="" arg2="${tomcat.installed.path}"/>
|
---|
738 | </or>
|
---|
739 | </condition>
|
---|
740 |
|
---|
741 | <echo>tomcat.port = ${tomcat.port}</echo>
|
---|
742 |
|
---|
743 | <condition property="proxy.present">
|
---|
744 | <and>
|
---|
745 | <isset property="proxy.host"/>
|
---|
746 | <not><equals arg1="" arg2="${proxy.host}"/></not>
|
---|
747 | </and>
|
---|
748 | </condition>
|
---|
749 |
|
---|
750 | <!--
|
---|
751 | the next block checks if the bundled tomcat is present in the 'packages' directory,
|
---|
752 | and checks for the lethal combination of tomcat 7 and java 1.4. Test for
|
---|
753 | tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
|
---|
754 | download, as there is no other surefire way to check tomcat version under java 1.4
|
---|
755 | -->
|
---|
756 | <condition property="packages.tomcat.ispresent" value="true" else="false">
|
---|
757 | <available file="packages/tomcat"/>
|
---|
758 | </condition>
|
---|
759 | <condition property="packages.tomcat.istomcat7" value="true" else="false">
|
---|
760 | <available file="packages/tomcat/tomcat7.txt"/>
|
---|
761 | </condition>
|
---|
762 | <if>
|
---|
763 | <bool>
|
---|
764 | <and>
|
---|
765 | <istrue value="${packages.tomcat.ispresent}"/>
|
---|
766 | <istrue value="${packages.tomcat.istomcat7}"/>
|
---|
767 | <equals arg1="1.4" arg2="${ant.java.version}"/>
|
---|
768 | </and>
|
---|
769 | </bool>
|
---|
770 | <fail>Your Java (version 1.4) is too old to work with the bundled Apache Tomcat (version 6). Please upgrade to Java version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
|
---|
771 | </if>
|
---|
772 |
|
---|
773 | </target>
|
---|
774 |
|
---|
775 | <target name="setup-proxy" depends="init" if="proxy.present">
|
---|
776 | <condition property="ask.user">
|
---|
777 | <or>
|
---|
778 | <equals arg1="" arg2="${proxy.user}"/>
|
---|
779 | <equals arg1="" arg2="${proxy.password}"/>
|
---|
780 | </or>
|
---|
781 | </condition>
|
---|
782 |
|
---|
783 | <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
|
---|
784 | <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
|
---|
785 | </target>
|
---|
786 |
|
---|
787 | <!-- ========== Web app Targets ================================ -->
|
---|
788 |
|
---|
789 | <target name="prepare-web" depends="init">
|
---|
790 | <mkdir dir="${web.home}/applet"/>
|
---|
791 | <mkdir dir="${web.home}/logs"/>
|
---|
792 | <mkdir dir="${web.home}/logs/tmp"/>
|
---|
793 | </target>
|
---|
794 |
|
---|
795 | <!-- if we are using java 1.5+, we need the xalan.jar file in web/WEB-INF/lib, but if we are using java 1.4, we can't have it there.
|
---|
796 | The test for whether we need it assumes we won't be trying to compile GS3 against Java versions less than 1.4. -->
|
---|
797 | <target name="configure-java-version" depends="init"
|
---|
798 | description="Activates or deactivates some jar libraries as needed depending on your java version">
|
---|
799 |
|
---|
800 | <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
|
---|
801 | <condition property="need.xalan.jar">
|
---|
802 | <or>
|
---|
803 | <not><equals arg1="1.4" arg2="${ant.java.version}"/></not>
|
---|
804 | </or>
|
---|
805 | </condition>
|
---|
806 |
|
---|
807 | <!-- if they have xalan.jar but dont need it -->
|
---|
808 | <if>
|
---|
809 | <bool>
|
---|
810 | <and>
|
---|
811 | <isset property="have.xalan.jar"/>
|
---|
812 | <not><isset property="need.xalan.jar"/></not>
|
---|
813 | </and>
|
---|
814 | </bool>
|
---|
815 | <antcall target="deactivate-xalan-jar"/>
|
---|
816 | </if>
|
---|
817 |
|
---|
818 | <!-- if they need xalan.jar but dont have it -->
|
---|
819 | <if>
|
---|
820 | <bool>
|
---|
821 | <and>
|
---|
822 | <not><isset property="have.xalan.jar"/></not>
|
---|
823 | <isset property="need.xalan.jar"/>
|
---|
824 | </and>
|
---|
825 | </bool>
|
---|
826 | <antcall target="activate-xalan-jar"/>
|
---|
827 | </if>
|
---|
828 |
|
---|
829 | </target>
|
---|
830 |
|
---|
831 | <target name="activate-xalan-jar">
|
---|
832 | <echo>activating xalan.jar</echo>
|
---|
833 | <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
|
---|
834 | <if>
|
---|
835 | <bool>
|
---|
836 | <and>
|
---|
837 | <isset property="current.os.ismac"/>
|
---|
838 | <available file="${catalina.home}/common/endorsed" type="dir"/>
|
---|
839 | </and>
|
---|
840 | </bool>
|
---|
841 | <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
|
---|
842 | </if>
|
---|
843 | </target>
|
---|
844 |
|
---|
845 | <target name="deactivate-xalan-jar">
|
---|
846 | <echo>deactivating xalan.jar</echo>
|
---|
847 | <delete file="${web.lib}/xalan.jar"/>
|
---|
848 | <!-- should we be deleting common/endorsed/xalan.jar on mac?? -->
|
---|
849 | </target>
|
---|
850 |
|
---|
851 |
|
---|
852 | <target name="prepare-collections" depends="init"
|
---|
853 | description="Unpack all the collections from their svn zipped versions">
|
---|
854 | <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
|
---|
855 | <property name="index.zip" value="index.zip"/>
|
---|
856 |
|
---|
857 | <echo message="installing collections..."/>
|
---|
858 | <antcall target="gs2mgdemo-install"/>
|
---|
859 | <antcall target="gs2mgppdemo-install"/>
|
---|
860 | <antcall target="gberg-install"/>
|
---|
861 | <antcall target="lucene-jdbm-demo-install"/>
|
---|
862 | </target>
|
---|
863 |
|
---|
864 | <target name="gs2mgdemo-prepare" if="collect.dir">
|
---|
865 | <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
|
---|
866 |
|
---|
867 | <condition property="gs2mgdemo.present">
|
---|
868 | <and>
|
---|
869 | <available file="${gs2mgdemo.dir}/${index.zip}"/>
|
---|
870 | </and>
|
---|
871 | </condition>
|
---|
872 | </target>
|
---|
873 |
|
---|
874 | <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
|
---|
875 | <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
|
---|
876 | <echo>collection gs2mgdemo installed</echo>
|
---|
877 | </target>
|
---|
878 |
|
---|
879 | <target name="gs2mgppdemo-prepare" if="collect.dir">
|
---|
880 | <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
|
---|
881 |
|
---|
882 | <condition property="gs2mgppdemo.present">
|
---|
883 | <and>
|
---|
884 | <available file="${gs2mgppdemo.dir}/${index.zip}"/>
|
---|
885 | </and>
|
---|
886 | </condition>
|
---|
887 | </target>
|
---|
888 |
|
---|
889 | <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
|
---|
890 | <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
|
---|
891 | <echo>collection gs2mgppdemo installed</echo>
|
---|
892 | </target>
|
---|
893 |
|
---|
894 | <target name="gberg-prepare" if="collect.dir">
|
---|
895 | <property name="gberg.dir" value="${collect.dir}/gberg"/>
|
---|
896 | <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
|
---|
897 | </target>
|
---|
898 |
|
---|
899 | <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
|
---|
900 | <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
|
---|
901 | <echo>collection gberg installed</echo>
|
---|
902 | </target>
|
---|
903 |
|
---|
904 | <target name="lucene-jdbm-demo-prepare" if="collect.dir">
|
---|
905 | <property name="lucene-jdbm-demo.dir" value="${collect.dir}/lucene-jdbm-demo"/>
|
---|
906 | <available file="${lucene-jdbm-demo.dir}/${index.zip}" property="lucene-jdbm-demo.present"/>
|
---|
907 | </target>
|
---|
908 |
|
---|
909 | <target name="lucene-jdbm-demo-install" if="lucene-jdbm-demo.present" depends="lucene-jdbm-demo-prepare">
|
---|
910 | <unzip dest="${lucene-jdbm-demo.dir}" src="${lucene-jdbm-demo.dir}/${index.zip}"/>
|
---|
911 | <echo>collection lucene-jdbm-demo installed</echo>
|
---|
912 | </target>
|
---|
913 |
|
---|
914 | <target name="configure-web" depends="init,perl-for-building"
|
---|
915 | description="Configure only the web app config files">
|
---|
916 | <!-- we want a unix path in the global.properties file -->
|
---|
917 | <pathconvert targetos="unix" property="src.gsdl3.home.unix">
|
---|
918 | <path path="${web.home}"/>
|
---|
919 | </pathconvert>
|
---|
920 | <stringutil string="${perl.path}" property="escaped.perl.path">
|
---|
921 | <replace regex="\\" replacement="\\\\" />
|
---|
922 | </stringutil>
|
---|
923 |
|
---|
924 | <filter token="gsdlhome" value="${gs2build.home}"/>
|
---|
925 | <filter token="gsdl3srchome" value="${basedir}"/>
|
---|
926 | <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
|
---|
927 | <filter token="gsdl3version" value="${app.version}"/>
|
---|
928 | <filter token="tomcat.server" value="${tomcat.server}"/>
|
---|
929 | <filter token="tomcat.port" value="${tomcat.port}"/>
|
---|
930 | <filter token="perlpath" value="${escaped.perl.path}"/>
|
---|
931 | <filter token="disable.collection.building" value="${disable.collection.building}"/>
|
---|
932 | <copy file="${basedir}/web/WEB-INF/cgi/gsdl3site.cfg.in" tofile="${basedir}/web/WEB-INF/cgi/gsdl3site.cfg" filtering="true" overwrite="true"/>
|
---|
933 | <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
|
---|
934 | <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
|
---|
935 | <chmod file="${web.classes}/global.properties" perm="600"/>
|
---|
936 | <chmod file="${web.classes}/log4j.properties" perm="600"/>
|
---|
937 | </target>
|
---|
938 |
|
---|
939 | <target name="compile-web" depends="init">
|
---|
940 | <javac srcdir="${web.classes}"
|
---|
941 | destdir="${web.classes}"
|
---|
942 | debug="${compile.debug}"
|
---|
943 | deprecation="${compile.deprecation}"
|
---|
944 | optimize="${compile.optimize}">
|
---|
945 | <classpath><path refid="compile.classpath"/></classpath>
|
---|
946 | </javac>
|
---|
947 | </target>
|
---|
948 |
|
---|
949 | <target name="compile-classpath-jars" depends="init">
|
---|
950 | <if><bool><available file="admin/cp.mf"/></bool>
|
---|
951 | <jar destfile="admin/cp.jar" manifest="admin/cp.mf"/>
|
---|
952 | </if>
|
---|
953 | <if><bool><available file="${lib.java}/cp.mf"/></bool>
|
---|
954 | <jar destfile="${lib.java}/cp.jar" manifest="${lib.java}/cp.mf"/>
|
---|
955 | </if>
|
---|
956 | <if><bool><available file="${lib.jni}/cp.mf"/></bool>
|
---|
957 | <jar destfile="${lib.jni}/cp.jar" manifest="${lib.jni}/cp.mf"/>
|
---|
958 | </if>
|
---|
959 | <if><bool><available file="${web.lib}/cp.mf"/></bool>
|
---|
960 | <jar destfile="${web.lib}/cp.jar" manifest="${web.lib}/cp.mf"/>
|
---|
961 | </if>
|
---|
962 | <jar destfile="cp.jar">
|
---|
963 | <manifest>
|
---|
964 | <attribute name="Class-Path" value="server.jar admin/cp.jar lib/java/cp.jar lib/jni/cp.jar web/WEB-INF/lib/cp.jar"/>
|
---|
965 | </manifest>
|
---|
966 | </jar>
|
---|
967 | </target>
|
---|
968 |
|
---|
969 | <target name="clean-classpath-jars" depends="init">
|
---|
970 | <delete file="admin/cp.jar"/>
|
---|
971 | <delete file="${lib.java}/cp.jar"/>
|
---|
972 | <delete file="${lib.jni}/cp.jar"/>
|
---|
973 | <delete file="${web.lib}/cp.jar"/>
|
---|
974 | <delete file="cp.jar"/>
|
---|
975 | </target>
|
---|
976 |
|
---|
977 |
|
---|
978 | <target name="svnupdate-web" unless="nosvn.mode">
|
---|
979 | <exec executable="svn">
|
---|
980 | <arg value="update"/>
|
---|
981 | <arg value="${web.home}"/>
|
---|
982 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
983 | </exec>
|
---|
984 | </target>
|
---|
985 |
|
---|
986 | <target name="update-web" depends="init,svnupdate-web,configure-web"
|
---|
987 | description="update only the web stuff (config files)"/>
|
---|
988 |
|
---|
989 | <!-- ======================= Tomcat Targets ========================== -->
|
---|
990 |
|
---|
991 | <!-- this target downloads and installs Tomcat -->
|
---|
992 | <!-- we download tomcat (version 7 for Java 1.5 and later, version 5 for Java 1.4 plus the 1.4 compatibility package). -->
|
---|
993 | <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"
|
---|
994 | description="downloads the appropriate version of Tomcat (Tomcat 5 if using Java 1.4, Tomcat 7 if using Java 1.5 or higher). If you want to change which version of Java you are using between 1.4 and 1.5/7 then you need to run prepare-tomcat">
|
---|
995 | <if>
|
---|
996 | <bool>
|
---|
997 | <not><available file="${packages.home}/tomcat/.flagfile"/></not>
|
---|
998 | </bool>
|
---|
999 |
|
---|
1000 | <!-- check that packages dir is there -->
|
---|
1001 | <mkdir dir="${packages.home}"/>
|
---|
1002 | <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
|
---|
1003 | dest="${packages.home}/${tomcat.version}.zip"
|
---|
1004 | usetimestamp="true"/>
|
---|
1005 | <unzip src="${packages.home}/${tomcat.version}.zip"
|
---|
1006 | dest="${packages.home}"/>
|
---|
1007 |
|
---|
1008 | <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
|
---|
1009 | we would need to have the tomcat compat package to work with Java 1.4-->
|
---|
1010 | <if>
|
---|
1011 | <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
|
---|
1012 | <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
|
---|
1013 | dest="${packages.home}/${tomcat.version}-compat.zip"
|
---|
1014 | usetimestamp="true"/>
|
---|
1015 | <unzip src="${packages.home}/${tomcat.version}-compat.zip"
|
---|
1016 | dest="${packages.home}"/>
|
---|
1017 | </if>
|
---|
1018 |
|
---|
1019 | <!-- delete any existing tomcat -->
|
---|
1020 | <delete dir="${packages.home}/tomcat"/>
|
---|
1021 | <move todir="${packages.home}/tomcat">
|
---|
1022 | <fileset dir="${packages.home}/${tomcat.version}"/>
|
---|
1023 | </move>
|
---|
1024 | <!--
|
---|
1025 | <copy file="${basedir}/resources/tomcat/setclasspath.bat"
|
---|
1026 | tofile="${packages.home}/tomcat/bin/setclasspath.bat"
|
---|
1027 | overwrite="true"/>
|
---|
1028 | <copy file="${basedir}/resources/tomcat/setclasspath.sh"
|
---|
1029 | tofile="${packages.home}/tomcat/bin/setclasspath.sh"
|
---|
1030 | overwrite="true"/>
|
---|
1031 | -->
|
---|
1032 | <!-- make sure we have execute permission for the .sh files -->
|
---|
1033 | <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
|
---|
1034 | includes="*.sh"/>
|
---|
1035 |
|
---|
1036 | <echo file="${packages.home}/tomcat/.flagfile">
|
---|
1037 | the timestamp of this file is the time that tomcat was extracted from the zip files.
|
---|
1038 | it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
|
---|
1039 | </echo>
|
---|
1040 |
|
---|
1041 | <!-- this is not strictly a prepare tomcat thing, but if one changes
|
---|
1042 | Java, then they need to change tomcat as well, so might as well call
|
---|
1043 | it here -->
|
---|
1044 | <antcall target="configure-java-version"/>
|
---|
1045 | <else>
|
---|
1046 | <echo>Tomcat has been prepared, will not prepare</echo>
|
---|
1047 | <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
|
---|
1048 | </else>
|
---|
1049 |
|
---|
1050 | </if>
|
---|
1051 |
|
---|
1052 | </target>
|
---|
1053 |
|
---|
1054 | <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
|
---|
1055 |
|
---|
1056 | <target name="configure-tomcat-local" depends="init,perl-for-building" if="tomcat.islocal">
|
---|
1057 | <!-- re-setup the server.xml file -->
|
---|
1058 | <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml"
|
---|
1059 | tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
|
---|
1060 | <filterset>
|
---|
1061 | <filter token="port" value="${tomcat.port}"/>
|
---|
1062 | <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
|
---|
1063 | </filterset>
|
---|
1064 | </copy>
|
---|
1065 | <!-- set up the greenstone3 context -->
|
---|
1066 | <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
|
---|
1067 | <filterset>
|
---|
1068 | <filter token="gsdl3webhome" value="${web.home}"/>
|
---|
1069 | <filter token="privilegedattribute" value ="${privileged.attribute}"/>
|
---|
1070 | </filterset>
|
---|
1071 | </copy>
|
---|
1072 |
|
---|
1073 | <!-- set up the greenstone3 web.xml file -->
|
---|
1074 | <copy file="${basedir}/resources/tomcat/web.xml" tofile="${packages.home}/tomcat/conf/web.xml" overwrite="true">
|
---|
1075 | <filterset>
|
---|
1076 | <filter token="perlpath" value="${perl.path}"/>
|
---|
1077 | </filterset>
|
---|
1078 | </copy>
|
---|
1079 | </target>
|
---|
1080 |
|
---|
1081 | <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
|
---|
1082 | <!-- re-setup the server.xml file -->
|
---|
1083 | <!-- need to edit the config file, or do we get the user to do this???-->
|
---|
1084 | </target>
|
---|
1085 |
|
---|
1086 |
|
---|
1087 | <!-- This target runs tomcat's "bin/catalina.bat(.sh) jpda start"
|
---|
1088 | to allow debugging the running GS3 server in Eclipse. See the instructions at
|
---|
1089 | http://www.wikijava.org/wiki/Debugging_a_servlet_with_tomcat_and_Eclipse_tutorial
|
---|
1090 | on how to use this with eclipse
|
---|
1091 | -->
|
---|
1092 | <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="init" if="tomcat.islocal">
|
---|
1093 | <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
|
---|
1094 | <property name="tomcat.path" refid="local.tomcat.path"/>
|
---|
1095 |
|
---|
1096 | <if><bool>
|
---|
1097 | <isset property="fedora.maxpermsize"/></bool>
|
---|
1098 | <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M ${fedora.maxpermsize}"/>
|
---|
1099 | <else>
|
---|
1100 | <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
|
---|
1101 | </else>
|
---|
1102 | </if>
|
---|
1103 |
|
---|
1104 | <echo file="${catalina.home}/bin/setenv.bat">set CLASSPATH=${tomcat.classpath}</echo>
|
---|
1105 | <echo file="${catalina.home}/bin/setenv.sh">export CLASSPATH=${tomcat.classpath}</echo>
|
---|
1106 |
|
---|
1107 | <exec executable="${catalina.home}/bin/catalina.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
|
---|
1108 | <arg value="jpda" />
|
---|
1109 | <arg value="start" />
|
---|
1110 | <env key="JPDA_ADDRESS" value="8000"/> <!-- for debugging Tomcat in Eclipse -->
|
---|
1111 | <env key="JPDA_TRANSPORT" value="dt_socket"/> <!-- for debugging Tomcat in Eclipse -->
|
---|
1112 | <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
|
---|
1113 | <env key="PATH" path="${tomcat.path}"/>
|
---|
1114 | <env key="CATALINA_OPTS" value="${catalina.opts}"/>
|
---|
1115 | <env key="CATALINA_HOME" value="${catalina.home}"/>
|
---|
1116 | <env key="CLASSPATH" path="${tomcat.classpath}"/>
|
---|
1117 | <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
|
---|
1118 | <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
|
---|
1119 | <env key="WNHOME" path="${wn.home}"/>
|
---|
1120 | <env key="FEDORA_HOME" path="${fedora.home}"/>
|
---|
1121 | </exec>
|
---|
1122 | <exec executable="${catalina.home}/bin/catalina.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
|
---|
1123 | <arg value="jpda" />
|
---|
1124 | <arg value="start" />
|
---|
1125 | <env key="JPDA_ADDRESS" value="8000"/> <!-- for debugging Tomcat in Eclipse -->
|
---|
1126 | <env key="JPDA_TRANSPORT" value="dt_socket"/> <!-- for debugging Tomcat in Eclipse -->
|
---|
1127 | <env key="GSDLOS" value="windows"/>
|
---|
1128 | <env key="GSDL3HOME" value="${basedir}"/>
|
---|
1129 | <env key="Path" path="${tomcat.path}"/>
|
---|
1130 | <env key="PATH" path="${tomcat.path}"/>
|
---|
1131 | <env key="CATALINA_OPTS" value="${catalina.opts}"/>
|
---|
1132 | <env key="CATALINA_HOME" value="${catalina.home}"/>
|
---|
1133 | <env key="CLASSPATH" path="${tomcat.classpath}"/>
|
---|
1134 | <env key="FEDORA_HOME" path="${fedora.home}"/>
|
---|
1135 | </exec>
|
---|
1136 | <!-- wait for the server to startup in case other targets need it running -->
|
---|
1137 | <waitfor maxwait="5" maxwaitunit="second">
|
---|
1138 | <and>
|
---|
1139 | <socket server="${tomcat.server}" port="${tomcat.port}"/>
|
---|
1140 | <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
|
---|
1141 | </and>
|
---|
1142 | </waitfor>
|
---|
1143 | </target>
|
---|
1144 |
|
---|
1145 |
|
---|
1146 | <!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
|
---|
1147 | <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
|
---|
1148 | <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
|
---|
1149 | <property name="tomcat.path" refid="local.tomcat.path"/>
|
---|
1150 |
|
---|
1151 | <if><bool>
|
---|
1152 | <isset property="fedora.maxpermsize"/></bool>
|
---|
1153 | <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M ${fedora.maxpermsize}"/>
|
---|
1154 | <else>
|
---|
1155 | <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
|
---|
1156 | </else>
|
---|
1157 | </if>
|
---|
1158 |
|
---|
1159 | <echo file="${catalina.home}/bin/setenv.bat">set CLASSPATH=${tomcat.classpath}</echo>
|
---|
1160 | <echo file="${catalina.home}/bin/setenv.sh">export CLASSPATH=${tomcat.classpath}</echo>
|
---|
1161 |
|
---|
1162 | <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
|
---|
1163 | <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
|
---|
1164 | <env key="GSDL3HOME" value="${basedir}"/>
|
---|
1165 | <env key="PATH" path="${tomcat.path}"/>
|
---|
1166 | <env key="CATALINA_OPTS" value="${catalina.opts}"/>
|
---|
1167 | <env key="CATALINA_HOME" value="${catalina.home}"/>
|
---|
1168 | <env key="CLASSPATH" path="${tomcat.classpath}"/>
|
---|
1169 | <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
|
---|
1170 | <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
|
---|
1171 | <env key="WNHOME" path="${wn.home}"/>
|
---|
1172 | <env key="FEDORA_HOME" path="${fedora.home}"/>
|
---|
1173 | </exec>
|
---|
1174 | <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
|
---|
1175 | <env key="GSDLOS" value="windows"/>
|
---|
1176 | <env key="GSDL3HOME" value="${basedir}"/>
|
---|
1177 | <env key="Path" path="${tomcat.path}"/>
|
---|
1178 | <env key="PATH" path="${tomcat.path}"/>
|
---|
1179 | <env key="CATALINA_OPTS" value="${catalina.opts}"/>
|
---|
1180 | <env key="CATALINA_HOME" value="${catalina.home}"/>
|
---|
1181 | <env key="CLASSPATH" path="${tomcat.classpath}"/>
|
---|
1182 | <env key="FEDORA_HOME" path="${fedora.home}"/>
|
---|
1183 | </exec>
|
---|
1184 | <!-- wait for the server to startup in case other targets need it running -->
|
---|
1185 | <waitfor maxwait="5" maxwaitunit="second">
|
---|
1186 | <and>
|
---|
1187 | <socket server="${tomcat.server}" port="${tomcat.port}"/>
|
---|
1188 | <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
|
---|
1189 | </and>
|
---|
1190 | </waitfor>
|
---|
1191 | </target>
|
---|
1192 |
|
---|
1193 | <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html-->
|
---|
1194 | <target name="reconfigure" description="Reconfigure the message router">
|
---|
1195 | <waitfor maxwait="5" maxwaitunit="second">
|
---|
1196 | <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&sa=c"/>
|
---|
1197 | </waitfor>
|
---|
1198 | </target>
|
---|
1199 |
|
---|
1200 | <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794-->
|
---|
1201 | <target name="reconfigure-collection" description="Reconfigure the collection">
|
---|
1202 | <waitfor maxwait="5" maxwaitunit="second">
|
---|
1203 | <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&sa=c&sc=${collection}"/>
|
---|
1204 | </waitfor>
|
---|
1205 | </target>
|
---|
1206 |
|
---|
1207 | <!-- windows: do we want to launch a webrowser?? -->
|
---|
1208 | <!-- shouldn't this test whether anything is running first?
|
---|
1209 | It's safer to always attempt to stop tomcat: that way we won't be dependent on the right time
|
---|
1210 | to check whether the server is stopped or still running before attempting to start again.
|
---|
1211 | This target, which was recently called force-stop-tomcat for a while but is back to being
|
---|
1212 | called stop-tomcat, now hides the Java exception output that appears whenever tomcat is already
|
---|
1213 | stopped as happens when stop-tomcat is called consecutively. -->
|
---|
1214 | <target name="force-stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
|
---|
1215 | <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
|
---|
1216 | <env key="FEDORA_HOME" path="${fedora.home}"/>
|
---|
1217 | <env key="CATALINA_HOME" value="${catalina.home}"/>
|
---|
1218 | <arg line=">/dev/null 2>&1"/>
|
---|
1219 | </exec>
|
---|
1220 | <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
|
---|
1221 | <env key="FEDORA_HOME" path="${fedora.home}"/>
|
---|
1222 | <env key="CATALINA_HOME" value="${catalina.home}"/>
|
---|
1223 | <arg line=">nul 2>&1"/>
|
---|
1224 | </exec>
|
---|
1225 | </target>
|
---|
1226 |
|
---|
1227 | <!-- Can also try the "socket" condition in place of the "http" condition
|
---|
1228 | And also use a <waitfor> in place of <condition>, such as:
|
---|
1229 | <waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped"><http url="..."/></waitfor>
|
---|
1230 | The http URL resolves to host:port/greenstone3
|
---|
1231 | Condition uses <http/> rather than <socket/> for testing, since if the server was stopped, the socket
|
---|
1232 | might still be in use for some moments. We test the URL with the http condition since it's likelier to
|
---|
1233 | fail sooner if the server has indeed been stopped. -->
|
---|
1234 | <target name="check-tomcat-running">
|
---|
1235 | <condition property="tomcat.isrunning">
|
---|
1236 | <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/>
|
---|
1237 | </condition>
|
---|
1238 | </target>
|
---|
1239 |
|
---|
1240 | <!-- stop-tomcat checks if the tomcat server is already running. If it appears to be running
|
---|
1241 | (regardless of whether tomcat was just starting to shut down), this target calls force-stop-tomcat
|
---|
1242 | to issue the shutdown command to tomcat. Then it waits for at most 15 seconds for the server to
|
---|
1243 | actually stop by checking the socket at which tomcat listens every second, printing a warning
|
---|
1244 | at the end of the max wait time of 15 seconds if tomcat was still running. -->
|
---|
1245 | <target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning">
|
---|
1246 | <antcall target="force-stop-tomcat"/>
|
---|
1247 |
|
---|
1248 | <property name="wait.numchecks" value="15"/>
|
---|
1249 | <echo>Waiting for the server to shutdown... (${wait.numchecks} seconds max)</echo>
|
---|
1250 | <waitfor maxwait="${wait.numchecks}" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="tomcat.timedout">
|
---|
1251 | <not><socket server="${tomcat.server}" port="${tomcat.port}"/></not>
|
---|
1252 | </waitfor>
|
---|
1253 |
|
---|
1254 | <if>
|
---|
1255 | <bool>
|
---|
1256 | <isset property="${tomcat.timedout}"/>
|
---|
1257 | </bool>
|
---|
1258 | <property name="tomcat.isrunning" value="true"/>
|
---|
1259 | <echo>WARNING: Checked the socket ${wait.numchecks} times, but port ${tomcat.port} is still busy.</echo>
|
---|
1260 | <else>
|
---|
1261 | <echo>Tomcat is stopped.</echo>
|
---|
1262 | <property name="tomcat.isrunning" value="false"/>
|
---|
1263 | </else>
|
---|
1264 | </if>
|
---|
1265 | </target>
|
---|
1266 |
|
---|
1267 | <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
|
---|
1268 |
|
---|
1269 | <target name="setup-catalina-ant-tasks">
|
---|
1270 | <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
|
---|
1271 | <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
|
---|
1272 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1273 | <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
|
---|
1274 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1275 | <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
|
---|
1276 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1277 | <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
|
---|
1278 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1279 | <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
|
---|
1280 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1281 | <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
|
---|
1282 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1283 | <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
|
---|
1284 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1285 | <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
|
---|
1286 | classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
|
---|
1287 | </target>
|
---|
1288 |
|
---|
1289 | <!-- http://blog.andrewbeacock.com/2007/11/how-to-truncate-log-file-using-ubuntu.html
|
---|
1290 | Doing "cat </dev/null > packages/tomcat/logs/catalina.out" doesn't work as an ant target.
|
---|
1291 | It seems to have a problem with cat or </dev/null, with or without the < sign. -->
|
---|
1292 | <target name="clean-logs" description="Empties catalina.out, greenstone.log and contents of web/logs/tmp">
|
---|
1293 | <echo>Truncating catalina.out, greenstone.log and server.log, and emptying ${web.home}/logs/tmp</echo>
|
---|
1294 | <exec executable="rm" os="${os.unix}" dir="${catalina.home}/logs" spawn="false">
|
---|
1295 | <arg value="-f"/>
|
---|
1296 | <arg value="catalina.out"/>
|
---|
1297 | </exec>
|
---|
1298 | <exec executable="rm" os="${os.unix}" dir="${web.home}/logs" spawn="false">
|
---|
1299 | <arg value="-f"/>
|
---|
1300 | <arg value="greenstone.log"/>
|
---|
1301 | </exec>
|
---|
1302 | <exec executable="rm" os="${os.unix}" dir="${web.home}/logs" spawn="false">
|
---|
1303 | <arg value="-f"/>
|
---|
1304 | <arg value="server.log"/>
|
---|
1305 | </exec>
|
---|
1306 |
|
---|
1307 | <exec executable="touch" os="${os.unix}" dir="${catalina.home}/logs"
|
---|
1308 | spawn="false">
|
---|
1309 | <arg value="catalina.out"/>
|
---|
1310 | </exec>
|
---|
1311 | <exec executable="touch" os="${os.unix}" dir="${web.home}/logs"
|
---|
1312 | spawn="false">
|
---|
1313 | <arg value="greenstone.log"/>
|
---|
1314 | </exec>
|
---|
1315 | <exec executable="touch" os="${os.unix}" dir="${web.home}/logs"
|
---|
1316 | spawn="false">
|
---|
1317 | <arg value="server.log"/>
|
---|
1318 | </exec>
|
---|
1319 |
|
---|
1320 | <exec executable="cmd" os="${os.windows}" dir="${catalina.home}/logs" spawn="false">
|
---|
1321 | <arg line="/c echo. > catalina.out"/>
|
---|
1322 | </exec>
|
---|
1323 | <exec executable="cmd" os="${os.windows}" dir="${web.home}/logs" spawn="false">
|
---|
1324 | <arg line="/c echo. > greenstone.log"/>
|
---|
1325 | </exec>
|
---|
1326 | <exec executable="cmd" os="${os.windows}" dir="${web.home}/logs" spawn="false">
|
---|
1327 | <arg line="/c echo. > server.log"/>
|
---|
1328 | </exec>
|
---|
1329 |
|
---|
1330 | <if>
|
---|
1331 | <bool><available file="${web.home}/logs/tmp" type="dir"/></bool>
|
---|
1332 | <delete>
|
---|
1333 | <fileset dir="${web.home}/logs/tmp" includes="**/*"/>
|
---|
1334 | </delete>
|
---|
1335 | </if>
|
---|
1336 | </target>
|
---|
1337 |
|
---|
1338 | <!-- ======================= ant Targets ============================ -->
|
---|
1339 | <target name="prepare-ant" depends="init">
|
---|
1340 | <if>
|
---|
1341 | <bool>
|
---|
1342 | <not><available file="${packages.home}/ant/.flagfile"/></not>
|
---|
1343 | </bool>
|
---|
1344 |
|
---|
1345 | <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
|
---|
1346 | dest="${packages.home}/apache-ant-1.7.0-bin.zip"
|
---|
1347 | usetimestamp="true"/>
|
---|
1348 | <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
|
---|
1349 | dest="${packages.home}"/>
|
---|
1350 | <move todir="${packages.home}/ant">
|
---|
1351 | <fileset dir="${packages.home}/apache-ant-1.7.0"/>
|
---|
1352 | </move>
|
---|
1353 | <echo file="${packages.home}/ant/.flagfile">
|
---|
1354 | the timestamp of this file is the time that ant was extracted from the zip files.
|
---|
1355 | it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
|
---|
1356 | </echo>
|
---|
1357 |
|
---|
1358 | <else>
|
---|
1359 | <echo>Ant has been prepared, will not prepare</echo>
|
---|
1360 | <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
|
---|
1361 | </else>
|
---|
1362 |
|
---|
1363 | </if>
|
---|
1364 | </target>
|
---|
1365 |
|
---|
1366 | <!-- ======================= Admin Targets ============================ -->
|
---|
1367 |
|
---|
1368 | <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.
|
---|
1369 | See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant
|
---|
1370 | But you can do: echo mypassword | ant config-admin -->
|
---|
1371 | <target name="config-admin" description="Reset admin password">
|
---|
1372 | <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):>">
|
---|
1373 | <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
|
---|
1374 | </input>
|
---|
1375 | <!--<echo>PWD: ${admin.password}</echo>-->
|
---|
1376 | <antcall target="update-userdb">
|
---|
1377 | <param name="user.username" value="admin"/>
|
---|
1378 | <param name="user.password" value="${admin.password}"/>
|
---|
1379 | <param name="user.groups" value=""/>
|
---|
1380 | <param name="user.status" value=""/>
|
---|
1381 | <param name="user.comment" value="Password updated."/>
|
---|
1382 | <param name="user.email" value=""/>
|
---|
1383 | </antcall>
|
---|
1384 | </target>
|
---|
1385 |
|
---|
1386 | <target name="config-user" description="Add or modify users" depends="get-user-data,update-userdb"/>
|
---|
1387 |
|
---|
1388 | <target name="get-user-data" description="Get user details">
|
---|
1389 | <input addproperty="user.username" message="Username:>"/>
|
---|
1390 | <input addproperty="user.password" defaultvalue="" message="Password (3-8 characters):>">
|
---|
1391 | <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
|
---|
1392 | </input>
|
---|
1393 | <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list):>"/>
|
---|
1394 | <input addproperty="user.status" defaultvalue="true" message="Enabled (true/false):>"/>
|
---|
1395 | <input addproperty="user.comment" defaultvalue="" message="Comment:>"/>
|
---|
1396 | <input addproperty="user.email" defaultvalue="" message="Email:>"/>
|
---|
1397 | </target>
|
---|
1398 |
|
---|
1399 | <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.
|
---|
1400 | See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant
|
---|
1401 | But you can do: echo mypassword | ant config-admin -->
|
---|
1402 | <target name="update-userdb" description="Add or modify users" depends="check-tomcat-running">
|
---|
1403 |
|
---|
1404 | <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time
|
---|
1405 | See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
|
---|
1406 | The ${tomcat.isrunning} property is set by the depends-target "check-tomcat-running" -->
|
---|
1407 | <if>
|
---|
1408 | <bool>
|
---|
1409 | <istrue value="${tomcat.isrunning}"/>
|
---|
1410 | </bool>
|
---|
1411 | <antcall target="stop-tomcat"/>
|
---|
1412 | </if>
|
---|
1413 |
|
---|
1414 | <!--<echo>${admin.password}</echo>--> <!-- for testing -->
|
---|
1415 | <java classname="org.greenstone.gsdl3.util.ModifyUsersDB">
|
---|
1416 | <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files-->
|
---|
1417 | <arg file="${web.home}/sites/localsite/etc/usersDB"/>
|
---|
1418 | <arg value="${user.username}"/>
|
---|
1419 | <arg value="password=${user.password}"/>
|
---|
1420 | <arg value="groups=${user.groups}"/>
|
---|
1421 | <arg value="status=${user.status}"/>
|
---|
1422 | <arg value="comment=${user.comment}"/>
|
---|
1423 | <arg value="email=${user.email}"/>
|
---|
1424 | </java>
|
---|
1425 |
|
---|
1426 | <!-- run tomcat again if it used to be running -->
|
---|
1427 | <if>
|
---|
1428 | <bool>
|
---|
1429 | <istrue value="${tomcat.isrunning}"/>
|
---|
1430 | </bool>
|
---|
1431 | <antcall target="start-tomcat"/>
|
---|
1432 | </if>
|
---|
1433 | </target>
|
---|
1434 |
|
---|
1435 |
|
---|
1436 | <!-- ======================= Axis Targets ============================ -->
|
---|
1437 |
|
---|
1438 | <target name="prepare-axis" depends="init">
|
---|
1439 |
|
---|
1440 | <if>
|
---|
1441 | <bool>
|
---|
1442 | <not><available file="${packages.home}/axis/.flagfile"/></not>
|
---|
1443 | </bool>
|
---|
1444 |
|
---|
1445 | <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
|
---|
1446 | dest="${packages.home}/${axis.zip.version}"
|
---|
1447 | usetimestamp="true"/>
|
---|
1448 | <unzip src="${packages.home}/${axis.zip.version}"
|
---|
1449 | dest="${packages.home}"/>
|
---|
1450 | <move todir="${packages.home}/axis">
|
---|
1451 | <fileset dir="${packages.home}/${axis.dir.version}"/>
|
---|
1452 | </move>
|
---|
1453 | <!-- install axis into greenstone web app -->
|
---|
1454 | <copy todir="${web.lib}">
|
---|
1455 | <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
|
---|
1456 | <include name="*.jar"/>
|
---|
1457 | </fileset>
|
---|
1458 | </copy>
|
---|
1459 | <copy todir="${web.home}">
|
---|
1460 | <fileset dir="${packages.home}/axis/webapps/axis/">
|
---|
1461 | <include name="*.jsp"/>
|
---|
1462 | <include name="*.jws"/>
|
---|
1463 | </fileset>
|
---|
1464 | </copy>
|
---|
1465 | <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
|
---|
1466 | <copy todir="${web.classes}">
|
---|
1467 | <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
|
---|
1468 | <include name="*.properties"/>
|
---|
1469 | </fileset>
|
---|
1470 | </copy>
|
---|
1471 | <echo file="${packages.home}/axis/.flagfile">
|
---|
1472 | the timestamp of this file is the time that axis was extracted from the zip files.
|
---|
1473 | it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
|
---|
1474 | </echo>
|
---|
1475 |
|
---|
1476 | <else>
|
---|
1477 | <echo>Axis has been prepared, will not prepare</echo>
|
---|
1478 | <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
|
---|
1479 | </else>
|
---|
1480 |
|
---|
1481 | </if>
|
---|
1482 | </target>
|
---|
1483 |
|
---|
1484 | <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
|
---|
1485 | description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
|
---|
1486 |
|
---|
1487 | <target name="deploy-site">
|
---|
1488 | <java classname="org.apache.axis.client.AdminClient">
|
---|
1489 | <classpath refid="compile.classpath"/>
|
---|
1490 | <arg value="-l"/>
|
---|
1491 | <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
|
---|
1492 | <arg file="${basedir}/resources/soap/deploy.wsdd"/>
|
---|
1493 | </java>
|
---|
1494 | <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
|
---|
1495 | </target>
|
---|
1496 |
|
---|
1497 | <target name="soap-undeploy-site" depends="get-undeploy-service-name"
|
---|
1498 | description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
|
---|
1499 | <filter token="servicesname" value="${axis.undeploy.servicename}"/>
|
---|
1500 | <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
|
---|
1501 | tofile="${basedir}/resources/soap/undeploy.wsdd"
|
---|
1502 | filtering="true"
|
---|
1503 | overwrite="true"/>
|
---|
1504 | <java classname="org.apache.axis.client.AdminClient">
|
---|
1505 | <classpath refid="compile.classpath"/>
|
---|
1506 | <arg value="-l"/>
|
---|
1507 | <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
|
---|
1508 | <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
|
---|
1509 | </java>
|
---|
1510 | <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
|
---|
1511 | </target>
|
---|
1512 |
|
---|
1513 | <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
|
---|
1514 | with the default servicename of localsite-->
|
---|
1515 | <target name="deploy-localsite" depends="init"
|
---|
1516 | description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
|
---|
1517 | <antcall target="start-tomcat"/>
|
---|
1518 | <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
|
---|
1519 | <antcall target="create-deployment-files">
|
---|
1520 | <param name="axis.sitename" value="localsite"/>
|
---|
1521 | <param name="axis.servicesname" value="${base.webservice.name}"/>
|
---|
1522 | <param name="axis.siteuri" value="localsite"/>
|
---|
1523 | </antcall>
|
---|
1524 | <antcall target="deploy-site">
|
---|
1525 | <param name="axis.sitename" value="localsite"/>
|
---|
1526 | <param name="axis.servicesname" value="${base.webservice.name}"/>
|
---|
1527 | <param name="axis.siteuri" value="localsite"/>
|
---|
1528 | </antcall>
|
---|
1529 | <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
|
---|
1530 | </target>
|
---|
1531 |
|
---|
1532 | <target name="get-sitename" unless="axis.sitename">
|
---|
1533 | <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
|
---|
1534 | Press Enter for default:localsite</input>
|
---|
1535 | </target>
|
---|
1536 |
|
---|
1537 | <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
|
---|
1538 | <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
|
---|
1539 | To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
|
---|
1540 | Or press Enter for undeploying the default:localsite /></input>
|
---|
1541 | <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
|
---|
1542 | </target>
|
---|
1543 |
|
---|
1544 | <target name="get-webservices" unless="axis.servicesname">
|
---|
1545 | <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
|
---|
1546 | Choose from: ${web.services.list}
|
---|
1547 | Or press Enter for default:${base.webservice.name} /></input>
|
---|
1548 | <echo>${axis.servicesname}</echo>
|
---|
1549 | </target>
|
---|
1550 |
|
---|
1551 | <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
|
---|
1552 | <input addproperty="axis.siteuri" defaultvalue="${axis.servicesname}${axis.sitename}">What name do you want the service to have? (Press Enter for default:${axis.servicesname}${axis.sitename})</input>
|
---|
1553 | <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
|
---|
1554 | </target>
|
---|
1555 |
|
---|
1556 | <target name="set-soapmethod" description="Determines whether the service in the wsdd should have the style attribute set to message or the provider attribute set to java:RPC" if="axis.servicesname">
|
---|
1557 | <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
|
---|
1558 | <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
|
---|
1559 | </condition>
|
---|
1560 |
|
---|
1561 | <!--everything else defaults to java:RPC at present-->
|
---|
1562 | <condition property="soap.method" value="provider='java:RPC'">
|
---|
1563 | <not>
|
---|
1564 | <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
|
---|
1565 | </not>
|
---|
1566 | </condition>
|
---|
1567 | </target>
|
---|
1568 |
|
---|
1569 | <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
|
---|
1570 | <filter token="sitename" value="${axis.sitename}"/>
|
---|
1571 | <filter token="siteuri" value="${axis.siteuri}"/>
|
---|
1572 | <filter token="servicesname" value="${axis.servicesname}"/>
|
---|
1573 | <filter token="soapmethod" value="${soap.method}"/>
|
---|
1574 | <copy file="${basedir}/resources/soap/site.wsdd.template"
|
---|
1575 | tofile="${basedir}/resources/soap/deploy.wsdd"
|
---|
1576 | filtering="true"
|
---|
1577 | overwrite="true"/>
|
---|
1578 | <!-- create the java files and compile them -->
|
---|
1579 | <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
|
---|
1580 | tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
|
---|
1581 | filtering="true"
|
---|
1582 | overwrite="true"/>
|
---|
1583 | <mkdir dir="${build.home}"/>
|
---|
1584 | <javac srcdir="${src.home}"
|
---|
1585 | destdir="${build.home}"
|
---|
1586 | debug="${compile.debug}"
|
---|
1587 | deprecation="${compile.deprecation}"
|
---|
1588 | optimize="${compile.optimize}">
|
---|
1589 | <classpath refid="compile.classpath"/>
|
---|
1590 | <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
|
---|
1591 | </javac>
|
---|
1592 | <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
|
---|
1593 | <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
|
---|
1594 | tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
|
---|
1595 | overwrite="true" />
|
---|
1596 | </target>
|
---|
1597 |
|
---|
1598 |
|
---|
1599 | <!-- ====================== Core targets ============================== -->
|
---|
1600 | <!-- core targets refer to the core gsdl3 java src -->
|
---|
1601 |
|
---|
1602 | <target name="prepare-core"/>
|
---|
1603 |
|
---|
1604 | <target name="configure-core"/>
|
---|
1605 |
|
---|
1606 | <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
|
---|
1607 | description="Update only the Greenstone core" />
|
---|
1608 |
|
---|
1609 | <target name="svnupdate-core" unless="nosvn.mode">
|
---|
1610 | <exec executable="svn">
|
---|
1611 | <arg value="update"/>
|
---|
1612 | <arg value="${basedir}"/>
|
---|
1613 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
1614 | </exec>
|
---|
1615 | </target>
|
---|
1616 |
|
---|
1617 | <target name="clean-core"
|
---|
1618 | description="Clean only the Greenstone core">
|
---|
1619 | <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
|
---|
1620 | <delete dir="${build.home}"/>
|
---|
1621 | </target>
|
---|
1622 |
|
---|
1623 | <target name="compile-core" depends="init"
|
---|
1624 | description="Compile only the Greenstone core">
|
---|
1625 | <mkdir dir="${build.home}"/>
|
---|
1626 |
|
---|
1627 | <if><bool><isset property="with.jni"/></bool>
|
---|
1628 | <javac srcdir="${src.home}"
|
---|
1629 | destdir="${build.home}"
|
---|
1630 | debug="${compile.debug}"
|
---|
1631 | deprecation="${compile.deprecation}"
|
---|
1632 | optimize="${compile.optimize}">
|
---|
1633 | <classpath>
|
---|
1634 | <path refid="compile.classpath"/>
|
---|
1635 | </classpath>
|
---|
1636 | </javac>
|
---|
1637 | <else>
|
---|
1638 | <property name="gsprefix" value=""/>
|
---|
1639 | <javac srcdir="${src.home}"
|
---|
1640 | destdir="${build.home}"
|
---|
1641 | debug="${compile.debug}"
|
---|
1642 | deprecation="${compile.deprecation}"
|
---|
1643 | optimize="${compile.optimize}">
|
---|
1644 | <classpath>
|
---|
1645 | <path refid="compile.classpath"/>
|
---|
1646 | </classpath>
|
---|
1647 | <exclude name="org/greenstone/gsdl3/service/GS2MGPPRetrieve.java"/>
|
---|
1648 | <exclude name="org/greenstone/gsdl3/service/GS2MGPPSearch.java"/>
|
---|
1649 | <exclude name="org/greenstone/gsdl3/service/GS2MGSearch.java"/>
|
---|
1650 | <exclude name="org/greenstone/gsdl3/service/GS2MGRetrieve.java"/>
|
---|
1651 | <exclude name="org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java"/>
|
---|
1652 | <exclude name="org/greenstone/gsdl3/service/PhindPhraseBrowse.java"/>
|
---|
1653 | <exclude name="org/greenstone/gsdl3/util/GDBMWrapper.java"/>
|
---|
1654 | </javac>
|
---|
1655 | </else>
|
---|
1656 | </if>
|
---|
1657 | <jar destfile="${build.home}/gsdl3.jar">
|
---|
1658 | <fileset dir="${build.home}">
|
---|
1659 | <include name="org/greenstone/gsdl3/**"/>
|
---|
1660 | <include name="org/flax/**"/>
|
---|
1661 | <exclude name="**/Test.class"/>
|
---|
1662 | </fileset>
|
---|
1663 | <manifest>
|
---|
1664 | <attribute name="Built-By" value="${user.name}" />
|
---|
1665 | </manifest>
|
---|
1666 | </jar>
|
---|
1667 | <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
|
---|
1668 |
|
---|
1669 | <jar destfile="${build.home}/gutil.jar">
|
---|
1670 | <fileset dir="${build.home}">
|
---|
1671 | <include name="org/greenstone/util/**"/>
|
---|
1672 | </fileset>
|
---|
1673 | <manifest>
|
---|
1674 | <attribute name="Built-By" value="${user.name}" />
|
---|
1675 | </manifest>
|
---|
1676 | </jar>
|
---|
1677 | <copy file="${build.home}/gutil.jar" todir="${web.lib}"/>
|
---|
1678 |
|
---|
1679 | <!-- copy the localsite server in case we need it -->
|
---|
1680 | <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
|
---|
1681 |
|
---|
1682 | <!-- Greenstone Administrator Interface -->
|
---|
1683 | <jar destfile="${build.home}/GAI.jar">
|
---|
1684 | <fileset dir="${build.home}">
|
---|
1685 | <include name="org/greenstone/admin/**"/>
|
---|
1686 | </fileset>
|
---|
1687 | <manifest>
|
---|
1688 | <attribute name="Built-By" value="${user.name}" />
|
---|
1689 | </manifest>
|
---|
1690 | </jar>
|
---|
1691 | <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
|
---|
1692 | <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
|
---|
1693 | <jar destfile="${build.home}/phind.jar">
|
---|
1694 | <fileset dir="${build.home}">
|
---|
1695 | <include name="org/greenstone/applet/phind/**"/>
|
---|
1696 | </fileset>
|
---|
1697 | <manifest>
|
---|
1698 | <attribute name="Built-By" value="${user.name}" />
|
---|
1699 | </manifest>
|
---|
1700 | </jar>
|
---|
1701 | <mkdir dir="${web.applet}"/>
|
---|
1702 | <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
|
---|
1703 | <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
|
---|
1704 | <if>
|
---|
1705 | <bool><istrue value="${tomcat.islocal}"/></bool>
|
---|
1706 | <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
|
---|
1707 | <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
|
---|
1708 | </if>
|
---|
1709 |
|
---|
1710 |
|
---|
1711 | <!-- skip anttasks for now
|
---|
1712 | <jar destfile="${build.home}/anttasks.jar">
|
---|
1713 | <fileset dir="${build.home}">
|
---|
1714 | <include name="org/greenstone/anttasks/**"/>
|
---|
1715 | </fileset>
|
---|
1716 | <manifest>
|
---|
1717 | <attribute name="Built-By" value="${user.name}" />
|
---|
1718 | </manifest>
|
---|
1719 | </jar>
|
---|
1720 | <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
|
---|
1721 | <jar destfile="${build.home}/gsdl3test.jar">
|
---|
1722 | <fileset dir="${build.home}">
|
---|
1723 | <include name="org/greenstone/gsdl3/**/*Test.class"/>
|
---|
1724 | <include name="org/greenstone/testing/**"/>
|
---|
1725 | </fileset>
|
---|
1726 | <manifest>
|
---|
1727 | <attribute name="Built-By" value="${user.name}" />
|
---|
1728 | </manifest>
|
---|
1729 | </jar>
|
---|
1730 | <jar destfile="${build.home}/server.jar">
|
---|
1731 | <fileset dir="${build.home}">
|
---|
1732 | <include name="org/greenstone/server/**"/>
|
---|
1733 | <include name="org/greenstone/util/**"/>
|
---|
1734 | </fileset>
|
---|
1735 | <fileset file="${basedir}/resources/java/server.properties"/>
|
---|
1736 | <manifest>
|
---|
1737 | <attribute name="Built-By" value="${user.name}"/>
|
---|
1738 | </manifest>
|
---|
1739 | </jar>
|
---|
1740 | <copy file="${build.home}/server.jar" todir="${basedir}"/>
|
---|
1741 | </target>
|
---|
1742 |
|
---|
1743 | <!-- ================== Packages targets ================================ -->
|
---|
1744 | <!-- these targets refer to the greenstone source packages - these need
|
---|
1745 | updating less often, so are in separate targets to the core -->
|
---|
1746 | <target name="prepare-packages" depends="init"/>
|
---|
1747 |
|
---|
1748 | <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
|
---|
1749 | description="Update only the source packages"/>
|
---|
1750 |
|
---|
1751 | <target name="svnupdate-packages" unless="nosvn.mode">
|
---|
1752 | <exec executable="svn">
|
---|
1753 | <arg value="update"/>
|
---|
1754 | <arg value="${src.packages.home}"/>
|
---|
1755 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
1756 | </exec>
|
---|
1757 | </target>
|
---|
1758 |
|
---|
1759 |
|
---|
1760 | <target name="configure-packages" depends="init,configure-javagdbm"
|
---|
1761 | description="Configure only the packages."/>
|
---|
1762 |
|
---|
1763 | <target name="configure-javagdbm" if="with.jni">
|
---|
1764 | <echo>
|
---|
1765 | Configuring JavaGDBM
|
---|
1766 | </echo>
|
---|
1767 |
|
---|
1768 | <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
|
---|
1769 | <arg value="--prefix=${basedir}"/>
|
---|
1770 | <arg value="--libdir=${lib.jni}"/>
|
---|
1771 | <arg value="--with-gdbm=${gdbm.home}"/>
|
---|
1772 | </exec>
|
---|
1773 | </target>
|
---|
1774 |
|
---|
1775 | <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
|
---|
1776 |
|
---|
1777 | <target name="clean-javagdbm" depends="init">
|
---|
1778 | <if><bool><available file="${javagdbm.home}/Makefile"/></bool>
|
---|
1779 | <exec executable="make" os="${os.unix}"
|
---|
1780 | dir="${javagdbm.home}" failonerror="true">
|
---|
1781 | <arg value="clean"/>
|
---|
1782 | </exec>
|
---|
1783 | </if>
|
---|
1784 | </target>
|
---|
1785 |
|
---|
1786 | <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
|
---|
1787 |
|
---|
1788 | <target name="distclean-javagdbm" depends="init">
|
---|
1789 | <if><bool><available file="${javagdbm.home}/Makefile"/></bool>
|
---|
1790 | <exec executable="make" os="${os.unix}"
|
---|
1791 | dir="${javagdbm.home}" failonerror="true">
|
---|
1792 | <arg value="distclean"/>
|
---|
1793 | </exec>
|
---|
1794 | </if>
|
---|
1795 | </target>
|
---|
1796 |
|
---|
1797 | <target name="compile-packages" description="Compile only the source packages">
|
---|
1798 | <!-- javagdbm -->
|
---|
1799 | <antcall target="compile-javagdbm"/>
|
---|
1800 | <!-- Search4j -->
|
---|
1801 | <antcall target="compile-search4j"/>
|
---|
1802 | </target>
|
---|
1803 |
|
---|
1804 | <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni">
|
---|
1805 |
|
---|
1806 | <!-- unix: -->
|
---|
1807 | <echo>compile javagdbm</echo>
|
---|
1808 | <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
|
---|
1809 | <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
|
---|
1810 | <arg value="install"/>
|
---|
1811 | </exec>
|
---|
1812 |
|
---|
1813 | <!-- windows: Calling without the "compile" argument first will run winMake.bat with
|
---|
1814 | "all" which will then perform both the compile AND link targets in jni/win32.mak
|
---|
1815 | (thereby also generating gdbmjava.dll). Then we run the same command with
|
---|
1816 | the "install" argument to copy the gdbmjava.dll into the correct location. -->
|
---|
1817 | <echo>Windows: compile javagdbm</echo>
|
---|
1818 | <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
|
---|
1819 | <env key="GSDL3SRCHOME" path="${basedir}"/>
|
---|
1820 | </exec>
|
---|
1821 | <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
|
---|
1822 | <env key="GSDL3SRCHOME" path="${basedir}"/>
|
---|
1823 | <arg value="install"/>
|
---|
1824 | </exec>
|
---|
1825 |
|
---|
1826 | <!-- install the jar file -->
|
---|
1827 | <echo>Install the javagdbm jar file ${javagdbm.home}/javagdbm.jar ${lib.jni}</echo>
|
---|
1828 | <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
|
---|
1829 | </target>
|
---|
1830 |
|
---|
1831 | <target name="compile-search4j">
|
---|
1832 |
|
---|
1833 | <!-- windows -->
|
---|
1834 | <if><bool><istrue value="${current.os.iswindows}"/></bool>
|
---|
1835 | <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
|
---|
1836 | <arg value="/f"/>
|
---|
1837 | <arg value="win32.mak"/>
|
---|
1838 | <arg value='BINDIR="${basedir}\bin"'/>
|
---|
1839 | </exec>
|
---|
1840 | <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
|
---|
1841 | <arg value="/f"/>
|
---|
1842 | <arg value="win32.mak"/>
|
---|
1843 | <arg value="install"/>
|
---|
1844 | <arg value='BINDIR="${basedir}\bin"'/>
|
---|
1845 | </exec>
|
---|
1846 |
|
---|
1847 | <!-- unix -->
|
---|
1848 | <else><if><bool><istrue value="${current.os.isunix}"/></bool>
|
---|
1849 | <exec executable="${src.packages.home}/search4j/configure" dir="${src.packages.home}/search4j" failonerror="true">
|
---|
1850 | <arg value="--bindir=${basedir}/bin"/>
|
---|
1851 | <arg value="${static.arg}"/>
|
---|
1852 | </exec>
|
---|
1853 | <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
|
---|
1854 | <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true">
|
---|
1855 | <arg value="install"/>
|
---|
1856 | </exec>
|
---|
1857 |
|
---|
1858 | <!-- else warn -->
|
---|
1859 | <else>
|
---|
1860 | <fail>this target does not support the current os</fail>
|
---|
1861 |
|
---|
1862 | </else></if></else></if>
|
---|
1863 |
|
---|
1864 | </target>
|
---|
1865 |
|
---|
1866 | <target name="install-auxiliary-jar-files" depends="init">
|
---|
1867 |
|
---|
1868 | <if>
|
---|
1869 | <bool><available file="${mg.home}/mg.jar"/></bool>
|
---|
1870 | <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
|
---|
1871 | </if>
|
---|
1872 |
|
---|
1873 | <if>
|
---|
1874 | <bool><available file="${mgpp.home}/mgpp.jar"/></bool>
|
---|
1875 | <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
|
---|
1876 | </if>
|
---|
1877 |
|
---|
1878 | <copy file="${lucene.home}/LuceneWrapper3.jar" todir="${web.lib}"/>
|
---|
1879 | </target>
|
---|
1880 |
|
---|
1881 | <target name="install-jni-files" depends="init" if="with.jni">
|
---|
1882 | <antcall target="install-jni-files-linux"/>
|
---|
1883 | <antcall target="install-jni-files-windows"/>
|
---|
1884 | <antcall target="install-jni-files-macos"/>
|
---|
1885 | </target>
|
---|
1886 |
|
---|
1887 | <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
|
---|
1888 | <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
|
---|
1889 | <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
|
---|
1890 | <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
|
---|
1891 | <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
|
---|
1892 | <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
|
---|
1893 | <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
|
---|
1894 | </target>
|
---|
1895 | <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
|
---|
1896 | <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
|
---|
1897 | <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
|
---|
1898 | <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
|
---|
1899 | <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
|
---|
1900 | <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
|
---|
1901 | <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
|
---|
1902 | </target>
|
---|
1903 | <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
|
---|
1904 | <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
|
---|
1905 | <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
|
---|
1906 | <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
|
---|
1907 | <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
|
---|
1908 | <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
|
---|
1909 | <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
|
---|
1910 | </target>
|
---|
1911 |
|
---|
1912 | <!-- ========common-src targets =================================-->
|
---|
1913 | <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
|
---|
1914 | collection building is not enabled -->
|
---|
1915 |
|
---|
1916 | <target name="update-common-src" depends="init" if="collection.building.disabled">
|
---|
1917 | </target>
|
---|
1918 |
|
---|
1919 | <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
|
---|
1920 | <exec executable="svn">
|
---|
1921 | <arg value="update"/>
|
---|
1922 | <arg value="${common.src.home}"/>
|
---|
1923 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
1924 | </exec>
|
---|
1925 | </target>
|
---|
1926 |
|
---|
1927 | <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
|
---|
1928 | <antcall target="checkout-common-src"/>
|
---|
1929 | <antcall target="unzip-windows-packages"/>
|
---|
1930 | </target>
|
---|
1931 |
|
---|
1932 | <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
|
---|
1933 | <echo>checking out common-src</echo>
|
---|
1934 | <exec executable="svn">
|
---|
1935 | <arg value="checkout"/>
|
---|
1936 | <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src"/>
|
---|
1937 | <arg value="common-src"/>
|
---|
1938 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
1939 | </exec>
|
---|
1940 | </target>
|
---|
1941 |
|
---|
1942 | <target name="configure-common-src" depends="init">
|
---|
1943 | <exec executable="${common.src.home}/configure" os="${os.unix}"
|
---|
1944 | dir="${common.src.home}" failonerror="true">
|
---|
1945 | <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
|
---|
1946 | <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
|
---|
1947 | <arg line="${gs2.opt.args}"/>
|
---|
1948 | <arg line="${static.arg}"/>
|
---|
1949 | <arg line="${allargs}"/>
|
---|
1950 | </exec>
|
---|
1951 | </target>
|
---|
1952 |
|
---|
1953 | <target name="clean-common-src" depends="init">
|
---|
1954 | <!-- unix: -->
|
---|
1955 | <if><bool><available file="${common.src.home}/Makefile"/></bool>
|
---|
1956 | <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
|
---|
1957 | <arg value="clean"/>
|
---|
1958 | </exec>
|
---|
1959 | </if>
|
---|
1960 | <!-- windows: -->
|
---|
1961 | <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
|
---|
1962 | <arg value="/f"/>
|
---|
1963 | <arg value="win32.mak"/>
|
---|
1964 | <arg value="clean"/>
|
---|
1965 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
1966 | </exec>
|
---|
1967 | </target>
|
---|
1968 | <target name="distclean-common-src" depends="init">
|
---|
1969 | <!-- unix: -->
|
---|
1970 | <if><bool><available file="${common.src.home}/Makefile"/></bool>
|
---|
1971 | <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
|
---|
1972 | <arg value="distclean"/>
|
---|
1973 | </exec>
|
---|
1974 | </if>
|
---|
1975 | <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
|
---|
1976 | <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
|
---|
1977 | <arg value="/f"/>
|
---|
1978 | <arg value="win32.mak"/>
|
---|
1979 | <arg value="clean"/>
|
---|
1980 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
1981 | </exec>
|
---|
1982 | </target>
|
---|
1983 | <target name="compile-common-src" depends="init">
|
---|
1984 | <!-- unix: -->
|
---|
1985 | <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
|
---|
1986 | <arg value="${gs2.compile.target}"/>
|
---|
1987 | </exec>
|
---|
1988 | <!-- windows: -->
|
---|
1989 | <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
|
---|
1990 | <arg value="/f"/>
|
---|
1991 | <arg value="win32.mak"/>
|
---|
1992 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
1993 | <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
|
---|
1994 | <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
|
---|
1995 | <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
|
---|
1996 | <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
|
---|
1997 | <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
|
---|
1998 | </exec>
|
---|
1999 | </target>
|
---|
2000 |
|
---|
2001 | <!-- ======= collection-building targets ===========================-->
|
---|
2002 |
|
---|
2003 | <target name="update-collection-building" if="collection.building.enabled"
|
---|
2004 | depends="init,svnupdate-collection-building,gs2build-edit-setup-bat,configure-common-src,clean-common-src,compile-common-src,configure-collection-building,clean-collection-building,compile-collection-building"
|
---|
2005 | description="Update (SVN update, configure, compile etc) only the collection building components"/>
|
---|
2006 |
|
---|
2007 | <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
|
---|
2008 | description="SVN update the collection building components">
|
---|
2009 | </target>
|
---|
2010 |
|
---|
2011 | <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
|
---|
2012 | </target>
|
---|
2013 |
|
---|
2014 | <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
|
---|
2015 | description="Configure the collection building components">
|
---|
2016 | </target>
|
---|
2017 |
|
---|
2018 | <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
|
---|
2019 | description="Clean only the collection building components"
|
---|
2020 | if="collection.building.enabled"/>
|
---|
2021 |
|
---|
2022 | <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
|
---|
2023 | description="Distclean only the collection building components"
|
---|
2024 | if="collection.building.enabled"/>
|
---|
2025 |
|
---|
2026 | <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
|
---|
2027 | description="Compile only the collection building components">
|
---|
2028 | <!-- make install for common-src -->
|
---|
2029 | <!-- unix: -->
|
---|
2030 | <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
|
---|
2031 | <arg value="${gs2.install.target}"/>
|
---|
2032 | </exec>
|
---|
2033 |
|
---|
2034 | <!-- windows: -->
|
---|
2035 | <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
|
---|
2036 | <arg value="/f"/>
|
---|
2037 | <arg value="win32.mak"/>
|
---|
2038 | <arg value="install"/>
|
---|
2039 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
2040 | <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
|
---|
2041 | <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
|
---|
2042 | <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
|
---|
2043 | <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
|
---|
2044 | <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
|
---|
2045 | <!--
|
---|
2046 | <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
|
---|
2047 | <arg value="USE_SQLITE=0"/>--> <!-- why is this not on by default? -->
|
---|
2048 | </exec>
|
---|
2049 |
|
---|
2050 | <!-- install gs2build indexers for windows -->
|
---|
2051 | <if>
|
---|
2052 | <bool><istrue value="${current.os.iswindows}"/></bool>
|
---|
2053 | <copy todir="${gs2build.home}/bin/windows">
|
---|
2054 | <fileset dir="${gs2build.home}/common-src/indexers/bin">
|
---|
2055 | <include name="*.*"/>
|
---|
2056 | </fileset>
|
---|
2057 | </copy>
|
---|
2058 | </if>
|
---|
2059 |
|
---|
2060 | <!-- LuceneWrapper jar file not installed by default -->
|
---|
2061 | <mkdir dir="${gs2build.home}/bin/java"/>
|
---|
2062 | <copy file="${lucene.home}/LuceneWrapper3.jar" todir="${gs2build.home}/bin/java"/>
|
---|
2063 |
|
---|
2064 | </target>
|
---|
2065 |
|
---|
2066 | <!-- ============== gli targets ================================= -->
|
---|
2067 | <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
|
---|
2068 |
|
---|
2069 | <exec executable="svn">
|
---|
2070 | <arg value="update"/>
|
---|
2071 | <arg value="${gli.home}"/>
|
---|
2072 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2073 | </exec>
|
---|
2074 |
|
---|
2075 | <exec executable="svn" dir="web/WEB-INF/cgi">
|
---|
2076 | <arg value="export"/>
|
---|
2077 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2078 | <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gliserver.pl"/>
|
---|
2079 | </exec>
|
---|
2080 | <exec executable="svn" dir="web/WEB-INF/cgi">
|
---|
2081 | <arg value="export"/>
|
---|
2082 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2083 | <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gsdlCGI.pm"/>
|
---|
2084 | </exec>
|
---|
2085 |
|
---|
2086 | </target>
|
---|
2087 |
|
---|
2088 | <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
|
---|
2089 | <!-- checkout -->
|
---|
2090 | <if><bool><and><not><istrue value="${nosvn.mode}"/></not><isset property="with.gli.and.gems"/></and></bool>
|
---|
2091 |
|
---|
2092 | <exec executable="svn">
|
---|
2093 | <arg value="checkout"/>
|
---|
2094 | <arg value="${svn.root}/main/${branch.path}/gli"/>
|
---|
2095 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2096 | </exec>
|
---|
2097 |
|
---|
2098 | <exec executable="svn" dir="web/WEB-INF/cgi">
|
---|
2099 | <arg value="export"/>
|
---|
2100 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2101 | <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gliserver.pl"/>
|
---|
2102 | </exec>
|
---|
2103 | <exec executable="svn" dir="web/WEB-INF/cgi">
|
---|
2104 | <arg value="export"/>
|
---|
2105 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2106 | <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gsdlCGI.pm"/>
|
---|
2107 | </exec>
|
---|
2108 |
|
---|
2109 | </if>
|
---|
2110 | </target>
|
---|
2111 |
|
---|
2112 | <target name="clean-gli" depends="init" if="collection.building.enabled">
|
---|
2113 | <!-- gli -->
|
---|
2114 | <property name="gli.home" value="${basedir}/gli"/>
|
---|
2115 | <!-- linux -->
|
---|
2116 | <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
|
---|
2117 | resolveExecutable="true" failonerror="true"/>
|
---|
2118 | <!-- windows -->
|
---|
2119 | <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
|
---|
2120 | resolveExecutable="true" failonerror="true"/>
|
---|
2121 | </target>
|
---|
2122 |
|
---|
2123 | <target name="compile-gli" depends="init" if="collection.building.enabled">
|
---|
2124 | <if><bool><isset property="with.gli.and.gems"/></bool>
|
---|
2125 | <!-- gli -->
|
---|
2126 | <property name="gli.home" value="${basedir}/gli"/>
|
---|
2127 |
|
---|
2128 | <!-- linux -->
|
---|
2129 | <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
|
---|
2130 | <!--remote gli-->
|
---|
2131 | <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
|
---|
2132 | resolveExecutable="true" failonerror="true"/>
|
---|
2133 | <!-- windows -->
|
---|
2134 | <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
|
---|
2135 | <!--remote gli-->
|
---|
2136 | <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
|
---|
2137 | resolveExecutable="true" failonerror="true"/>
|
---|
2138 | <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
|
---|
2139 | </if>
|
---|
2140 | </target>
|
---|
2141 |
|
---|
2142 | <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
|
---|
2143 | <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
|
---|
2144 | <env key="gsdl3path" path="${basedir}"/>
|
---|
2145 | <env key="gsdlpath" path="${gs2build.home}"/>
|
---|
2146 | </exec>
|
---|
2147 | <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
|
---|
2148 | <env key="gsdl3path" path="${basedir}"/>
|
---|
2149 | <env key="gsdlpath" path="${gs2build.home}"/>
|
---|
2150 | <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
|
---|
2151 | </exec>
|
---|
2152 | <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
|
---|
2153 | <env key="GSDL3PATH" path="${basedir}"/>
|
---|
2154 | <env key="GSDLPATH" path="${gs2build.home}"/>
|
---|
2155 | </exec>
|
---|
2156 | <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 gli.sh/bat from the greenstone3/gli directory.
|
---|
2157 | </echo>
|
---|
2158 | </target>
|
---|
2159 |
|
---|
2160 | <!-- ================ gs2build targets =========================== -->
|
---|
2161 |
|
---|
2162 | <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
|
---|
2163 | <echo>svn updating gs2build</echo>
|
---|
2164 | <exec executable="svn">
|
---|
2165 | <arg value="update"/>
|
---|
2166 | <arg value="${gs2build.home}"/>
|
---|
2167 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2168 | </exec>
|
---|
2169 | </target>
|
---|
2170 |
|
---|
2171 | <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
|
---|
2172 | <antcall target="checkout-gs2build"/>
|
---|
2173 | <antcall target="unzip-windows-packages"/>
|
---|
2174 | <antcall target="checkout-winbin"/>
|
---|
2175 | <antcall target="get-windows-binaries"/>
|
---|
2176 | <antcall target="delete-winbin"/>
|
---|
2177 | </target>
|
---|
2178 |
|
---|
2179 | <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
|
---|
2180 | <echo>checking out gs2build</echo>
|
---|
2181 | <exec executable="svn">
|
---|
2182 | <arg value="checkout"/>
|
---|
2183 | <arg value="${svn.root}/main/${branch.path}/gs2build"/>
|
---|
2184 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2185 | </exec>
|
---|
2186 |
|
---|
2187 |
|
---|
2188 | </target>
|
---|
2189 |
|
---|
2190 | <target name="checkout-winbin" depends="init" if="current.os.iswindows"
|
---|
2191 | unless="nosvn.mode">
|
---|
2192 |
|
---|
2193 | <exec executable="svn">
|
---|
2194 | <arg value="checkout"/>
|
---|
2195 | <arg value="${svn.root}/main/${branch.path}/binaries/windows"/>
|
---|
2196 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2197 | <arg value="winbin"/>
|
---|
2198 | </exec>
|
---|
2199 |
|
---|
2200 | </target>
|
---|
2201 |
|
---|
2202 | <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
|
---|
2203 | <exec executable="svn">
|
---|
2204 | <arg value="update"/>
|
---|
2205 | <arg value="winbin"/>
|
---|
2206 | <arg value="-r"/><arg value="${branch.revision}"/>
|
---|
2207 | </exec>
|
---|
2208 |
|
---|
2209 | </target>
|
---|
2210 |
|
---|
2211 | <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
|
---|
2212 | <move todir="${gs2build.home}/bin/windows" failonerror="false">
|
---|
2213 | <fileset dir="${basedir}/winbin/bin"/>
|
---|
2214 | </move>
|
---|
2215 | </target>
|
---|
2216 |
|
---|
2217 | <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
|
---|
2218 | <delete dir="${basedir}/winbin"/>
|
---|
2219 | </target>
|
---|
2220 |
|
---|
2221 | <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
|
---|
2222 | <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
|
---|
2223 | dest="${common.src.home}/packages/windows/crypt"/>
|
---|
2224 | <untar compression="gzip"
|
---|
2225 | src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
|
---|
2226 | dest="${common.src.home}/packages/sqlite"/>
|
---|
2227 | <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
|
---|
2228 | dest="${common.src.home}/indexers/packages/windows/iconv"/>
|
---|
2229 | </target>
|
---|
2230 |
|
---|
2231 | <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
|
---|
2232 | <!-- we want a windows path in the setup.bat file -->
|
---|
2233 | <pathconvert targetos="windows" property="gs2build.home.windows">
|
---|
2234 | <path path="${gs2build.home}"/>
|
---|
2235 | </pathconvert>
|
---|
2236 | <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
|
---|
2237 | <filterset>
|
---|
2238 | <filter token="gsdlhome" value="${gs2build.home.windows}"/>
|
---|
2239 | </filterset>
|
---|
2240 | </move>
|
---|
2241 | <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
|
---|
2242 | </target>
|
---|
2243 |
|
---|
2244 |
|
---|
2245 | <target name="clean-build-src" depends="init" if="collection.building.enabled">
|
---|
2246 | <!-- unix: -->
|
---|
2247 | <if><bool><available file="${build.src.home}/Makefile"/></bool>
|
---|
2248 | <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
|
---|
2249 | <arg value="clean"/>
|
---|
2250 | </exec>
|
---|
2251 | </if>
|
---|
2252 | <!-- windows: -->
|
---|
2253 | <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
|
---|
2254 | <arg value="/f"/>
|
---|
2255 | <arg value="win32.mak"/>
|
---|
2256 | <arg value="clean"/>
|
---|
2257 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
2258 | </exec>
|
---|
2259 | </target>
|
---|
2260 |
|
---|
2261 |
|
---|
2262 | <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
|
---|
2263 | <!-- unix: -->
|
---|
2264 | <if><bool><available file="${build.src.home}/Makefile"/></bool>
|
---|
2265 | <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
|
---|
2266 | <arg value="distclean"/>
|
---|
2267 | </exec>
|
---|
2268 | </if>
|
---|
2269 | <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
|
---|
2270 | <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
|
---|
2271 | <arg value="/f"/>
|
---|
2272 | <arg value="win32.mak"/>
|
---|
2273 | <arg value="clean"/>
|
---|
2274 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
2275 | </exec>
|
---|
2276 | </target>
|
---|
2277 |
|
---|
2278 | <target name="configure-build-src" depends="init" if="collection.building.enabled"
|
---|
2279 | description="Configure the build-src component">
|
---|
2280 | <exec executable="${build.src.home}/configure" os="${os.unix}"
|
---|
2281 | dir="${build.src.home}" failonerror="true">
|
---|
2282 | <arg value="--prefix=${gs2build.home}"/>
|
---|
2283 | <arg line="${gs2.opt.args} ${static.arg} ${allargs}"/>
|
---|
2284 | </exec>
|
---|
2285 | </target>
|
---|
2286 |
|
---|
2287 | <!-- common-src is done separately and needs to be compiled first -->
|
---|
2288 | <target name="compile-build-src" depends="init" if="collection.building.enabled">
|
---|
2289 |
|
---|
2290 | <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
|
---|
2291 | <arg line="${ldlpath.arg}"/>
|
---|
2292 | </exec>
|
---|
2293 |
|
---|
2294 | <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
|
---|
2295 | <arg value="install"/>
|
---|
2296 | </exec>
|
---|
2297 |
|
---|
2298 | <!-- run the setup script -->
|
---|
2299 | <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}" failonerror="true"/>-->
|
---|
2300 | <!--Above does not work: even though vcvars.bat executes, the env changes it makes don't get saved. Need user to run vcvars.bat first before calling ant-->
|
---|
2301 | <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
|
---|
2302 | <arg value="/f"/>
|
---|
2303 | <arg value="win32.mak"/>
|
---|
2304 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
2305 | </exec>
|
---|
2306 | <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
|
---|
2307 | <arg value="/f"/>
|
---|
2308 | <arg value="win32.mak"/>
|
---|
2309 | <arg value="install"/>
|
---|
2310 | <arg value="GSDLHOME=${gs2build.home}"/>
|
---|
2311 | </exec>
|
---|
2312 | </target>
|
---|
2313 |
|
---|
2314 |
|
---|
2315 | <!-- ======================== TESTING Targets ========================= -->
|
---|
2316 |
|
---|
2317 | <target name="test" description="Run the (incomplete) JUnit test suite "
|
---|
2318 | depends="init">
|
---|
2319 | <mkdir dir="${basedir}/test"/>
|
---|
2320 | <junit printsummary="withOutAndErr"
|
---|
2321 | errorproperty="test.failed"
|
---|
2322 | failureproperty="test.failed"
|
---|
2323 | fork="${junit.fork}">
|
---|
2324 | <formatter type="plain"/>
|
---|
2325 | <classpath>
|
---|
2326 | <pathelement location="${build.home}/gsdl3test.jar"/>
|
---|
2327 | <path refid="compile.classpath"/>
|
---|
2328 | </classpath>
|
---|
2329 | <test name="${testcase}" if="testcase"/>
|
---|
2330 | <batchtest todir="${basedir}/test" unless="testcase">
|
---|
2331 | <fileset dir="${build.home}" includes="**/*Test.class" />
|
---|
2332 | </batchtest>
|
---|
2333 | </junit>
|
---|
2334 | <echo>
|
---|
2335 | *********************************************
|
---|
2336 | Test output can be found in directory 'test'
|
---|
2337 | *********************************************
|
---|
2338 | </echo>
|
---|
2339 | </target>
|
---|
2340 |
|
---|
2341 | <!-- ======================== FLAX Targets ========================= -->
|
---|
2342 | <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
|
---|
2343 | <echo>checking out flax ...</echo>
|
---|
2344 | <mkdir dir="${basedir}/src/java/org/flax"/>
|
---|
2345 | <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
|
---|
2346 | <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/action/flax"/>
|
---|
2347 | <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
|
---|
2348 | <mkdir dir="${web.home}/interfaces/flax"/>
|
---|
2349 | <mkdir dir="${web.home}/sites/flax"/>
|
---|
2350 | <mkdir dir="${basedir}/flax-resources"/>
|
---|
2351 | <mkdir dir="${basedir}/flax-lib"/>
|
---|
2352 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
|
---|
2353 | <arg value="src/java/org/flax"/></exec>
|
---|
2354 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
|
---|
2355 | <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
|
---|
2356 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/action/flax"/>
|
---|
2357 | <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
|
---|
2358 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
|
---|
2359 | <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
|
---|
2360 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
|
---|
2361 | <arg value="${web.home}/interfaces/flax"/></exec>
|
---|
2362 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
|
---|
2363 | <arg value="${web.home}/sites/flax"/></exec>
|
---|
2364 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
|
---|
2365 | <arg value="flax-resources"/></exec>
|
---|
2366 | <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
|
---|
2367 | <arg value="flax-lib"/></exec>
|
---|
2368 | <antcall target="flax-copy-del-files" />
|
---|
2369 | </target>
|
---|
2370 |
|
---|
2371 | <target name="flax-copy-del-files" description="copy some flax files into the appropriate greenstone3 directories and delete some unwanted greenstone stuff">
|
---|
2372 | <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
|
---|
2373 | <copy todir="${web.home}/WEB-INF/lib">
|
---|
2374 | <fileset dir="${basedir}/flax-lib">
|
---|
2375 | <include name="*.jar"/>
|
---|
2376 | </fileset>
|
---|
2377 | </copy>
|
---|
2378 | <!--<delete dir="${web.home}/sites/gateway"/>
|
---|
2379 | <delete dir="${web.home}/sites/localsite"/>-->
|
---|
2380 | </target>
|
---|
2381 |
|
---|
2382 | <target name="update-flax" description="update flax from repository">
|
---|
2383 | <echo>updating flax ...</echo>
|
---|
2384 | <exec executable="svn"><arg value="update"/>
|
---|
2385 | <arg value="src/java/org/flax"/></exec>
|
---|
2386 | <exec executable="svn"><arg value="update"/>
|
---|
2387 | <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
|
---|
2388 | <exec executable="svn"><arg value="update"/>
|
---|
2389 | <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
|
---|
2390 | <exec executable="svn"><arg value="update"/>
|
---|
2391 | <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
|
---|
2392 | <exec executable="svn"><arg value="update"/>
|
---|
2393 | <arg value="${web.home}/interfaces/flax"/></exec>
|
---|
2394 | <exec executable="svn"><arg value="update"/>
|
---|
2395 | <arg value="${web.home}/web/sites/flax"/></exec>
|
---|
2396 | <exec executable="svn"><arg value="update"/>
|
---|
2397 | <arg value="flax-resources"/></exec>
|
---|
2398 | <exec executable="svn"><arg value="update"/>
|
---|
2399 | <arg value="flax-lib"/></exec>
|
---|
2400 | <antcall target="compile-core" />
|
---|
2401 | </target>
|
---|
2402 |
|
---|
2403 | <!-- ========================End of FLAX Targets ========================= -->
|
---|
2404 |
|
---|
2405 | <target name="compile-javadocs">
|
---|
2406 | <javadoc packagenames="org.greenstone.*"
|
---|
2407 | sourcepath="src/java"
|
---|
2408 | defaultexcludes="yes"
|
---|
2409 | destdir="docs/javadoc"
|
---|
2410 | author="true"
|
---|
2411 | version="true"
|
---|
2412 | use="true"
|
---|
2413 | windowtitle="Greenstone3 API">
|
---|
2414 | <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
|
---|
2415 | </javadoc>
|
---|
2416 | </target>
|
---|
2417 |
|
---|
2418 | <!-- ========== Some distribution targets ======================== -->
|
---|
2419 | <target name="remove-source">
|
---|
2420 | <if><bool><isset property="with.gli.and.gems"/></bool>
|
---|
2421 | <delete includeEmptyDirs="true">
|
---|
2422 | <fileset dir="." defaultexcludes="false">
|
---|
2423 | <patternset refid="greenstone3.source.component"/>
|
---|
2424 | </fileset>
|
---|
2425 | </delete>
|
---|
2426 |
|
---|
2427 | <else>
|
---|
2428 | <delete includeEmptyDirs="true">
|
---|
2429 | <fileset dir="." defaultexcludes="false">
|
---|
2430 | <patternset refid="greenstone3.source.no.gli.component"/>
|
---|
2431 | </fileset>
|
---|
2432 | </delete>
|
---|
2433 | </else>
|
---|
2434 | </if>
|
---|
2435 | </target>
|
---|
2436 |
|
---|
2437 | <target name="dist-tidy"
|
---|
2438 | description="'tidies-up' a greenstone3 installation for distribution.">
|
---|
2439 |
|
---|
2440 | <!-- delete unneeded things -->
|
---|
2441 | <delete dir="${packages.home}/axis"/>
|
---|
2442 | <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
|
---|
2443 | <delete file="README-SVN.txt"/>
|
---|
2444 | <delete file="build.properties.in"/>
|
---|
2445 |
|
---|
2446 | <!-- delete source files -->
|
---|
2447 | <antcall target="remove-source"/>
|
---|
2448 |
|
---|
2449 | <!-- create empty directories -->
|
---|
2450 | <mkdir dir="${web.home}/applet"/>
|
---|
2451 | <mkdir dir="${web.home}/logs"/>
|
---|
2452 | <mkdir dir="${web.home}/logs/tmp"/>
|
---|
2453 |
|
---|
2454 | <!-- os specific tidy-ups -->
|
---|
2455 | <!-- linux, mac -->
|
---|
2456 | <if><bool><istrue value="${current.os.isunix}"/></bool>
|
---|
2457 | <delete><fileset dir="." includes="*.bat"/></delete>
|
---|
2458 | <if><bool><isset property="with.gli.and.gems"/></bool>
|
---|
2459 | <delete><fileset dir="gli" includes="*.bat"/></delete>
|
---|
2460 | </if>
|
---|
2461 | <delete><fileset dir="gs2build" includes="*.bat"/></delete>
|
---|
2462 | <delete><fileset dir="bin/script" includes="*.bat"/></delete>
|
---|
2463 | <delete file="${basedir}/gs2build/win32cfg.h"/>
|
---|
2464 | <delete file="${basedir}/gs2build/win32.mak"/>
|
---|
2465 | <delete dir="${basedir}/winutil"/>
|
---|
2466 | <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
|
---|
2467 |
|
---|
2468 | <!-- windows -->
|
---|
2469 | <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
|
---|
2470 | <delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>
|
---|
2471 | <if><bool><isset property="with.gli.and.gems"/></bool>
|
---|
2472 | <delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
|
---|
2473 | </if>
|
---|
2474 | <delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>
|
---|
2475 | <delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>
|
---|
2476 | </if></else></if>
|
---|
2477 |
|
---|
2478 | </target>
|
---|
2479 |
|
---|
2480 | <!-- fix up executable permissions for binary release -->
|
---|
2481 | <target name="fix-execute-permissions">
|
---|
2482 | <echo>Setting binaries to executable</echo>
|
---|
2483 | <chmod perm="775">
|
---|
2484 | <fileset dir="."><patternset refid="greenstone3.executables"/></fileset>
|
---|
2485 | </chmod>
|
---|
2486 | </target>
|
---|
2487 |
|
---|
2488 | <!-- fix up executable permissions for source code release -->
|
---|
2489 | <target name="fix-execute-permissions-source">
|
---|
2490 | <chmod perm="775">
|
---|
2491 | <fileset dir="."><patternset refid="greenstone3.source.executables"/></fileset>
|
---|
2492 | </chmod>
|
---|
2493 | </target>
|
---|
2494 |
|
---|
2495 |
|
---|
2496 | <!-- ============= tweaks for making compilation static ========== -->
|
---|
2497 | <target name="tweak-makefiles" depends="init" if="compile.static">
|
---|
2498 | <antcall target="rtftohtml-add-static" />
|
---|
2499 | </target>
|
---|
2500 |
|
---|
2501 | <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
|
---|
2502 | <rsr file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
|
---|
2503 | </target>
|
---|
2504 |
|
---|
2505 | <target name="run-collection-tests">
|
---|
2506 | <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool>
|
---|
2507 | <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail>
|
---|
2508 | </if>
|
---|
2509 | <for param="testjar">
|
---|
2510 | <path>
|
---|
2511 | <fileset dir="${basedir}" includes="web/sites/*/collect/*/tests/tests.jar"/>
|
---|
2512 | </path>
|
---|
2513 | <sequential>
|
---|
2514 | <echo>Testing @{testjar}</echo>
|
---|
2515 | <java classname="org.junit.runner.JUnitCore" fork="true">
|
---|
2516 | <arg value="gstests.TestClass"/>
|
---|
2517 | <jvmarg value="-DSERVERURL=http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet} "/>
|
---|
2518 | <classpath>
|
---|
2519 | <fileset dir="${basedir}/ext/testing/lib/java">
|
---|
2520 | <include name="*.jar"/>
|
---|
2521 | </fileset>
|
---|
2522 | <files includes="@{testjar}"/>
|
---|
2523 | </classpath>
|
---|
2524 | </java>
|
---|
2525 | </sequential>
|
---|
2526 | </for>
|
---|
2527 | </target>
|
---|
2528 |
|
---|
2529 | <target name="build-collection-tests">
|
---|
2530 | <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool>
|
---|
2531 | <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail>
|
---|
2532 | </if>
|
---|
2533 | <for param="compiledir">
|
---|
2534 | <path>
|
---|
2535 | <dirset dir="${basedir}" includes="web/sites/*/collect/*/tests/src"/>
|
---|
2536 | </path>
|
---|
2537 | <sequential>
|
---|
2538 | <echo>Compiling @{compiledir}</echo>
|
---|
2539 | <if><bool><not><available file="@{compiledir}/../build" type="dir"/></not></bool>
|
---|
2540 | <mkdir dir="@{compiledir}/../build"/>
|
---|
2541 | </if>
|
---|
2542 | <javac
|
---|
2543 | srcdir="@{compiledir}"
|
---|
2544 | destdir="@{compiledir}/../build"
|
---|
2545 | debug="${compile.debug}"
|
---|
2546 | deprecation="${compile.deprecation}"
|
---|
2547 | optimize="${compile.optimize}">
|
---|
2548 | <classpath>
|
---|
2549 | <fileset dir="${basedir}/ext/testing/lib/java">
|
---|
2550 | <include name="*.jar"/>
|
---|
2551 | </fileset>
|
---|
2552 | </classpath>
|
---|
2553 | <include name="gstests/*.java"/>
|
---|
2554 | </javac>
|
---|
2555 | <jar destfile="@{compiledir}/../tests.jar">
|
---|
2556 | <fileset dir="@{compiledir}/../build">
|
---|
2557 | <include name="gstests/**"/>
|
---|
2558 | </fileset>
|
---|
2559 | <manifest>
|
---|
2560 | <attribute name="Built-By" value="${user.name}" />
|
---|
2561 | </manifest>
|
---|
2562 | </jar>
|
---|
2563 | </sequential>
|
---|
2564 | </for>
|
---|
2565 | </target>
|
---|
2566 | </project>
|
---|