Ignore:
Timestamp:
2007-02-16T10:56:11+13:00 (15 years ago)
Author:
kjdon
Message:

changed the java version stuff. now always install the compat package - doesn't seem to affect in java 1.5. other packages on the web do this. xercesImpl and xml-apis not needed in applet dir cos already there in tomcat. xalan.jar is the only file that needs to change based on java version - we need it for 1.5 and can't have it for 1.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/build.xml

    r13921 r13925  
    397397 <!-- ========== Web app Targets ================================ -->
    398398 
    399   <target name="prepare-web" depends="init">
     399  <target name="prepare-web" depends="init,configure-java-version">
    400400    <mkdir dir="${web.home}/applet"/>
    401401    <mkdir dir="${web.home}/logs"/>
    402     <condition property="need.xml.jars">
     402  </target>
     403 
     404  <!-- 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 -->
     405  <target name="configure-java-version" depends="init"
     406    description="Run this target if you have changed the default version of java since installing greenstone3">
     407    <condition property="need.xalan.jar">
    403408      <equals arg1="1.5" arg2="${ant.java.version}"/>
    404409    </condition>
    405     <antcall target="activate-xml-jars"/>
    406     <antcall target="deactivate-xml-jars"/>
    407   </target>
    408  
    409   <target name="configure-java-version" depends="init"
    410     description="Run this target if you have changed the default version of java since installing greenstone3">
    411     <condition property="need.xml.jars">
    412       <equals arg1="1.5" arg2="${ant.java.version}"/>
    413     </condition>
    414     <antcall target="activate-xml-jars"/>
    415     <antcall target="deactivate-xml-jars"/>
    416     <condition property="need.tomcat.compat">
    417       <equals arg1="1.5" arg2="${ant.java.version}"/>
    418     </condition>
    419     <antcall target="install-tomcat-compat"/>
    420     <antcall target="uninstall-tomcat-compat"/>
    421   </target>
    422  
    423   <target name="activate-xml-jars" if="need.xml.jars">
     410    <antcall target="activate-xalan-jar"/>
     411    <antcall target="deactivate-xalan-jar"/>
     412  </target>
     413 
     414  <target name="activate-xalan-jar" if="need.xalan.jar">
    424415    <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
    425     <copy file="${web.lib}/xercesImpl.jar.tmp" tofile="${web.lib}/xercesImpl.jar"/>
    426   </target>
    427  
    428   <target name="deactivate-xml-jars" unless="need.xml.jars">
     416  </target>
     417 
     418  <target name="deactivate-xalan-jar" unless="need.xalan.jar">
    429419    <delete file="${web.lib}/xalan.jar"/>
    430     <delete file="${web.lib}/xercesImpl.jar"/>
    431420  </target>
    432421
     
    498487<!-- ======================= Tomcat Targets ========================== -->
    499488 
    500   <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
    501   <target name="prepare-tomcat" depends="init,download-tomcat" if="tomcat.islocal">
    502     <condition property="need.tomcat.compat">
    503       <equals arg1="1.4" arg2="${ant.java.version}"/>
    504     </condition>
    505     <antcall target="install-tomcat-compat"/>
    506   </target>
    507 
    508   <target name="download-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
     489  <!-- this target downloads and installs Tomcat -->
     490  <!-- we download tomcat and the compat module - its needed for 1.4, and doesn't seem to harm 1.5 -->
     491  <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
     492
    509493    <!-- check that packages dir is there -->
    510494    <mkdir dir="${packages.home}"/>
     
    512496      dest="${packages.home}/apache-tomcat-5.5.12.zip"
    513497      usetimestamp="true"/>
    514     <delete dir="${packages.home}/tomcat.bak"/>
    515     <move todir="${packages.home}/tomcat.bak" failonerror="false">
    516       <fileset dir="${packages.home}/tomcat"/>
    517     </move>
    518498    <unzip src="${packages.home}/apache-tomcat-5.5.12.zip"
    519499      dest="${packages.home}"/>
     500    <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12-compat.zip"
     501      dest="${packages.home}/apache-tomcat-5.5.12-compat.zip"
     502      usetimestamp="true"/>
     503    <unzip src="${packages.home}/apache-tomcat-5.5.12-compat.zip"
     504      dest="${packages.home}"/>
     505    <!-- delete any existing tomcat -->
     506    <delete dir="${packages.home}/tomcat"/>
    520507    <move todir="${packages.home}/tomcat">
    521508      <fileset dir="${packages.home}/apache-tomcat-5.5.12"/>
     
    529516    <!-- make sure we have execute permission for the .sh files -->
    530517    <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
    531       includes="*.sh"/>
    532    
    533     <!-- download the compat module but don't install it unless necessary -->
    534     <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12-compat.zip"
    535       dest="${packages.home}/apache-tomcat-5.5.12-compat.zip"
    536       usetimestamp="true"/>
    537     <unzip src="${packages.home}/apache-tomcat-5.5.12-compat.zip"
    538       dest="${packages.home}"/>
    539     <move todir="${packages.home}/tomcat-compat">
    540       <fileset dir="${packages.home}/apache-tomcat-5.5.12"/>
    541     </move>
    542   </target>
    543 
    544  
    545   <target name="install-tomcat-compat" if="need.tomcat.compat">
    546     <copy file="${packages.home}/tomcat-compat/common/endorsed/xml-apis.jar"
    547       tofile="${web.applet}/xml-apis.jar"/>
    548     <copy file="${packages.home}/tomcat-compat/common/endorsed/xml-apis.jar"
    549       tofile="${packages.home}/tomcat/common/endorsed/xml-apis.jar"/>   
    550     <copy file="${packages.home}/tomcat-compat/common/endorsed/xercesImpl.jar"
    551       tofile="${web.applet}/xercesImpl.jar"/>
    552     <copy file="${packages.home}/tomcat-compat/common/endorsed/xercesImpl.jar"
    553       tofile="${packages.home}/tomcat/common/endorsed/xercesImpl.jar"/>
    554     <copy file="${packages.home}/tomcat-compat/bin/jmx.jar"
    555       tofile="${packages.home}/tomcat/bin/jmx.jar"/>
    556   </target>
    557   <target name="uninstall-tomcat-compat" unless="need.tomcat.compat">
    558     <delete file="${web.applet}/xml-apis.jar"/>
    559     <delete file="${packages.home}/tomcat/common/endorsed/xml-apis.jar"/>   
    560     <delete file="${web.applet}/xercesImpl.jar"/>
    561     <delete file="${packages.home}/tomcat/common/endorsed/xercesImpl.jar"/>
    562     <delete file="${packages.home}/tomcat/bin/jmx.jar"/>
     518      includes="*.sh"/>   
    563519  </target>
    564520 
     
    585541    <!-- need to edit the config file, or do we get the user to do this???-->
    586542  </target>
    587  
    588   <target name="reload" description="Reload web application"
    589           depends="init,setup-catalina-ant-tasks">
    590     <reload  url="http://${tomcat.server}:${tomcat.port}/manager" username="admin" password="admin"
    591             path="${app.path}"/>
    592   </target>
    593  
     543   
    594544  <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
    595545   <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
     
    844794      </manifest>
    845795    </jar>
     796    <mkdir dir="${web.applet}"/>
    846797    <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
    847798    <jar destfile="${build.home}/anttasks.jar">
Note: See TracChangeset for help on using the changeset viewer.