Changeset 14165

Show
Ignore:
Timestamp:
06.06.2007 15:33:06 (12 years ago)
Author:
oranfry
Message:

updated the build script to work with svn

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/build.xml

    r13926 r14165  
    1010<project name="greenstone3" default="usage" basedir="."> 
    1111 
    12  <!-- ============ self defined tasks =================== --> 
    13  
    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"/> 
    16  
     12    <!-- ============ classpath =================== --> 
     13    <path id="project.classpath"> 
     14       <fileset dir="svnant/lib"> 
     15          <include name="**/*.jar"/> 
     16       </fileset> 
     17    </path> 
     18 
     19    <!-- ============ self defined tasks =================== --> 
     20 
     21    <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/> 
     22    <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/> 
     23    <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/> 
    1724 
    1825 
     
    7077  <property name="app.version"   value="3.02"/> 
    7178 
    72   <property name="cvs.root" value=":pserver:cvs_anon@cvs.scms.waikato.ac.nz:2402/usr/local/global-cvs/gsdl-src"/> 
     79  <property name="svn.root" value="http://puka.cs.waikato.ac.nz/svn/greenstone"/> 
     80<!--  <property name="cvs.root" value=":pserver:cvs_anon@cvs.scms.waikato.ac.nz:2402/usr/local/global-cvs/gsdl-src"/> --> 
    7381  <!-- catalina home is set to tomcat basedir is already installed, otherwise 
    7482  use greenstone's tomcat --> 
     
    253261 
    254262  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections" 
    255     description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this."> 
     263    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this."> 
     264<!--  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections" 
     265    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this.">--> 
     266 
    256267    <!-- make sure .sh files are executable --> 
    257268    <chmod dir="${basedir}" perm="ugo+rx"  
     
    263274    description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/> 
    264275   
    265   <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web" 
    266     description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/> 
     276<!--  <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web" 
     277    description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>--> 
     278  <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-gs2building,svnupdate-web" 
     279    description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/> 
     280 
    267281 
    268282  <target name="configure-c++" depends="init,configure-packages,configure-core,configure-gs2building" 
     
    278292    description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/> 
    279293     
    280   <target name="update" depends="init,cvsupdate,clean,configure,configure-c++,compile"  
    281     description="Update (thru CVS) all the source (including core, packages and gs2building), then clean, configure and recompile."/> 
     294  <target name="update" depends="init,svnupdate,clean,configure,configure-c++,compile"  
     295    description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile."/> 
    282296 
    283297  <target name="start" depends="init,start-tomcat" 
     
    327341  </target> 
    328342 
    329   <target name="check-cvsroot"> 
    330     <condition property="cvsroot.notset"> 
     343<!--  <target name="check-cvsroot"> 
     344    <condition property="svnroot.notset"> 
    331345      <or> 
    332     <not> 
    333       <isset property="env.CVSROOT"/> 
    334     </not> 
    335     <equals arg1="" arg2="${env.CVSROOT}"/> 
     346            <not> 
     347              <isset property="env.CVSROOT"/> 
     348            </not> 
     349            <equals arg1="" arg2="${env.CVSROOT}"/> 
    336350      </or> 
    337351    </condition> 
    338352    <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/> 
    339   </target> 
     353  </target> --> 
    340354 
    341355  <!-- this sets up some initial properties --> 
     
    477491  </target> 
    478492 
    479   <target name="cvsupdate-web" unless="nocvs.mode"> 
    480     <cvs command="update -dP" dest="${web.home}"/> 
    481   </target> 
    482  
    483   <target name="update-web" depends="init,cvsupdate-web,configure-web" 
     493    <target name="svnupdate-web" unless="nosvn.mode"> 
     494        <svn> 
     495            <update dir="${web.home}"/> 
     496        </svn> 
     497    </target> 
     498 
     499  <target name="update-web" depends="init,svnupdate-web,configure-web" 
    484500    description="update only the web stuff (config files)"/> 
    485501 
     
    734750  <target name="prepare-core" unless="nocvs.mode"> 
    735751    <!-- just get rid of empty directories--> 
    736     <cvs command="update -P"/> 
     752    <svn> 
     753        <update dir="."/> 
     754    </svn> 
    737755  </target> 
    738756   
    739757  <target name="configure-core"/> 
    740758 
    741   <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core" 
     759  <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core" 
    742760    description="Update only the Greenstone core" /> 
    743761   
    744   <target name="cvsupdate-core" unless="nocvs.mode"> 
    745     <cvs command="update -l"/> 
    746     <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/> 
     762  <target name="svnupdate-core" unless="nocvs.mode"> 
     763 
     764    <svn> 
     765        <update dir="." recurse="false"/> 
     766    </svn> 
     767 
     768   <svn> 
     769        <update dir="bin"/> 
     770        <update dir="comms"/> 
     771        <update dir="dist-resources"/> 
     772        <update dir="docs"/> 
     773        <update dir="lib"/> 
     774        <update dir="resources"/> 
     775        <update dir="src"/> 
     776        <update dir="winutil"/> 
     777    </svn> 
     778 
    747779  </target> 
    748780 
     
    834866  <target name="prepare-packages" depends="init,prepare-indexers"/> 
    835867   
    836   <target name="checkout-indexers" depends="check-cvsroot,init" if="independent-indexers" unless="nocvs.mode"> 
    837     <cvs command="checkout -P" package="indexers" dest="${src.packages.home}"/> 
     868  <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nocvs.mode"> 
     869<!--  <target name="checkout-indexers" depends="check-svnroot,init" if="independent-indexers" unless="nocvs.mode"> --> 
     870    <svn> 
     871        <checkout url="${svn.root}/indexers/trunk" dest="${src.packages.home}/indexers"/> 
     872    </svn> 
    838873  </target> 
    839874   
     
    842877  </target> 
    843878 
    844   <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages" 
     879  <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages" 
    845880    description="Update only the source packages"/> 
    846881 
    847   <target name="cvsupdate-packages" unless="nocvs.mode">  
    848     <cvs command="update -dP" dest="${src.packages.home}"/> 
     882  <target name="svnupdate-packages" unless="nocvs.mode">  
     883   <svn> 
     884        <update dir="${src.packages.home}"/> 
     885    </svn> 
    849886  </target> 
    850887   
     
    867904     <arg value="--with-gdbm=${gdbm.installed.path}"/> 
    868905    </exec>     
    869      
    870   </target> 
    871   <target name="configure-indexers" depends="init" if="independent-indexers"> 
    872     <echo> 
    873       Configuring Indexers 
    874     </echo> 
    875     <exec executable="${indexers.home}/configure" os="${os.unix}" 
    876       dir="${indexers.home}"> 
    877       <arg value="--prefix=${basedir}"/> 
    878       <arg value="--libdir=${lib.jni}"/> 
    879     </exec>           
    880   </target> 
     906  </target> 
     907 
     908<!-- Message from oran. I removed the condition from this line becuase it meant 
     909    the indexers would only be configured if collection building was DISabled. 
     910    Shouldn't they be configured when collection building is ENabled? --> 
     911 
     912<!--    <target name="configure-indexers" depends="init" if="independent-indexers"> --> 
     913<target name="configure-indexers" depends="init"> 
     914        <echo>Configuring Indexers</echo> 
     915        <exec executable="${indexers.home}/configure" os="${os.unix}" dir="${indexers.home}"> 
     916            <arg value="--prefix=${basedir}"/> 
     917            <arg value="--libdir=${lib.jni}"/> 
     918        </exec>           
     919    </target> 
    881920 
    882921  <target name="clean-packages" depends="init,clean-javagdbm,clean-indexers" description="Clean only the packages"/> 
     
    901940  </target> 
    902941    
    903   <target name="compile-packages" 
    904     description="Compile only the source packages">     
    905     <!-- javagdbm --> 
    906     <exec executable="make" os="${os.unix}" 
    907       dir="${javagdbm.home}"> 
    908     </exec> 
    909     <exec executable="make" os="${os.unix}" 
    910       dir="${javagdbm.home}"> 
    911       <arg value="install"/> 
    912     </exec> 
    913     <!-- windows: just the java stuff. --> 
    914     <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" 
    915       dir="${javagdbm.home}"> 
    916       <arg value="compile"/> 
    917       <arg value="javaonly"/> 
    918     </exec> 
    919     <!-- install the jar file --> 
    920     <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/> 
    921      
    922     <!-- Indexers --> 
    923     <!-- this may be in gs2build - we will be recompiling, but never mind --> 
    924     <exec executable="make" os="${os.unix}" 
    925       dir="${indexers.home}"> 
    926     </exec> 
    927     <exec executable="make" os="${os.unix}" 
    928       dir="${indexers.home}"> 
    929       <arg value="install"/> 
    930     </exec> 
    931     <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" 
    932        dir="${indexers.home}"> 
    933        <arg value="all"/> 
    934     </exec> 
    935     <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" 
    936        dir="${indexers.home}"> 
    937        <arg value="install"/> 
    938     </exec> 
    939     <!-- install the jar and jni files --> 
    940     <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/> 
    941     <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/> 
    942     <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/> 
    943     <antcall target="install-jni-files"/> 
    944   </target> 
     942    <target name="compile-packages" description="Compile only the source packages"> 
     943 
     944        <!-- javagdbm --> 
     945        <echo>compile javagdbm</echo> 
     946        <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"/> 
     947        <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"> 
     948            <arg value="install"/> 
     949        </exec> 
     950 
     951        <!-- windows: just the java stuff. --> 
     952        <echo>Windows: compile javagdbm (java only)</echo> 
     953        <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}"> 
     954            <arg value="compile"/> 
     955            <arg value="javaonly"/> 
     956        </exec> 
     957 
     958        <!-- install the jar file --> 
     959        <echo>Install the javagdbm jar file</echo> 
     960        <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/> 
     961 
     962        <!-- Indexers --> 
     963 
     964        <!-- this may be in gs2build - we will be recompiling, but never mind --> 
     965        <echo>Indexers: make (from ${indexers.home})</echo> 
     966        <exec executable="make" os="${os.unix}" dir="${indexers.home}"/> 
     967        <echo>Indexers: make install</echo> 
     968        <exec executable="make" os="${os.unix}" dir="${indexers.home}"> 
     969            <arg value="install"/> 
     970        </exec> 
     971 
     972        <echo>Indexers: make</echo> 
     973        <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}"> 
     974            <arg value="all"/> 
     975        </exec> 
     976        <echo>Indexers: make install</echo> 
     977        <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}"> 
     978            <arg value="install"/> 
     979        </exec> 
     980 
     981        <!-- install the jar and jni files --> 
     982        <echo>Install the indexers' jar and jni files</echo> 
     983        <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/> 
     984        <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/> 
     985        <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/> 
     986        <antcall target="install-jni-files"/> 
     987    </target> 
    945988 
    946989  <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/> 
     
    9691012 
    9701013  <target name="update-gs2building" if="collection.building.enabled"  
    971     depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building" 
     1014    depends="init,svnupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building" 
    9721015    description="Update only the Greenstone 2 building components"/> 
    9731016 
    974   <target name="cvsupdate-gs2building" if="collection.building.enabled" depends="init,cvsupdate-gs2build,cvsupdate-gli" unless="nocvs.mode"> 
    975   </target> 
    976   <target name="cvsupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode"> 
     1017  <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nocvs.mode"> 
     1018  </target> 
     1019  <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode"> 
    9771020    <!-- Note: can't do a -d update here cos it will get all of gsdl  
    9781021     also, an update doesn't get new files, so we do a checkout instead. --> 
    979     <cvs command="checkout -P" package="gs2build" dest="${basedir}"/> 
    980   </target> 
    981    
    982   <target name="cvsupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode"> 
    983     <cvs command="update -dP" dest="${gli.home}"/> 
     1022        <antcall target="checkout-gs2build"/> 
     1023  </target> 
     1024   
     1025  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode"> 
     1026    <svn> 
     1027        <update dir="${gli.home}"/> 
     1028    </svn> 
    9841029  </target> 
    9851030 
     
    9871032  </target> 
    9881033 
    989   <target name="checkout-gs2build" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> 
     1034  <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nocvs.mode"> 
     1035<!--  <target name="checkout-gs2build" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> --> 
    9901036    <echo>checking out gs2build</echo> 
    991     <cvs command="checkout -P" package="gs2build"/> 
    992   </target> 
     1037        <!-- svn checkouts --> 
     1038        <svn> 
     1039            <!-- perllib --> 
     1040            <checkout url="${svn.root}/gsdl/trunk/perllib" destPath="gs2build/perllib"/> 
     1041 
     1042            <!-- selected packages --> 
     1043            <checkout url="${svn.root}/gsdl/trunk/packages/cpan" destPath="gs2build/packages/cpan"/> 
     1044            <checkout url="${svn.root}/gsdl/trunk/packages/expat" destPath="gs2build/packages/expat"/> 
     1045            <checkout url="${svn.root}/gsdl/trunk/packages/html-tidy" destPath="gs2build/packages/html-tidy"/> 
     1046            <checkout url="${svn.root}/gsdl/trunk/packages/isis-gdl" destPath="gs2build/packages/isis-gdl"/> 
     1047            <checkout url="${svn.root}/gsdl/trunk/packages/kea" destPath="gs2build/packages/kea"/> 
     1048            <checkout url="${svn.root}/gsdl/trunk/packages/pdftohtml" destPath="gs2build/packages/pdftohtml"/> 
     1049            <checkout url="${svn.root}/gsdl/trunk/packages/rtftohtml" destPath="gs2build/packages/rtftohtml"/> 
     1050            <checkout url="${svn.root}/gsdl/trunk/packages/w3mir" destPath="gs2build/packages/w3mir"/> 
     1051            <checkout url="${svn.root}/gsdl/trunk/packages/wget" destPath="gs2build/packages/wget"/> 
     1052            <checkout url="${svn.root}/gsdl/trunk/packages/windows" destPath="gs2build/packages/windows"/> 
     1053            <checkout url="${svn.root}/gsdl/trunk/packages/wv" destPath="gs2build/packages/wv"/> 
     1054            <checkout url="${svn.root}/gsdl/trunk/packages/xlhtml" destPath="gs2build/packages/xlhtml"/> 
     1055            <checkout url="${svn.root}/gsdl/trunk/packages/yaz" destPath="gs2build/packages/yaz"/> 
     1056             
     1057            <!-- some of src (db2txt hashfile phind txt2db) --> 
     1058            <checkout url="${svn.root}/gsdl/trunk/src/db2txt" destPath="gs2build/src/db2txt"/> 
     1059            <checkout url="${svn.root}/gsdl/trunk/src/hashfile" destPath="gs2build/src/hashfile"/> 
     1060            <checkout url="${svn.root}/gsdl/trunk/src/phind" destPath="gs2build/src/phind"/> 
     1061            <checkout url="${svn.root}/gsdl/trunk/src/txt2db" destPath="gs2build/src/txt2db"/> 
     1062 
     1063            <!-- bin --> 
     1064            <checkout url="${svn.root}/gsdl/trunk/bin/script" destPath="gs2build/bin/script"/> 
     1065 
     1066            <!-- mappings --> 
     1067            <checkout url="${svn.root}/gsdl/trunk/mappings" destPath="gs2build/mappings"/> 
     1068 
     1069            <!-- etc/packages --> 
     1070            <checkout url="${svn.root}/gsdl/trunk/etc/packages" destPath="gs2build/etc/packages"/> 
     1071     
     1072            <!-- collect --> 
     1073            <checkout url="${svn.root}/gsdl/trunk/collect/modelcol" destPath="gs2build/collect/modelcol"/> 
     1074 
     1075            <!-- gs2build-extra --> 
     1076            <checkout url="${svn.root}/other-projects/trunk/gs2build-extra" destPath="gs2build/gs2build-extra"/> 
     1077 
     1078            <!-- indexers --> 
     1079            <checkout url="${svn.root}/indexers/trunk" destPath="gs2build/indexers"/> 
     1080 
     1081 
     1082        </svn> 
     1083        <!-- regular downloads --> 
     1084 
     1085        <!-- some files from lib --> 
     1086        <mkdir dir="gs2build/lib"/> 
     1087        <get src="${svn.root}/gsdl/trunk/lib/text_t.h" dest="gs2build/lib/text_t.h"/> 
     1088        <get src="${svn.root}/gsdl/trunk/lib/text_t.cpp" dest="gs2build/lib/text_t.cpp"/> 
     1089        <get src="${svn.root}/gsdl/trunk/lib/gsdlconf.h" dest="gs2build/lib/gsdlconf.h"/> 
     1090 
     1091        <!-- some files from etc --> 
     1092        <get src="${svn.root}/gsdl/trunk/etc/marctodc.txt" dest="gs2build/etc/marctodc.txt"/> 
     1093        <get src="${svn.root}/gsdl/trunk/etc/dc2marc-mapping.xml" dest="gs2build/etc/dc2marc-mapping.xml"/> 
     1094        <get src="${svn.root}/gsdl/trunk/etc/dc2marc.xsl" dest="gs2build/etc/dc2marc.xsl"/> 
     1095        <get src="${svn.root}/gsdl/trunk/etc/qdc2marc-mapping.xml" dest="gs2build/etc/qdc2marc-mapping.xml"/> 
     1096 
     1097        <!-- some files from the gsdl root directory --> 
     1098        <get src="${svn.root}/gsdl/trunk/setup.bash" dest="gs2build/setup.bash"/> 
     1099        <get src="${svn.root}/gsdl/trunk/config.sub" dest="gs2build/config.sub"/> 
     1100        <get src="${svn.root}/gsdl/trunk/config.guess" dest="gs2build/config.guess"/> 
     1101        <get src="${svn.root}/gsdl/trunk/config.h.in" dest="gs2build/config.h.in"/> 
     1102        <get src="${svn.root}/gsdl/trunk/configtest.pl" dest="gs2build/configtest.pl"/> 
     1103        <get src="${svn.root}/gsdl/trunk/install-sh" dest="gs2build/install-sh"/> 
     1104        <get src="${svn.root}/gsdl/trunk/acconfig.h" dest="gs2build/acconfig.h"/> 
     1105        <get src="${svn.root}/gsdl/trunk/aclocal.m4" dest="gs2build/aclocal.m4"/> 
     1106        <get src="${svn.root}/gsdl/trunk/WIN32cfg.h" dest="gs2build/WIN32cfg.h"/> 
     1107 
     1108    </target> 
    9931109 
    9941110  <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present"> 
     
    10041120  <target name="checkout-winbin" depends="init" if="current.os.iswindows"  
    10051121    unless="nocvs.mode"> 
    1006     <cvs command="checkout -P" package="winbin"/> 
     1122    <svn> 
     1123        <checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin"/> 
     1124    </svn>   
    10071125  </target> 
    10081126   
     
    10901208  </target> 
    10911209   
    1092   <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> 
     1210<!--  <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> --> 
     1211  <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nocvs.mode"> 
    10931212    <echo>checking out gli</echo> 
    1094     <cvs command="checkout -P" package="gli"/> 
     1213    <svn> 
     1214        <checkout url="${svn.root}/gli/trunk" destPath="gli"/> 
     1215    </svn> 
    10951216  </target> 
    10961217