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