Ignore:
Timestamp:
2008-05-01T12:43:45+12:00 (16 years ago)
Author:
ak19
Message:

Uses the get Task instead of the copy Task when doing ant update to get dependency files from the Greenstone SVN repository. Even make-dist which uses tarfileset and zipfileset appears to work with ant 1.6.5 now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/gs3-webservices-democlient/build.xml

    r15313 r15319  
    3434 <property name="dist.dir.name" value="gs3-webservices-democlient" />
    3535
    36  <!-- svn paths for getting copies of the latest version of source code -->
    37  <property name="gs3forclient.svn.path" value="http://svn.greenstone.org/greenstone3/trunk/src/java/org/greenstone/gsdl3/util/"/>
     36 <!-- svn url locations for obtaining copies of the latest version of source code dependencies -->
     37 <property name="gs3forclient.svn.path" value="http://svn.greenstone.org/greenstone3/trunk/src/java/org/greenstone/gsdl3/util"/>
    3838 <property name="check.java.version.svn.file" value="http://svn.greenstone.org/gli/trunk/CheckJavaVersion.java"/>
    3939
     
    6363    <echo>- ant dist-clean</echo>
    6464    <echo>  for deleting the *.class files from the sources, the QBRdata.jar, fedoraGS3.jar, executable jar file, and any zips of the project folder</echo>
     65        <echo>- ant update</echo>
     66        <echo>  for getting the latest version of CheckJavaVersion.java, and the files for creating the gs3_for_client.jar dependency from Greenstone's SVN repository</echo>
    6567</target>
    6668
    6769
    6870<!-- Main targets: to build the GS3 web services demo-client and to create the tar.gz file for downloading -->
    69 <target name="build-demo-client" description="Creates the jar distribution file" depends="compile-demo-client,ensure-check-java-version">
     71<target name="build-demo-client" description="Creates the jar distribution file" depends="compile-demo-client,update-check-java-version">
    7072  <mkdir dir="${basedir}/logs" /> <!-- Need a logs dir for outputting log4j stuff-->
    7173  <delete file="${exec.jar.name}" /> <!--For now: Let's delete it first and do a fresh rebuild-->
     
    8082
    8183<target name="make-dist" description="Generates the zip file of the lib and src folders and the executable ${exec.jar.name} file" depends="get-zipformat,ensure-exec-jar" if="zip.type">
    82      <mkdir dir="${dist}" />
    83      <antcall target="create-${zip.type}"/>
    84 </target>
    85 
    86 <!-- Compilation first ensures the existence of QBRdata.jar AND fedoraGS3.jar by checking whether these jars exist and if not, generating them. Then actual compilation of the GS3democlient starts. By now the QBRdata classes of the GS3democlient src folder would have been compiled, but that does not matter as javac only compiles when class files that are outdated or when they have not been generated yet.-->
     84   <mkdir dir="${dist}" />
     85   <antcall target="create-${zip.type}"/>
     86</target>
     87
     88<!-- Compilation first ensures the existence of QBRdata.jar AND fedoraGS3.jar by checking whether these jars already exist and, if not, generating them. It is then that the actual compilation of the GS3democlient starts. By now the QBRdata classes of the GS3democlient src folder would have been compiled, but that does not matter as javac only compiles when class files are outdated or when they have not been generated yet.-->
    8789<target name="compile-demo-client" description="Compiles the GS3 demo-client" depends="ensure-QBRdata-jar,ensure-fedoraGS3-jar,ensure-gs3-for-client">
    8890    <javac srcdir="${democlient.rootdir}">
     
    105107</target>
    106108
    107 <!-- Explicit update. First make a directory and copy the old files in there (if they are present)-->
     109<target name="dist-clean" description="Removes the project-specific jars fedoraGS3.jar, QBRdata.jar, ${exec.jar.name} files AND all class files from the GS3DemoClient and GS3Fedora source folders" depends="clean">
     110   <delete includeEmptyDirs="true" failonerror="false">
     111    <fileset file="${basedir}/lib/fedoraGS3.jar"/>
     112    <fileset file="${basedir}/lib/QBRdata.jar"/>
     113    <fileset file="${basedir}/${exec.jar.name}"/>
     114    <fileset file="${basedir}/gs3democlient.properties"/>
     115    <fileset dir="logs"/>
     116    <fileset file="${log4j.propFile}"/>
     117    <fileset file="${dist}/${dist.zip.name}.tar"/>
     118    <fileset file="${dist}/${dist.zip.name}.tar.gz"/>
     119    <fileset file="${dist}/${dist.zip.name}.zip"/>
     120    <fileset file="${dist}/${dist.zip.name}.tar.bz2"/>
     121   </delete>
     122</target>
     123
     124<!-- Targets for updating some source code dependencies from Greenstone SVN -->
     125<!-- Explicit update of java file dependencies. First make a directory and copy the old files in there (if they are present)-->
    108126<target name="update" description="Gets the latest version of CheckJavaVersion.java, and gs3-client-jar's files from Greenstone's SVN repository">
    109127   <delete>
     
    114132</target>
    115133
    116 <target name="ensure-check-java-version" description="Ensures the file CheckJavaVersion.java is there">
    117     <condition property="check.java.version.exists">
    118        <and>
    119     <available file="${basedir}/CheckJavaVersion.java"/>
    120         <available file="${basedir}/CheckJavaVersion.class"/>
    121        </and>
    122     </condition>
    123     <antcall target="update-check-java-version" />
    124 </target>
    125 
    126134<target name="ensure-gs3-for-client" description="Ensures the ${gs3.files.jar} file of required Greenstone3 support files is there">
    127135    <condition property="gs3.for.client.exists">
     
    131139</target>
    132140
    133 
    134 <!-- "By default, files are only copied if the source file is newer than the destination file, or when the destination file does not exist. (However, you can explicitly overwrite files with the overwrite attribute.)" In other words, this method will only copy when necessary -->
    135 <target name="update-check-java-version" description="Gets the latest version of CheckJavaVersion.javafrom Greenstone's SVN repository" unless="check.java.version.exists">
    136    <copy todir="${basedir}" flatten="true">
    137     <resources>
    138       <url url="${check.java.version.svn.file}"/>
    139     </resources>
    140   </copy>
     141<!-- Gets the file if the local copy is missing or out of date (since usetimestamp=true) -->
     142<target name="update-check-java-version" description="Gets the latest version of CheckJavaVersion.javafrom Greenstone's SVN repository">
     143  <get src="${check.java.version.svn.file}"
     144    dest="${basedir}/CheckJavaVersion.java"
     145    usetimestamp="true" />
    141146  <!-- compile it up: specifying the file to be compiled explicitly (sourcepath="")-->
    142147  <javac sourcepath="" srcdir="${basedir}" destdir="${basedir}" >
     
    148153  <mkdir dir="${basedir}/tmp" />
    149154  <echo>Getting java files GSXML, XMLConverter, GSPath and MyNodeList from Greenstone's SVN repository (${gs3forclient.svn.path}). Compiling and jarring them up into ${gs3.files.jar}...</echo>
    150   <copy todir="${basedir}/tmp" flatten="true">
    151     <resources>
    152       <url url="${gs3forclient.svn.path}/GSXML.java"/>
    153       <url url="${gs3forclient.svn.path}/XMLConverter.java"/>
    154       <url url="${gs3forclient.svn.path}/GSPath.java"/>
    155       <url url="${gs3forclient.svn.path}/MyNodeList.java"/>
    156     </resources>
    157   </copy>
     155  <!-- No point using timestamp here with the get Task, since the tmp file is newly created and will not already have these java files. Get will therefore always retrieve them -->
     156  <get src="${gs3forclient.svn.path}/GSXML.java" dest="${basedir}/tmp/GSXML.java" />
     157  <get src="${gs3forclient.svn.path}/XMLConverter.java" dest="${basedir}/tmp/XMLConverter.java" />
     158  <get src="${gs3forclient.svn.path}/GSPath.java" dest="${basedir}/tmp/GSPath.java" />
     159  <get src="${gs3forclient.svn.path}/MyNodeList.java" dest="${basedir}/tmp/MyNodeList.java" />
    158160  <!-- compile it up: specifying the file to be compiled explicitly -->
    159161  <javac srcdir="${basedir}/tmp" destdir="${basedir}/tmp" >
     
    166168</target>
    167169
    168 <target name="dist-clean" description="Removes the project-specific jars fedoraGS3.jar, QBRdata.jar, ${exec.jar.name} files AND all class files from the GS3DemoClient and GS3Fedora source folders" depends="clean">
    169    <delete includeEmptyDirs="true" failonerror="false">
    170     <fileset file="${basedir}/lib/fedoraGS3.jar"/>
    171     <fileset file="${basedir}/lib/QBRdata.jar"/>
    172     <fileset file="${basedir}/${exec.jar.name}"/>
    173     <fileset file="${basedir}/gs3democlient.properties"/>
    174     <fileset dir="logs"/>
    175     <fileset file="${log4j.propFile}"/>
    176     <fileset file="${dist}/${download.zip.name}.tar"/>
    177     <fileset file="${dist}/${download.zip.name}.tar.gz"/>
    178     <fileset file="${dist}/${download.zip.name}.zip"/>
    179     <fileset file="${dist}/${download.zip.name}.tar.bz2"/>
    180    </delete>
    181 </target>
    182 
    183170<!-- Targets to generate the project-specific jar files QBRdata.jar and fedoraGS3.jar -->
    184171<target name="QBRdatajar" description="Compiles and creates the QBRdata.jar file needed by GS3demo-client">
    185172   <javac srcdir="${democlient.rootdir}/${QBRdata.rel.path}">
    186173      <classpath refid="project.classpath"/>
    187     </javac>
    188   <delete file="lib/QBRdata.jar" /> <!--For now: Let's delete it first and do a fresh rebuild-->
    189   <jar destfile="lib/QBRdata.jar"
     174   </javac>
     175   <delete file="lib/QBRdata.jar" /> <!--For now: Let's delete it first and do a fresh rebuild-->
     176   <jar destfile="lib/QBRdata.jar"
    190177     basedir="${democlient.rootdir}/"
    191178     excludes="${gui.rel.path}/*.*,${dlservices.rel.path}/**,${gs3services.rel.path}/**">
    192   </jar>
     179   </jar>
    193180</target>
    194181
Note: See TracChangeset for help on using the changeset viewer.