Changeset 20235 for greenstone3


Ignore:
Timestamp:
2009-08-12T14:30:07+12:00 (12 years ago)
Author:
oranfry
Message:

moved tomcat/java check to init and fixed it up a little

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/build.xml

    r20233 r20235  
    8686  </condition>
    8787
    88   <!--
    89     the next block checks if tomcat is present in the 'packages' directory, and if so, figures
    90     out its major version number (5, 6, etc.)
    91     then it checks if your java is new enough to run that tomcat and if not fails with an explanation
    92   -->
    93   <condition property="packages.tomcat.ispresent" value="true" else="false">
    94     <available file="packages/tomcat"/>
    95   </condition>
    96 
    97   <if><bool><istrue value="${packages.tomcat.ispresent}"/></bool>
    98     <exec os="${os.unix}" outputproperty="packages.tomcat.detected.version" dir="packages/tomcat/bin" executable="sh">
    99       <arg value="-c"/>
    100       <arg value="./catalina.sh version | grep '^Server version: ' | sed 's@[^0-9]*\([0-9]\).*@\1@g'"/>
    101     </exec>
    102     <!--
    103     totally untested, so commented out for now
    104     <exec os="${os.windows}" outputproperty="packages.tomcat.detected.version" dir="packages/tomcat/bin" executable="cmd.exe">
    105       <arg value="/c"/>
    106       <arg value="catalina.bat version | grep '^Server version: ' | sed 's@[^0-9]*\([0-9]\).*@\1@g'"/>
    107     </exec>
    108     -->
    109     <property name="packages.tomcat.detected.version" value="unknown"/>
    110   </if>
    111 
    112   <if>
    113     <bool>
    114       <and>
    115         <istrue value="${packages.tomcat.ispresent}"/>
    116         <equals arg1="${packages.tomcat.detected.version}" arg2="6"/>
    117         <equals arg1="1.4" arg2="${ant.java.version}"/>
    118       </and>
    119     </bool>
    120     <fail>Your java version (1.4) is too old to work with the bundled version of Apache Tomcat. Please upgrade your java to version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
    121   </if>
    12288
    12389
     
    519485      </and>
    520486    </condition>
     487
     488    <!--
     489      the next block checks if tomcat is present in the 'packages' directory, and if so, figures
     490      out its major version number (5, 6, etc.)
     491      then it checks if your java is new enough to run that tomcat and if not fails with an explanation
     492    -->
     493    <condition property="packages.tomcat.ispresent" value="true" else="false">
     494      <available file="packages/tomcat"/>
     495    </condition>
     496
     497    <if><bool><istrue value="${packages.tomcat.ispresent}"/></bool>
     498      <exec os="${os.unix}" outputproperty="packages.tomcat.detected.version" errorproperty="packages.tomcat.detection.errors" dir="packages/tomcat/bin" executable="sh">
     499        <arg value="-c"/>
     500        <arg value="./catalina.sh version | grep '^Server version: ' | sed 's@[^0-9]*\([0-9]\).*@\1@g'"/>
     501      </exec>
     502      <!--
     503      totally untested, so commented out for now
     504      <exec os="${os.windows}" outputproperty="packages.tomcat.detected.version" dir="packages/tomcat/bin" executable="cmd.exe">
     505        <arg value="/c"/>
     506        <arg value="catalina.bat version | grep '^Server version: ' | sed 's@[^0-9]*\([0-9]\).*@\1@g'"/>
     507      </exec>
     508      -->
     509      <property name="packages.tomcat.detected.version" value="unknown"/>
     510    </if>
     511    <!--
     512    <echo>packages.tomcat.ispresent: ${packages.tomcat.ispresent}</echo>
     513    <echo>packages.tomcat.detected.version: ${packages.tomcat.detected.version}</echo>
     514    <echo>packages.tomcat.detection.error: ${packages.tomcat.detection.errors}</echo>
     515    -->
     516
     517    <if>
     518      <bool>
     519        <or>
     520          <and>
     521            <istrue value="${packages.tomcat.ispresent}"/>
     522            <equals arg1="${packages.tomcat.detected.version}" arg2="6"/>
     523            <equals arg1="1.4" arg2="${ant.java.version}"/>
     524          </and>
     525          <not><equals arg1="${packages.tomcat.detection.errors}" arg2=""/></not>
     526        </or>
     527      </bool>
     528      <fail>Your java version (1.4) is too old to work with the bundled version of Apache Tomcat. Please upgrade your java to version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
     529    </if>
    521530
    522531  </target>
Note: See TracChangeset for help on using the changeset viewer.