Changeset 20085


Ignore:
Timestamp:
2009-07-27T11:10:27+12:00 (12 years ago)
Author:
kjdon
Message:

tidied up some targets. indentation. using else on a condition instead of having two conditions. added a check for env.GSDL3HOME so that people have to run gs3-setup before runnign ant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/build.xml

    r20079 r20085  
    9696  <!-- jar files needed by applets go here -->
    9797  <property name="web.applet" value="${web.home}/applet"/>
     98
    9899  <!-- jar files needed by the servlet (and extra ones) go here -->
    99100  <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
     
    126127  <!-- catalina home is set to tomcat basedir if already installed, otherwise
    127128  use greenstone's tomcat -->
    128   <condition property="catalina.home" value="${tomcat.installed.path}">
     129  <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
    129130    <and>
    130131      <isset property="tomcat.installed.path"/>
     
    135136  </condition>
    136137 
    137   <property name="catalina.home" value="${packages.home}/tomcat"/>
    138 
    139138  <property name="os.linux" value="Linux"/>
    140139  <property name="os.mac" value="Mac OS X"/>
     
    206205  </condition>
    207206 
    208   <condition property="static.arg" value="LDFLAGS=-static">
     207  <condition property="static.arg" value="LDFLAGS=-static" else=" ">
    209208    <isset property="compile.static"/>
    210209  </condition>
    211   <condition property="static.arg" value=" ">
    212     <not>
    213       <isset property="compile.static"/>
    214     </not>
    215   </condition>
    216210 
    217211  <!-- where is search4j tool -->
    218   <condition property="search4j.exec" value="bin/search4j.exe">
     212  <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
    219213    <isset property="current.os.iswindows"/>
    220214  </condition>
    221   <property name="search4j.exec" value="bin/search4j"/>
    222215
    223216 
     
    227220  <property name="gli.home" value="${basedir}/gli"/>
    228221  <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
    229  
    230   <condition property="common.src.home" value="${gs2build.home}/common-src">
    231     <not>
    232       <isset property="disable.collection.building"/>
    233     </not>
    234   </condition>
    235 
    236   <condition property="common.src.home" value="${basedir}/common-src">
     222
     223  <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}/common-src">
    237224    <isset property="disable.collection.building"/>
    238225  </condition>
     
    276263  <!-- All elements that Tomcat 5 exposes to applications -->
    277264  <path id="tomcat5">
    278     <pathelement location="${catalina.home}/common/classes"/>
    279     <fileset dir="${catalina.home}/common/endorsed">
    280       <include name="*.jar"/>
    281     </fileset>
    282     <fileset dir="${catalina.home}/common/lib">
    283       <include name="*.jar"/>
    284     </fileset>
    285     <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
    286     <pathelement location="${catalina.home}/shared/classes"/>
    287     <fileset dir="${catalina.home}/shared/lib">
    288       <include name="*.jar"/>
    289     </fileset>
     265    <pathelement location="${catalina.home}/common/classes"/>
     266    <fileset dir="${catalina.home}/common/endorsed">
     267      <include name="*.jar"/>
     268    </fileset>
     269    <fileset dir="${catalina.home}/common/lib">
     270      <include name="*.jar"/>
     271    </fileset>
     272    <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
     273    <pathelement location="${catalina.home}/shared/classes"/>
     274    <fileset dir="${catalina.home}/shared/lib">
     275      <include name="*.jar"/>
     276    </fileset>
    290277  </path>
    291278 
    292279  <!-- All elements that Tomcat 6 exposes to applications -->
    293280  <path id="tomcat6">
    294     <fileset dir="${catalina.home}/lib">
    295       <include name="*.jar"/>
    296     </fileset>
     281    <fileset dir="${catalina.home}/lib">
     282      <include name="*.jar"/>
     283    </fileset>
    297284  </path>
    298285 
     
    320307    <pathelement location="${lib.jni}/mgpp.jar"/>
    321308   
    322     <!-- Include all elements that Tomcat exposes to applications -->
    323     <path refid="tomcat${tomcat.version.major}"/>
    324 
     309    <!-- Include all elements that Tomcat exposes to applications -->
     310    <path refid="tomcat${tomcat.version.major}"/>
     311   
    325312  </path>
    326313
     
    350337    <echo>os.unix: ${os.unix}</echo>
    351338  </target>
    352 
    353 
     339 
    354340  <!-- ==================== Primary and Global Targets ============================= -->
    355341
     
    454440    <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
    455441  </target>
    456 
    457 
     442 
    458443  <!-- this sets up some initial properties -->
    459444  <target name="init">
    460445
     446    <!-- has the gs3-setup script been run?? -->
     447    <condition property="gs3-setup-not-done">
     448      <not>
     449    <isset property="env.GSDL3HOME"/>
     450      </not>
     451    </condition>
     452
     453    <fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>
     454   
    461455    <condition property="java.too.old">
    462456      <or>
     
    548542    <echo>activating xalan.jar</echo>
    549543    <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
    550     <if>
    551       <bool>
    552         <and>
    553           <isset property="current.os.ismac"/>
    554           <available file="${catalina.home}/common/endorsed" type="dir"/>
    555         </and>
    556       </bool>
    557       <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
     544    <if>
     545      <bool>
     546    <and>
     547      <isset property="current.os.ismac"/>
     548      <available file="${catalina.home}/common/endorsed" type="dir"/>
     549    </and>
     550      </bool>
     551      <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
    558552    </if>
    559553  </target>
    560 
    561   <!-- to delete -->
    562   <target name="copy-xalan-for-mac"></target>
    563554
    564555  <target name="deactivate-xalan-jar">
     
    671662      <unzip src="${packages.home}/${tomcat.version}.zip"
    672663        dest="${packages.home}"/>
    673    
    674         <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
    675         we would need to have the tomcat compat package to work with Java 1.4-->
    676       <if>
    677         <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
    678           <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
    679             dest="${packages.home}/${tomcat.version}-compat.zip"
    680             usetimestamp="true"/>
    681         <unzip src="${packages.home}/${tomcat.version}-compat.zip"
    682             dest="${packages.home}"/>
    683       </if>
    684    
     664     
     665      <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
     666      we would need to have the tomcat compat package to work with Java 1.4-->
     667      <if>
     668    <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
     669    <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
     670      dest="${packages.home}/${tomcat.version}-compat.zip"
     671      usetimestamp="true"/>
     672    <unzip src="${packages.home}/${tomcat.version}-compat.zip"
     673      dest="${packages.home}"/>
     674      </if>
     675     
    685676      <!-- delete any existing tomcat -->
    686677      <delete dir="${packages.home}/tomcat"/>
     
    10181009  <target name="compile-core" depends="init"
    10191010    description="Compile only the Greenstone core">
    1020     <if>
    1021       <!-- Rather than test for tomcat 6, testing here for NOT tomcat 5
    1022         (so that it may hopefully still serve when it becomes tomcat 7) -->
    1023       <bool><not><equals arg1="5" arg2="${tomcat.version.major}"/></not></bool>
    1024         <copy file="${web.lib}/xercesImpl.jar" todir="${catalina.home}/lib"/>
    1025         <copy file="${web.lib}/xml-apis.jar" todir="${catalina.home}/lib"/>
    1026     </if>
     1011    <if>
     1012      <!-- Rather than test for tomcat 6, testing here for NOT tomcat 5
     1013      (so that it may hopefully still serve when it becomes tomcat 7) -->
     1014      <bool><not><equals arg1="5" arg2="${tomcat.version.major}"/></not></bool>
     1015      <copy file="${web.lib}/xercesImpl.jar" todir="${catalina.home}/lib"/>
     1016      <copy file="${web.lib}/xml-apis.jar" todir="${catalina.home}/lib"/>
     1017    </if>
    10271018    <mkdir dir="${build.home}"/>
    10281019    <javac srcdir="${src.home}"
     
    10731064    <if>
    10741065      <bool><istrue value="${tomcat.islocal}"/></bool>
    1075         <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
    1076         <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
     1066      <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
     1067      <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
    10771068    </if>
    10781069
Note: See TracChangeset for help on using the changeset viewer.