Index: build.xml
===================================================================
--- build.xml	(revision 1938)
+++ build.xml	(revision 1939)
@@ -272,7 +272,9 @@
       </copy>
    </target>
 
-   <target name="compile" depends="prepare,utilities">
+   <target name="compile" depends="prepare,utilities"
+    description="Compiles java code to build dir, and copies metacat + srb props files there">
+
        <javac srcdir="${build.src}"
               destdir="${build.dest}"
               classpath="${cpath}"
@@ -285,7 +287,9 @@
              tofile="${build.dest}/${package.home}/srbProps.properties"/>
    </target>
 
-   <target name="jar" depends="compile">
+   <target name="jar" depends="compile"
+    description="Compiles and jars metacat java code to metacat.jar in build dir">
+
        <delete file="${build.dir}/${name}.jar" />
        <copy todir="${build.dest}">
          <fileset dir="lib/srbrmi"/>
@@ -294,7 +298,8 @@
             excludes="**/protocols/" />
    </target>
 
-   <target name="protocol" depends="compile">
+   <target name="protocol" depends="compile"
+    description="Compiles and jars protocol java code to protocol.jar in build dir">
        <delete file="${build.dir}/protocol.jar" />
        <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
             includes="**/protocols/" />
@@ -307,7 +312,8 @@
      <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
    </target>
 
-   <target name="client" depends="utilities, prepare">
+   <target name="client" depends="utilities, prepare"
+    description="Compiles metacat-client java code to build dir">
        <javac srcdir="${build.src}"
               destdir="${build.dest}"
               classpath="${cpath}"
@@ -314,87 +320,85 @@
               includes="edu/ucsb/nceas/metacat/client/*" />
    </target>
 
-   <target name="clientjar" depends="client">
+   <target name="clientjar" depends="client"
+    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
        <delete file="${build.dir}/${name}-client.jar" />
        <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
             includes="**/metacat/client/" />
    </target>
 
-   <target name="getdtdschema" depends="prepare">
+   <target  name="geteml" depends="getemlpre2,geteml2+" 
+            description="Calls getemlpre2 and geteml2+ targets" />
+
+   <target name="getemlpre2" depends="prepare"
+   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
      <echo>Enter CVS password: </echo>
      <cvs cvsRoot="${cvsroot}"
           package="${eml-module}"
           tag="${eml-tag}"
-          dest="${build.tmp}" />
+          dest="${build.tmp}/eml_${eml-tag}" />
      <mkdir dir="lib/dtd" />
      <copy todir="lib/dtd" filtering="yes">
-       <fileset dir="${build.tmp}/${eml-module}">
+       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
          <include name="*.dtd"/>
        </fileset>
        <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
      </copy>
-     <copy todir="${style-common-cvsrelpath}" filtering="yes">
-       <fileset dir="${build.tmp}/${eml-module}/style">
-       <include name="**/*.xsl"/>
-     </fileset>
-     </copy>     <echo>Enter CVS password: </echo>
+     <antcall target="copyxsl">
+        <param name="cvs.tagname" value="${eml-tag}" />
+     </antcall>
+   </target>
+
+   <target name="geteml2+" depends="prepare"
+   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
+     <echo>Enter CVS password: </echo>
      <cvs cvsRoot="${cvsroot}"
           package="${eml-module}"
           tag="${eml2-tag}"
-          dest="${build.tmp}" />
+          dest="${build.tmp}/eml_${eml2-tag}" />
      <mkdir dir="lib/schema" />
      <copy todir="lib/schema" filtering="yes">
-       <fileset dir="${build.tmp}/${eml-module}">
+       <fileset dir="${build.tmp}/eml_${eml2-tag}/${eml-module}">
          <include name="*.xsd"/>
        </fileset>
+       
+       <!-- shouldn't we have a mapper here like this??
+       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
+       
+       Jing's code didn't nave one - does it need to be added? 
+       NOTE that eml-version is set to beta 6, so this would need changing -->
+     
      </copy>
+     <antcall target="copyxsl">
+        <param name="cvs.tagname" value="${eml2-tag}" />
+     </antcall>
+   </target>
+   
+   
+
+   <target  name="copyxsl" 
+   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
+
+     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
+     
      <copy todir="${style-common-cvsrelpath}" filtering="yes">
-       <fileset dir="${build.tmp}/${eml-module}/style">
+       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style">
        <include name="**/*.xsl"/>
      </fileset>
      </copy>
      
+
      <!-- now copy default css from eml module and put it in style-common-path 
           dir with a new name, so other skin-specific css can import it if reqd -->
-     <copy file="${build.tmp}/${eml-module}/${eml-module.default.css}"
+     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
            tofile="${style-common-cvsrelpath}/${eml-css}" />
-   </target>
 
-   <target name="getdtd" depends="prepare">
-     <echo>Enter CVS password: </echo>
-     <cvs cvsRoot="${cvsroot}"
-          package="${eml-module}"
-          tag="${eml-tag}"
-          dest="${build.tmp}" />
-     <mkdir dir="lib/dtd" />
-     <copy todir="lib/dtd" filtering="yes">
-       <fileset dir="${build.tmp}/${eml-module}">
-         <include name="*.dtd"/>
-       </fileset>
-       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
-     </copy>
    </target>
-
-   <target name="getschema" depends="prepare">
-     <echo>Enter CVS password: </echo>
-     <cvs cvsRoot="${cvsroot}"
-          package="${eml-module}"
-          tag="${eml2-tag}"
-          dest="${build.tmp}" />
-     <mkdir dir="lib/schema" />
-     <copy todir="lib/schema" filtering="yes">
-       <fileset dir="${build.tmp}/${eml-module}">
-         <include name="*.xsd"/>
-       </fileset>
-     </copy>
-     <copy todir="lib/style/common">
-       <fileset dir="${build.tmp}/${eml-module}/style">
-       <include name="**/*.xsl"/>
-     </fileset>
-     </copy>
-   </target>
-
-   <target name="dtdschemasql" depends="prepare">
+   
+   
+   
+   <target name="dtdschemasql" depends="prepare"
+   description="Registers the DTDs with the new Metacat instance">
      <echo/>
      <echo>Registering the DTDs with the new Metacat instance...</echo>
      <sql driver="${dbDriver}"
@@ -405,9 +409,10 @@
           src="${build.src}/loaddtdschema.sql" />
    </target>
 
-   <target name="schemasql" depends="prepare">
+   <target name="schemasql" depends="prepare"
+            description="Registers the Schema with the new Metacat instance">
      <echo/>
-     <echo>Registering the DTDs with the new Metacat instance...</echo>
+     <echo>Registering the Schema with the new Metacat instance...</echo>
      <sql driver="${dbDriver}"
           classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
           url="${jdbc-connect}"
@@ -416,7 +421,8 @@
           src="${build.src}/loadschema.sql" />
    </target>
    
-   <target name="installdb" depends="prepare">
+   <target name="installdb" depends="prepare"
+            description="Installs the database tables">
      <echo/>
      <echo>Installing the database tables...</echo>
      <sql driver="${dbDriver}"
@@ -427,7 +433,8 @@
           src="${build.src}/xmltables.sql" />
    </target>
 
-   <target name="upgrade12" depends="prepare">
+   <target name="upgrade12" depends="prepare"
+            description="Updates the database tables to upgrade to version 1.2">
      <echo/>
      <echo>Updating the database tables to upgrade to version 1.2...</echo>
      <sql driver="${dbDriver}"
@@ -438,7 +445,8 @@
           src="${build.src}/upgrade-db-to-1.2.sql" />
    </target>
 
-   <target name="upgrade13" depends="prepare">
+   <target name="upgrade13" depends="prepare"
+            description="Updates the database tables to upgrade to version 1.3">
      <echo/>
      <echo>Updating the database tables to upgrade to version 1.3...</echo>
      <sql driver="${dbDriver}"
@@ -449,7 +457,8 @@
           src="${build.src}/upgrade-db-to-1.3.sql" />
    </target>
 
-   <target name="installCommon" depends="jar,clientjar">
+   <target name="installCommon" depends="jar,clientjar"
+            description="* basic metacat install for web-server files *">
        <mkdir dir="${datafilepath}" />
        <mkdir dir="${inlinedatafilepath}" />
        <chmod dir="${datafilepath}" perm="ug+w" />
@@ -517,11 +526,12 @@
         <echo> Install Other Database</echo>
    </target>
    
-   <target name="install" depends="installMSSQL, installother">
-     
-   </target>
+   <target name="install" depends="installMSSQL,installother" 
+            description="* Full Install *" />
    
-   <target name="install-registry" depends="init">
+   <target name="install-registry" depends="init" 
+            description="Install Registry">
+            
       <copy file="${srcdir}/perl/register-dataset.cgi"
             todir="${inst.cgi.dir}" filtering="yes"/>
       <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
@@ -537,7 +547,8 @@
       <echo message="Install Registry completed." />
    </target>
 
-   <target name="getBeta6ConversionStyles" depends="prepare">
+   <target name="getBeta6ConversionStyles" depends="prepare"
+            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
      <echo>Enter CVS password: </echo>
      <cvs cvsRoot="${cvsroot-alternate}"
           package="${conversion-module}"
@@ -563,7 +574,8 @@
                 includes="**/*.class" />
    </target>
 
-   <target name="test" depends="testprep">
+   <target name="test" depends="testprep"
+            description="Uses the ant junit task to run all JUnit tests">
 
       <!-- use the ant "junit" task to run JUnit tests. -->
       <junit printsummary="yes" haltonfailure="no" fork="yes"
@@ -583,9 +595,11 @@
      </junit>
    </target>
 
-    <target name="runonetest" depends="testprep">
-      <echo>testtorun: ${testtorun}</echo>
+    <target name="runonetest" depends="testprep"
+            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
 
+              <echo>testtorun: ${testtorun}</echo>
+
       <!-- use the ant "junit" task to run JUnit tests. -->
       <junit printsummary="yes" haltonfailure="no" fork="yes"
              haltonerror="no">
@@ -604,7 +618,8 @@
      </junit>
    </target>
 
-  <target name="gethttpclient" depends="prepare">
+  <target name="gethttpclient" depends="prepare"
+            description="checks out and compiles morpho httpclient code">
   <!--mkdir dir="${morphosourcedir}" -->
         <cvs cvsRoot="${cvsroot}"
              package="morpho"
@@ -613,7 +628,9 @@
    </target>
 
    <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
-   <target name="nettest" depends="install">
+   <target name="nettest" depends="install"
+            description="compiles and runs the metacatnettest code">
+            
       <echo>***********************************
       Please run ant gethttpclient first!
       ***********************************
@@ -647,18 +664,28 @@
      </junit>
    </target>
 
-   <target name="servletclean" depends="clean">
+   <target name="cleanweb" depends="clean"
+            description="deletes tomcat web context dir and all its contents">
      <delete dir="${installdir}" />
    </target>
 
 
-   <target name="clean" depends="init">
+   <target name="clean" depends="init"
+            description="deletes build dir and any files copied to cvs sandbox by build process (jars, xsl) Currently *not* schema/DTDs">
        <delete dir="${build.dir}" />
        <delete file="lib/httpclient.jar" />
        <delete file="lib/utilities.jar" />
+       <delete includeEmptyDirs="true" failonerror="false">
+         <fileset dir="${style-common-cvsrelpath}">
+           <include name="${eml-css}" />
+           <include name="eml-*/*.xsl" />
+           <include name="eml-*" />
+         </fileset>
+     </delete>
    </target>
 
-   <target name="jdoc" depends="prepare">
+   <target name="jdoc" depends="prepare"
+            description="generates javadoc documentation">
        <javadoc packagenames="edu.ucsb.nceas.*"
            sourcepath="${build.src}"
            destdir="${build.javadocs}"
@@ -671,7 +698,8 @@
        />
    </target>
 
-   <target name="dist" depends="jar,protocol,jdoc,getdtd,getschema">
+   <target name="dist" depends="jar,protocol,jdoc,geteml"
+            description="prepares a full release distribution">
       <mkdir dir="${dist.dir}"/>
       <delete dir="${ver.dir}" />
       <mkdir dir="${ver.dir}"/>
@@ -707,7 +735,8 @@
       <delete file="./${name}-${release}.tar" />
   </target>
 
-  <target name="distsrc" depends="dist">
+  <target name="distsrc" depends="dist"
+            description="prepares a source distribution">
       <mkdir dir="${ver.src}"/>
       <copy todir="${ver.src}">
         <fileset dir="./src"/>
@@ -724,7 +753,7 @@
   </target>
 
    <target name="stylesheettest">
-     <xslt in="${input}" out="eml.html" style="lib/style/common/eml-2.0.0/eml-2.0.0.xsl">
+     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
       <param name="displaymodule" expression="${displaymodule}"/>
       <param name="docid" expression="${input}"/>
       <param name="entitytype" expression="${entitytype}"/>
