Index: other-projects/trunk/gs3-webservices-democlient/build.xml
===================================================================
--- other-projects/trunk/gs3-webservices-democlient/build.xml	(revision 15318)
+++ other-projects/trunk/gs3-webservices-democlient/build.xml	(revision 15319)
@@ -34,6 +34,6 @@
  <property name="dist.dir.name" value="gs3-webservices-democlient" />
 
- <!-- svn paths for getting copies of the latest version of source code -->
- <property name="gs3forclient.svn.path" value="http://svn.greenstone.org/greenstone3/trunk/src/java/org/greenstone/gsdl3/util/"/>
+ <!-- svn url locations for obtaining copies of the latest version of source code dependencies -->
+ <property name="gs3forclient.svn.path" value="http://svn.greenstone.org/greenstone3/trunk/src/java/org/greenstone/gsdl3/util"/>
  <property name="check.java.version.svn.file" value="http://svn.greenstone.org/gli/trunk/CheckJavaVersion.java"/>
 
@@ -63,9 +63,11 @@
 	<echo>- ant dist-clean</echo>
 	<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>	
+        <echo>- ant update</echo> 
+        <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>
 </target>
 
 
 <!-- Main targets: to build the GS3 web services demo-client and to create the tar.gz file for downloading -->
-<target name="build-demo-client" description="Creates the jar distribution file" depends="compile-demo-client,ensure-check-java-version">
+<target name="build-demo-client" description="Creates the jar distribution file" depends="compile-demo-client,update-check-java-version">
   <mkdir dir="${basedir}/logs" /> <!-- Need a logs dir for outputting log4j stuff-->
   <delete file="${exec.jar.name}" /> <!--For now: Let's delete it first and do a fresh rebuild-->
@@ -80,9 +82,9 @@
 
 <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">
-     <mkdir dir="${dist}" />
-     <antcall target="create-${zip.type}"/>
-</target>
-
-<!-- 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.-->
+   <mkdir dir="${dist}" />
+   <antcall target="create-${zip.type}"/>
+</target>
+
+<!-- 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.-->
 <target name="compile-demo-client" description="Compiles the GS3 demo-client" depends="ensure-QBRdata-jar,ensure-fedoraGS3-jar,ensure-gs3-for-client">
     <javac srcdir="${democlient.rootdir}">
@@ -105,5 +107,21 @@
 </target>
 
-<!-- Explicit update. First make a directory and copy the old files in there (if they are present)-->
+<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">
+   <delete includeEmptyDirs="true" failonerror="false">
+    <fileset file="${basedir}/lib/fedoraGS3.jar"/>
+    <fileset file="${basedir}/lib/QBRdata.jar"/>
+    <fileset file="${basedir}/${exec.jar.name}"/>
+    <fileset file="${basedir}/gs3democlient.properties"/>
+    <fileset dir="logs"/>
+    <fileset file="${log4j.propFile}"/>
+    <fileset file="${dist}/${dist.zip.name}.tar"/>
+    <fileset file="${dist}/${dist.zip.name}.tar.gz"/>
+    <fileset file="${dist}/${dist.zip.name}.zip"/>
+    <fileset file="${dist}/${dist.zip.name}.tar.bz2"/>
+   </delete>
+</target>
+
+<!-- Targets for updating some source code dependencies from Greenstone SVN -->
+<!-- Explicit update of java file dependencies. First make a directory and copy the old files in there (if they are present)-->
 <target name="update" description="Gets the latest version of CheckJavaVersion.java, and gs3-client-jar's files from Greenstone's SVN repository">
    <delete>
@@ -114,14 +132,4 @@
 </target>
 
-<target name="ensure-check-java-version" description="Ensures the file CheckJavaVersion.java is there">
-    <condition property="check.java.version.exists">
-       <and>
-	<available file="${basedir}/CheckJavaVersion.java"/>
-        <available file="${basedir}/CheckJavaVersion.class"/>
-       </and>
-    </condition>
-    <antcall target="update-check-java-version" />
-</target>
-
 <target name="ensure-gs3-for-client" description="Ensures the ${gs3.files.jar} file of required Greenstone3 support files is there">
     <condition property="gs3.for.client.exists">
@@ -131,12 +139,9 @@
 </target>
 
-
-<!-- "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 -->
-<target name="update-check-java-version" description="Gets the latest version of CheckJavaVersion.javafrom Greenstone's SVN repository" unless="check.java.version.exists">
-   <copy todir="${basedir}" flatten="true">
-    <resources>
-      <url url="${check.java.version.svn.file}"/>
-    </resources>
-  </copy>
+<!-- Gets the file if the local copy is missing or out of date (since usetimestamp=true) -->
+<target name="update-check-java-version" description="Gets the latest version of CheckJavaVersion.javafrom Greenstone's SVN repository">
+  <get src="${check.java.version.svn.file}" 
+    dest="${basedir}/CheckJavaVersion.java"
+    usetimestamp="true" />
   <!-- compile it up: specifying the file to be compiled explicitly (sourcepath="")--> 
   <javac sourcepath="" srcdir="${basedir}" destdir="${basedir}" >
@@ -148,12 +153,9 @@
   <mkdir dir="${basedir}/tmp" />
   <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>
-  <copy todir="${basedir}/tmp" flatten="true">
-    <resources>
-      <url url="${gs3forclient.svn.path}/GSXML.java"/>
-      <url url="${gs3forclient.svn.path}/XMLConverter.java"/>
-      <url url="${gs3forclient.svn.path}/GSPath.java"/>
-      <url url="${gs3forclient.svn.path}/MyNodeList.java"/>
-    </resources>
-  </copy>
+  <!-- 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 -->
+  <get src="${gs3forclient.svn.path}/GSXML.java" dest="${basedir}/tmp/GSXML.java" />
+  <get src="${gs3forclient.svn.path}/XMLConverter.java" dest="${basedir}/tmp/XMLConverter.java" />
+  <get src="${gs3forclient.svn.path}/GSPath.java" dest="${basedir}/tmp/GSPath.java" />
+  <get src="${gs3forclient.svn.path}/MyNodeList.java" dest="${basedir}/tmp/MyNodeList.java" />
   <!-- compile it up: specifying the file to be compiled explicitly --> 
   <javac srcdir="${basedir}/tmp" destdir="${basedir}/tmp" >
@@ -166,29 +168,14 @@
 </target>
 
-<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">
-   <delete includeEmptyDirs="true" failonerror="false">
-    <fileset file="${basedir}/lib/fedoraGS3.jar"/>
-    <fileset file="${basedir}/lib/QBRdata.jar"/>
-    <fileset file="${basedir}/${exec.jar.name}"/>
-    <fileset file="${basedir}/gs3democlient.properties"/>
-    <fileset dir="logs"/>
-    <fileset file="${log4j.propFile}"/>
-    <fileset file="${dist}/${download.zip.name}.tar"/>
-    <fileset file="${dist}/${download.zip.name}.tar.gz"/>
-    <fileset file="${dist}/${download.zip.name}.zip"/>
-    <fileset file="${dist}/${download.zip.name}.tar.bz2"/>
-   </delete>
-</target>
-
 <!-- Targets to generate the project-specific jar files QBRdata.jar and fedoraGS3.jar -->
 <target name="QBRdatajar" description="Compiles and creates the QBRdata.jar file needed by GS3demo-client">
    <javac srcdir="${democlient.rootdir}/${QBRdata.rel.path}">
       <classpath refid="project.classpath"/>
-    </javac>
-  <delete file="lib/QBRdata.jar" /> <!--For now: Let's delete it first and do a fresh rebuild-->
-  <jar destfile="lib/QBRdata.jar"
+   </javac>
+   <delete file="lib/QBRdata.jar" /> <!--For now: Let's delete it first and do a fresh rebuild-->
+   <jar destfile="lib/QBRdata.jar"
      basedir="${democlient.rootdir}/"
      excludes="${gui.rel.path}/*.*,${dlservices.rel.path}/**,${gs3services.rel.path}/**">
-  </jar>
+   </jar>
 </target>
 
