Changeset 10069


Ignore:
Timestamp:
2005-06-13T14:19:47+12:00 (19 years ago)
Author:
kjdon
Message:

a few changes to do with directories, and hopefully it works with an external tomcat now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/build.xml

    r9986 r10069  
    5151  <property name="build.home" value="${basedir}/build"/>
    5252  <property name="packages.home" value="${basedir}/packages"/>
    53   <property name="javalib" value="${basedir}/lib/java"/>
    5453  <property name="web.home" value="${basedir}/web"/>
    55   <property name="web.lib" value="${web.home}/lib"/>
     54  <!-- jar files needed by applets go here -->
     55  <property name="web.applet" value="${web.home}/applet"/>
     56  <!-- jar files needed by the servlet (and extra ones) go here -->
     57  <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
     58  <!-- other files needed by the servlet go here -->
    5659  <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
     60  <!-- jni libraries and java wrappers go here -->
     61  <property name="lib.jni" value="${basedir}/lib/jni"/>
    5762 
    5863  <property name="javadocs" value="${basedir}/docs/javadoc"/>
     
    6166  <property name="app.path"      value="/${app.name}"/>
    6267  <property name="app.version"   value="3.00alpha"/>
     68
     69  <!-- catalina home is set to tomcat basedir is already installed, otherwise
     70  use greenstone's tomcat -->
     71  <condition property="catalina.home" value="${tomcat.installed.path}">
     72    <and>
     73      <isset property="tomcat.installed.path"/>
     74      <not>
     75    <equals arg1="" arg2="${tomcat.installed.path}"/>
     76      </not>
     77    </and>
     78  </condition>
    6379  <property name="catalina.home" value="${basedir}/comms/jakarta/tomcat"/>
    64  
     80
    6581  <property name="os.linux" value="Linux"/> <!-- mac??-->
    6682  <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows XP, Windows NT,Windows ME"/> <!-- check this!!!-->
     
    115131
    116132  <path id="compile.classpath">
    117     <!-- Include all jar files in our lib directory -->
    118     <pathelement location="${javalib}"/>
    119     <fileset dir="${javalib}">
     133    <!-- Include all jar files and libraries in our jni lib directory -->
     134    <pathelement location="${lib.jni}"/>
     135    <fileset dir="${lib.jni}">
     136      <include name="*.jar"/>
     137    </fileset>
     138    <!-- Include all jar files in our web lib directory -->
     139    <pathelement location="${web.lib}"/>
     140    <fileset dir="${web.lib}">
    120141      <include name="*.jar"/>
    121142    </fileset>
    122143    <!-- Include the resources directory -->
    123     <pathelement location="${basedir}/resources/java"/>
    124     <pathelement location="${basedir}/resources/dtd"/>
     144   <!-- <pathelement location="${basedir}/resources/dtd"/>-->
    125145   
    126146    <!-- Include the axis jar files -->
     
    130150   
    131151    <!-- include the jar files from the packages -->
    132     <!-- mg and mgpp get installed into lib/java but they may not be there yet -->
    133     <pathelement location="${javalib}/mg.jar"/>
    134     <pathelement location="${javalib}/mgpp.jar"/>
     152    <!-- mg and mgpp get installed into lib/jni but they may not be there yet
     153    so we add them in by name -->
     154    <pathelement location="${lib.jni}/mg.jar"/>
     155    <pathelement location="${lib.jni}/mgpp.jar"/>
    135156    <pathelement location="${vishnu.home}/build/vishnu.jar"/>
    136157   
     
    149170  </path>
    150171
    151   <path id="running.path">
     172  <path id="local.tomcat.classpath">
     173    <!-- explicitly include the jni java wrappers in the classpath -->
     174    <pathelement location="${lib.jni}"/>
     175    <fileset dir="${lib.jni}">
     176      <include name="*.jar"/>
     177    </fileset>
     178  </path>
     179 
     180  <path id="local.tomcat.path">
    152181    <pathelement location="${mysql.home}/bin"/>
    153182    <pathelement location="${basedir}/bin/script"/>
    154183    <pathelement location="${basedir}/bin"/>
    155     <pathelement location="${basedir}/lib"/>
     184    <pathelement location="${lib.jni}"/>
    156185    <pathelement path="${env.PATH}"/>
    157186    <pathelement path="${env.Path}"/>
    158187  </path>
    159188
    160   <path id="ld.library.path">
    161     <pathelement path="${env.LD_LIBRARY_PATH}"/>
    162     <pathelement location="${basedir}/lib"/>
    163     <pathelement location="${mysql.home}/lib/mysql"/>
    164   </path>
    165 
    166 <target name="test-java">
     189  <target name="test-java">
    167190    <echo>${ant.java.version}</echo>
    168 </target>
     191  </target>
    169192<!-- ==================== Primary and Global Targets ============================= -->
    170193
     
    174197    description="Install Greenstone 3. Use this when you first checkout the code. Also running this target later on will reinstall Greenstone. Most things will be reset back to their defaults, except for code changes."/>
    175198
    176   <target name="prepare" depends="init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-collections"/>
    177 
    178   <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building"
    179     description="Do a cvs update for all sources. Doesn't reompile the code."/>
    180 
    181     <target name="configure" depends="init,configure-tomcat,configure-files,configure-packages,configure-core,configure-gs2building"
     199  <target name="prepare" depends="init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-web"/>
     200
     201  <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web"
     202    description="Do a cvs update for all sources. Doesn't recompile the code."/>
     203
     204    <target name="configure" depends="init,configure-tomcat,configure-web,configure-packages,configure-core,configure-gs2building"
    182205    description="Configure the installation. Includes setting up config files and configuring the C/C++ packages. This is called from install and update. Should be re-run if you change the build.properties file."/>
    183206
     
    186209  <target name="clean-windows-c++" depends="init,clean-windows-c++-gs2building,clean-windows-c++-packages"
    187210    description="Remove C++ compiled code for Windows. Requires Microsoft Visual Studio"/>
    188   <target name="compile" depends="init,compile-extra,compile-packages,compile-core,compile-gs2building"
     211  <target name="compile" depends="init,compile-web,compile-packages,compile-core,compile-gs2building"
    189212    description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/>
    190213  <target name="compile-windows-c++" depends="init,compile-windows-c++-gs2building,compile-windows-c++-packages"
    191214    description="Compile the C/C++ code for Windows. Requires Microsoft Visual Studio"/>
    192   <target name="update" depends="init,update-packages,update-core,update-gs2building"
     215  <target name="update" depends="init,update-packages,update-core,update-gs2building,update-web"
    193216    description="Update (thru CVS) all the source (including core, packages and gs2building) and recompile. Similar to install but doesn't reinstall components such as Tomcat and axis."/>
    194217
     
    268291    <available file="${basedir}/gs2build" property="gs2build.present"/>
    269292    <available file="${basedir}/comms/soap/axis" property="axis.present"/>
    270     <available file="${basedir}/comms/jakarta/tomcat/webapps/axis" property="axis.installed"/>
     293    <available file="${catalina.home}/webapps/axis" property="axis.installed"/>
    271294    <condition property="gsdl2.islocal">
    272295      <or>
     
    316339  </target>
    317340 
    318  <!-- ========== Miscellaneous Targets ================================ -->
    319  
    320   <target name="prepare-collections">
    321     <property name="collect.dir" value="${basedir}/web/sites/localsite/collect"/>
     341 <!-- ========== Web app Targets ================================ -->
     342 
     343  <target name="prepare-web">
     344    <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
    322345    <!-- gs3mgdemo -->
    323346    <unzip src="${collect.dir}/gs3mgdemo/import.zip"
     
    344367    <unzip src="${collect.dir}/gberg/index/index.zip"
    345368      dest="${collect.dir}/gberg/index"/>
    346   </target>
    347 
    348   <target name="configure-files" depends="configure-files-gsdl3,configure-files-server"/>
    349  
    350   <target name="configure-files-gsdl3" depends="init">
     369    <mkdir dir="${web.home}/applet"/>
     370  </target>
     371
     372  <target name="configure-web" depends="configure-web-gsdl3,configure-web-server"/>
     373 
     374  <target name="configure-web-gsdl3" depends="init">
    351375    <filter token="gsdl3home" value="${basedir}"/>
    352     <copy file="${basedir}/web/WEB-INF/web.xml.in" tofile="${basedir}/web/WEB-INF/web.xml" filtering="true" overwrite="true" />
    353     <copy file="${basedir}/resources/java/SOAPServer.cfg.in" tofile="${basedir}/resources/java/SOAPServer.cfg" filtering="true" overwrite="true"/>
    354   </target>
    355  
    356   <target name="configure-files-server" depends="init">
     376    <copy file="${web.home}/WEB-INF/web.xml.in" tofile="${web.home}/WEB-INF/web.xml" filtering="true" overwrite="true" />
     377    <copy file="${basedir}/resources/soap/SOAPServer.cfg.in" tofile="${web.classes}/SOAPServer.cfg" filtering="true" overwrite="true"/>
     378  </target>
     379 
     380  <target name="configure-web-server" depends="init">
    357381    <filter token="port" value="${tomcat.port}"/>
    358382    <filter token="hostname" value="${tomcat.server}"/>
    359     <copy file="${basedir}/web/sites/localsite/siteConfig.xml.in" tofile="${basedir}/web/sites/localsite/siteConfig.xml" filtering="true" overwrite="true"/>
    360     <copy file="${basedir}/web/sites/gateway/siteConfig.xml.in" tofile="${basedir}/web/sites/gateway/siteConfig.xml" filtering="true" overwrite="true"/>
    361   </target>
    362 
    363    <target name="compile-extra" depends="init">
    364     <javac srcdir="${web.home}/WEB-INF/classes"
    365       destdir="${web.home}/WEB-INF/classes"
     383    <copy file="${web.home}/sites/localsite/siteConfig.xml.in" tofile="${web.home}/sites/localsite/siteConfig.xml" filtering="true" overwrite="true"/>
     384    <copy file="${web.home}/sites/gateway/siteConfig.xml.in" tofile="${web.home}/sites/gateway/siteConfig.xml" filtering="true" overwrite="true"/>
     385  </target>
     386
     387   <target name="compile-web" depends="init">
     388    <javac srcdir="${web.classes}"
     389      destdir="${web.classes}"
    366390      debug="${compile.debug}"
    367391      deprecation="${compile.deprecation}"
     
    373397  </target>
    374398
    375  
    376 
     399  <target name="cvsupdate-web">
     400    <cvs command="update -dP" dest="${web.home}"/>
     401  </target>
     402
     403  <target name="update-web" depends="init,cvsupdate-web,configure-web"/>
    377404
    378405<!-- ======================= Tomcat Targets ========================== -->
     
    412439      dest="${basedir}/comms/jakarta"/>
    413440    <copy file="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7/common/endorsed/xml-apis.jar"
    414       tofile="${basedir}/web/lib/xml-apis.jar"/>
     441      tofile="${web.applet}/xml-apis.jar"/>
    415442    <copy file="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7/common/endorsed/xercesImpl.jar"
    416       tofile="${basedir}/web/lib/xercesImpl.jar"/>
    417   </target>
    418  
    419   <target name="configure-tomcat" depends="init" if="tomcat.islocal">
     443      tofile="${web.applet}/xercesImpl.jar"/>
     444  </target>
     445 
     446  <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
     447 
     448  <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
    420449    <!-- re-setup the server.xml file -->
    421450    <copy file="${basedir}/comms/jakarta/server.xml.in" tofile="${basedir}/comms/jakarta/tomcat/conf/server.xml" overwrite="true">
     
    427456  </target>
    428457
     458  <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
     459    <!-- re-setup the server.xml file -->
     460    <!-- need to edit the config file, or do we get the user to do this???-->
     461  </target>
     462 
    429463  <target name="reload" description="Reload web application"
    430464          depends="init,setup-catalina-ant-tasks">
     
    434468 
    435469  <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
    436     <property name="tomcat.classpath" refid="compile.classpath"/>
    437     <property name="tomcat.path" refid="running.path"/>
     470   <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
     471    <property name="tomcat.path" refid="local.tomcat.path"/>
    438472    <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
    439473    <exec executable="${catalina.home}/bin/startup.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false">
     
    577611    </exec>
    578612    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
    579       input="${basedir}/web/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
     613      input="${web.home}/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
    580614      <arg value="--user=root"/>
    581615      <arg value="localsite_gs3mgdemo"/>
     
    642676    </move>
    643677    <!-- install the webapp into tomcat -->
    644     <copy todir="${basedir}/comms/jakarta/tomcat/webapps/axis">
     678    <copy todir="${catalina.home}/webapps/axis">
    645679      <fileset dir="${basedir}/comms/soap/axis/webapps/axis"/>
    646680    </copy>
     
    724758      </manifest>
    725759    </jar>
    726     <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
    727760    <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
    728761  </target>
     
    736769    <cvs command="update -P"/>
    737770  </target>
     771 
    738772  <target name="configure-core"/>
    739773  <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
     
    742776  <target name="cvsupdate-core">
    743777    <cvs command="update -l"/>
    744     <cvs command="update -dP bin comms dist-resources docs interfaces lib resources src web winutil"/>
     778    <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/>
    745779  </target>
    746780
     
    771805      </manifest>
    772806    </jar>
    773     <copy file="${build.home}/gsdl3.jar" todir="${javalib}"/>
    774807    <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
    775     <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
    776     <copy file="${build.home}/org/greenstone/gsdl3/LibraryServlet.class"
    777       todir="${web.classes}/org/greenstone/gsdl3"/>
    778808    <jar destfile="${build.home}/phind.jar">
    779809      <fileset dir="${build.home}">
     
    784814      </manifest>
    785815    </jar>
    786     <copy file="${build.home}/phind.jar" todir="${javalib}"/>
    787     <copy file="${build.home}/phind.jar" todir="${web.lib}"/>
     816    <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
    788817    <jar destfile="${build.home}/anttasks.jar">
    789818      <fileset dir="${build.home}">
     
    794823      </manifest>
    795824    </jar>
    796     <copy file="${build.home}/anttasks.jar" todir="${javalib}"/>
     825    <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
    797826    <jar destfile="${build.home}/gsdl3test.jar">
    798827      <fileset dir="${build.home}">
     
    860889    <!-- gsdl-as : just call the ant target-->
    861890    <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
    862       inheritall="false" target="clean"/>
     891      inheritall="false" target="clean">
     892      <property name="catalina.home" value="${catalina.home}"/>
     893    </ant>
    863894  </target>
    864895
     
    921952    <echo>Compiling Vishnu</echo>
    922953    <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
    923       inheritall="false" target="compile"/>
     954      inheritall="false" target="compile">
     955      <property name="catalina.dir" value="${catalina.home}"/>
     956    </ant>
    924957
    925958    <!-- gsdl-as -->
    926959    <echo>Compiling GSDL-AS</echo>
    927960    <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
    928       inheritall="false" target="compile"/>
     961      inheritall="false" target="compile">
     962      <property name="catalina.home" value="${catalina.home}"/>
     963    </ant>
    929964  </target>
    930965
     
    11501185
    11511186
    1152   <target name="reconfigure-server-settings" depends="init,configure-tomcat,configure-files-server"
     1187  <target name="reconfigure-server-settings" depends="init,configure-tomcat,configure-web-server"
    11531188    description="If you have changed any of the Tomcat properties in the build.properties file, run this target to update the Tomcat configuration, and any Greenstone configuration files that specify the server address">
    11541189  </target>
Note: See TracChangeset for help on using the changeset viewer.