You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jo...@apache.org on 2001/03/19 03:42:29 UTC

cvs commit: jakarta-velocity/build build.bat build.sh build.xml testcases.xml build-testcases.xml build-velocity.bat build-velocity.sh build-velocity.xml

jon         01/03/18 18:42:29

  Added:       build    build.bat build.sh build.xml testcases.xml
  Removed:     build    build-testcases.xml build-velocity.bat
                        build-velocity.sh build-velocity.xml
  Log:
  renamed these files to be more "standards" based.
  
  Revision  Changes    Path
  1.1                  jakarta-velocity/build/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  
  REM --------------------------------------------
  REM No need to edit anything past here
  REM --------------------------------------------
  set _BUILDFILE=%BUILDFILE%
  set BUILDFILE=build.xml
  
  :final
  
  set _CLASSPATH=%CLASSPATH%
  
  if "%JAVA_HOME%" == "" goto javahomeerror
  if exist %JAVA_HOME%\lib\tools.jar set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
  
  set CLASSPATH=%CLASSPATH%;.\lib\ant-1.3.jar;.\lib\ant-1.3-optional.jar
  set CLASSPATH=%CLASSPATH%;.\lib\xerces-1.2.1.jar
  set CLASSPATH=%CLASSPATH%;.\lib\Fop.class
  set CLASSPATH=%CLASSPATH%;.\lib\Xslt.class
  
  %JAVA_HOME%\bin\java.exe org.apache.tools.ant.Main -buildfile %BUILDFILE% %1 %2 %3 %4 %5 %6 %7 %8 %9
  
  goto end
  
  REM -----------ERROR-------------
  :javahomeerror
  echo "ERROR: JAVA_HOME not found in your environment."
  echo "Please, set the JAVA_HOME variable in your environment to match the"
  echo "location of the Java Virtual Machine you want to use."
  
  :end
  set BUILDFILE=%_BUILDFILE%
  set _BUILDFILE=
  set CLASSPATH=%_CLASSPATH%
  set _CLASSPATH=
  
  
  
  1.1                  jakarta-velocity/build/build.sh
  
  Index: build.sh
  ===================================================================
  #!/bin/sh
  #-----------------------------
  # Script for building Velocity
  #-----------------------------
  
  #-------------------------------------------------------------------
  
  #--------------------------------------------
  # No need to edit anything past here
  #--------------------------------------------
  if test -z "${JAVA_HOME}" ; then
      echo "ERROR: JAVA_HOME not found in your environment."
      echo "Please, set the JAVA_HOME variable in your environment to match the"
      echo "location of the Java Virtual Machine you want to use."
      exit
  fi
  
  if test -f ${JAVA_HOME}/lib/tools.jar ; then
      CLASSPATH="${CLASSPATH}:${JAVA_HOME}/lib/tools.jar"
  fi
  
  # convert the existing path to unix
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
      CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  fi
  
  CLASSPATH=${CLASSPATH}:./lib/ant-1.3.jar
  CLASSPATH=${CLASSPATH}:./lib/ant-1.3-optional.jar
  CLASSPATH=${CLASSPATH}:./lib/xerces-1.2.1.jar
  CLASSPATH=${CLASSPATH}:./lib/werken.xpath.jar
  CLASSPATH=${CLASSPATH}:./lib/antlr-runtime.jar
  
  # convert the unix path to windows
  if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
      CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  fi
  
  if [ "$BUILDFILE" = "" ] ; then
      BUILDFILE=build.xml
  fi
  
  ${JAVA_HOME}/bin/java -classpath ${CLASSPATH} \
                         org.apache.tools.ant.Main \
                         -buildfile ${BUILDFILE} "$@"
  
  
  
  1.1                  jakarta-velocity/build/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- Build file for Velocity -->
  
  <project name="Velocity" default="jar" basedir=".">
  
    <property name="Name" value="Velocity"/>
    <property name="version" value="0.76"/>
    <property name="project" value="velocity"/>
    <property name="build.compiler" value="classic"/>
      
    <property name="build.dir" value="../bin"/>
    <property name="build.src" value="${build.dir}/src"/>
    <property name="build.dest" value="${build.dir}/classes"/>
      
    <property name="example.dir" value="../examples"/>
  
    <property name="src.java.dir" value="../src/java"/>
    <property name="javadoc.destdir" value="../docs/apidocs"/>
    <property name="final.name" value="${project}-${version}"/>
    <property name="dist.root" value="../dist"/>
    <property name="dist.dir" value="${dist.root}/${final.name}"/>
    <property name="year" value="2001"/>
    <property name="ant.home" value="."/>
    <property name="debug" value="on"/>
    <property name="optimize" value="on"/>
    <property name="deprecation" value="on"/>
  
    <property name="docs.dest" value="../docs"/>
    <property name="docs.src" value="../xdocs"/>
      
    <property name="log.jar" value="lib/log.jar"/>
    <property name="jdom.jar" value="lib/jdom-b6.jar"/>
    <property name="oro.jar" value="lib/oro.jar"/>
    <property name="servlet.jar" value="lib/servlet.jar"/>
    <property name="xerces.jar" value="lib/xerces-1.1.3.jar"/>
    <property name="xalan.jar" value="lib/xalan_1_1_D01.jar"/>
    <property name="junit.jar" value="lib/junit-3.2.jar"/>
  
    <!-- Forum demo build information -->
    <property name="demo.base" value="../examples/forumdemo"/>
    <property name="demo.dest" value="${demo.base}/WEB-INF/classes"/>
    <property name="demo.src" value="${demo.base}/WEB-INF/src"/>
    <property name="demo.lib" value="${demo.base}/WEB-INF/lib"/>
  
    <!-- PDF generation using FOP -->
    <property name="xdocs.dir" value="../xdocs"/>
    <property name="allfiles.xml" value="velocity-doc.xml"/>
    <property name="outfile.fo" value="velocity.fo"/>
    <property name="outfile.pdf" value="../docs/velocity.pdf"/>
  
    <property 
      name="default.texen.properties"
      value="org/apache/velocity/texen/defaults/texen.properties"
    />
  
    <property 
      name="runtime.defaults.dir" 
      value="org/apache/velocity/runtime/defaults"
    />
  
    <!-- disabled for now == classpath issues
      <taskdef name="fop" classname="Fop"/>
      <taskdef name="xslt" classname="Xslt"/>
    -->
  
    <!-- Build classpath -->
    <path id="classpath">
      <fileset dir="./lib">
        <include name="**/*.jar"/>
      </fileset>
    </path>
  
    <!-- =================================================================== -->
    <!-- prints the environment                                              -->
    <!-- =================================================================== -->
    <target name="env">
      
      <echo message="build.compiler = ${build.compiler}"/>
      <echo message="java.home = ${java.home}"/>
      <echo message="user.home = ${user.home}"/>
      <echo message="java.class.path = ${java.class.path}"/>
      <echo message=""/>
    
    </target>
  
    <!-- =================================================================== -->
    <!-- Prepares the build directory                                        -->
    <!-- =================================================================== -->
    <target name="prepare" depends="env">
      
      <tstamp/>
      <filter token="year" value="${year}"/>
      <filter token="version" value="${version}"/>
      <filter token="date" value="${DSTAMP}"/>        
  
      <mkdir dir="${build.dir}"/>
      <mkdir dir="${build.dest}"/>
      <mkdir dir="${build.src}"/>
  
      <copy todir="${build.src}">
        <fileset dir="${src.java.dir}"> 
          <include name="**/*.java"/>
        </fileset>
      </copy>
  
      <!--  chose a class that's from j2ee.jar -->
      <available  classname="javax.sql.DataSource"
         property="J2EE.present">
         <classpath refid = "classpath"/> 
       </available>
  
    </target>
  
    <target name="J2EE-error" depends="prepare"  unless="J2EE.present">
          <echo>
             ********************************************************
             **
             **  J2EE has not been found and is needed for the target
             **  you have chosen
             **
             **  Since CLASSPATH is an evil idea, just link or drop
             **  a copy of your j2ee.jar into build/lib directory.
             **
             *********************************************************
          </echo>
      </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory w/o the j2ee dependent files          -->
    <!-- =================================================================== -->
    <target name="compile" depends="prepare">
        
      <javac srcdir="${build.src}"
        destdir="${build.dest}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}">
  
        <exclude  name="org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java"/>
        
        <classpath refid="classpath"/>
      </javac>
              
      <antcall target="compile-copy"/>
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory w/o the j2ee dependent files          -->
    <!-- =================================================================== -->
    <target name="compile-j2ee" depends="prepare, J2EE-error" if="J2EE.present">
        
      <javac srcdir="${build.src}"
        destdir="${build.dest}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}">
        
        <classpath refid="classpath"/>
      </javac>
              
     <antcall target="compile-copy"/>
  
    </target>
  
  
    <!-- ====================================================================== -->
    <!-- copies post-compile target files to the right place.  (This target     -->
    <!-- created to prevent compile and compile-j2ee from repeating code...     -->
    <!-- ====================================================================== -->
    <target name="compile-copy">
  
      <copy todir="${build.dest}/org/apache/velocity">
        <fileset dir="${src.java.dir}/org/apache/velocity">
          <include name="**/*.class"/>
        </fileset>
      </copy>
              
      <copy todir="${build.dest}/${runtime.defaults.dir}">
        <fileset dir="${src.java.dir}/${runtime.defaults.dir}">
          <include name="*"/>
        </fileset>
      </copy>
  
      <copy 
        file="${src.java.dir}/${default.texen.properties}"
        tofile="${build.dest}/${default.texen.properties}"
      />
  
    </target>
     
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory and creates a .jar file               -->
    <!-- =================================================================== -->
    <target name="jar" depends="compile">
          
      <unzip src="${log.jar}" dest="${build.dest}"/>
      <unzip src="${oro.jar}" dest="${build.dest}"/>
  
      <delete dir="${build.dest}/meta-inf" quiet="true"/>
  
      <jar jarfile="${build.dir}/${project}-${version}.jar">
  
        <fileset dir="${build.dest}">
          <exclude name="**/package.html"/>
          <exclude  name="org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.class"/>
        </fileset>
       
      </jar>
    
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory and creates a .jar file of all        -->
    <!--  source AND code that requires j2ee (ex. DataSourceResourceLoader)  -->
    <!-- =================================================================== -->
    <target name="jar-j2ee" depends="compile-j2ee" if="J2EE.present">
          
      <unzip src="${log.jar}" dest="${build.dest}"/>
      <unzip src="${oro.jar}" dest="${build.dest}"/>
  
      <delete dir="${build.dest}/meta-inf" quiet="true"/>
  
      <jar jarfile="${build.dir}/${project}-j2ee-${version}.jar"
        basedir="${build.dest}"
        excludes="**/package.html"
      />
    
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory and creates a .jar file               -->
    <!-- =================================================================== -->
    <target name="jar-core" depends="compile">
          
      <unzip src="${log.jar}" dest="${build.dest}"/>
  
      <delete dir="${build.dest}/meta-inf" quiet="true"/>
  
      <jar compress="true" jarfile="${build.dir}/${project}-core-${version}.jar">
        <fileset dir="${build.dest}">
          <exclude name="**/package.html"/>
          <exclude name="org/apache/oro/**"/>
          <exclude name="org/apache/velocity/anakia/**"/>
          <exclude name="org/apache/velocity/convert/**"/>
          <exclude name="org/apache/velocity/servlet/**"/>
          <exclude name="org/apache/velocity/texen/**"/>
          <exclude name="org/apache/velocity/test/**"/>
          <exclude  name="org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.class"/>
        </fileset>
      </jar>
    
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory and creates a .jar file               -->
    <!-- =================================================================== -->
    <target name="jar-util" depends="compile">
          
      <unzip src="${log.jar}" dest="${build.dest}"/>
  
      <delete dir="${build.dest}/meta-inf" quiet="true"/>
  
      <jar jarfile="${build.dir}/${project}-util-${version}.jar">
        <fileset dir="${build.dest}">
          <exclude name="**/package.html"/>
          <include name="org/apache/velocity/anakia/**"/>
          <include name="org/apache/velocity/convert/**"/>
          <include name="org/apache/velocity/texen/**"/>
          <exclude  name="org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.class"/>
        </fileset>
      </jar>
    
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the source directory and creates a .jar file               -->
    <!-- =================================================================== -->
    <target name="jar-servlet" depends="compile">
          
      <unzip src="${log.jar}" dest="${build.dest}"/>
  
      <delete dir="${build.dest}/meta-inf" quiet="true"/>
  
      <jar jarfile="${build.dir}/${project}-servlet-${version}.jar">
        <fileset dir="${build.dest}">
          <exclude name="**/package.html"/>
          <include name="org/apache/velocity/servlet/**"/>
          <exclude  name="org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.class"/>
        </fileset>
      </jar>
    
    </target>
  
    <!-- ================================================================== -->
    <!-- jars the source                                                    -->
    <!-- ================================================================== -->
    <target name="jar-src"
            depends="prepare"
            description="--> generates the velocity.src.jar file containing source only">
        <jar jarfile="${build.dir}/${final.name}.src.jar"
            basedir="${build.src}"
            excludes="**/package.html"/>
    </target>
  
    <!-- =================================================================== -->
    <!-- Compiles the example code                                           -->
    <!-- =================================================================== -->
    <target name="examples" depends="jar">
          
       <echo>
        **************************************************************
        ** Building the examples :
        **   examples/appexample1 : application example
        **   examples/appexample2 : application example
        **   examples/servletexample1 : servlet example
        **   examples/context_example : example context implementations
        **   forumdemo : demonstration webapp
        **************************************************************
        </echo>
  
      <javac srcdir="${example.dir}/app_example1
                    :${example.dir}/app_example2
                    :${example.dir}/servlet_example1
                    :${example.dir}/context_example"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}">
  
        <classpath>
          <pathelement location="${build.dest}"/>
          <pathelement location="${servlet.jar}"/>
        </classpath>
        
      </javac>
  
      <antcall target="forumdemo" />
  
    </target>
  
    <target name="examples-clean-all" depends="examples-clean-anakia">
      <delete quiet="true">
        <fileset dir="${example.dir}" includes="**/*.class"/>
      </delete>
    </target>
  
    <target name="examples-clean-anakia">
      <delete dir="${example.dir}/anakia/docs" quiet="true"/>
    </target>
  
    <!-- =================================================================== -->
    <!-- Creates the API documentation                                       -->
    <!-- =================================================================== -->
    <target name="javadocs" depends="prepare">
      
      <mkdir dir="${javadoc.destdir}"/>
      
      <javadoc
        sourcepath="${build.src}"
        packagenames="org.apache.velocity.*"
        destdir="${javadoc.destdir}"
        author="true"
        private="true"
        version="true"
        use="true"
        windowtitle="${Name} ${version} API"
        doctitle="${Name} ${version} API"
        bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights Reserved.">
        
        <classpath refid="classpath"/> 
        
      </javadoc>
    </target>
  
    <target name="javadocs-clean">
      <delete dir="${javadoc.destdir}" quiet="true"/>
    </target>
      
    <!-- =================================================================== -->
    <!-- Package                                                             -->
    <!-- =================================================================== -->
    <target name="package" depends="javadocs-clean,
                                 examples-clean-anakia,
                                 test-clean,jar,javadocs">
          
      <mkdir dir="${dist.dir}"/>
      <mkdir dir="${dist.dir}/src/java"/>
  
      <copy todir="${dist.dir}/src/java/">
        <fileset dir="${build.dir}/src/">
          <include name="**"/>
        </fileset>
      </copy>
  
      <copy todir="${dist.dir}/docs">
        <fileset dir="../docs">
          <include name="**"/>
        </fileset>
      </copy>
  
      <copy todir="${dist.dir}/build">
        <fileset dir="../build">
          <include name="**"/>
        </fileset>
      </copy>
  
      <copy todir="${dist.dir}/convert">
        <fileset dir="../convert">
          <include name="**"/>
        </fileset>
      </copy>
  
      <copy todir="${dist.dir}/examples">
        <fileset dir="../examples">
          <include name="**"/>
        </fileset>
      </copy>
  
      <copy todir="${dist.dir}/test">
        <fileset dir="../test">
          <include name="**"/>
        </fileset>
      </copy>
  
      <copy 
        file="../LICENSE" 
        tofile="${dist.dir}/LICENSE"
      />
  
      <copy 
        file="../README.txt" 
        tofile="${dist.dir}/README.txt"
      />
      
      <copy 
        file="${build.dir}/${final.name}.jar" 
        tofile="${dist.dir}/${final.name}.jar"
      />
      
    </target>
  
    <!-- ================================================================== -->
    <!-- Packages the distribution with Jar                                 -->
    <!-- ================================================================== -->
    <target name="package-jar"
            depends="package"
            description="--> generates the Turbine distribution as .zip">
        <delete file="../${final.name}.jar" quiet="true"/>
  
        <jar 
            jarfile="../${final.name}.jar" 
            basedir="${dist.root}"
            excludes="**/package.html"
        />
    </target>
  
    <!-- ================================================================== -->
    <!-- Packages the distribution with ZIP                                 -->
    <!-- ================================================================== -->
    <target name="package-zip"
            depends="package"
            description="--> generates the Turbine distribution as .zip">
        <delete file="../${final.name}.zip" quiet="true"/>
        <zip zipfile="../${final.name}.zip" basedir="../" 
             includes="**/${final.name}/**"/>
    </target>
  
    <!-- ================================================================== -->
    <!-- Packages the distribution with TAR-GZIP                            -->
    <!-- ================================================================== -->
    <target name="package-tgz"
            depends="package"
            description="--> generates the Turbine distribution as .tar.gz">
        <delete file="../${final.name}.tar" quiet="true"/>
        <delete file="../${final.name}.tar.gz" quiet="true"/>
        <tar tarfile="../${final.name}.tar" basedir="../" 
             includes="**/${final.name}/**" longfile="gnu"/>
        <gzip zipfile="../${final.name}.tar.gz" src="../${final.name}.tar"/>
    </target>
  
    <!-- ================================================================== -->
    <!-- Packages the distribution with ZIP and TAG-GZIP                    -->
    <!-- ================================================================== -->
    <target name="package-all"
            depends="package-zip, package-tgz, package-jar"
            description="--> generates the .tar.gz and .zip distributions">
    </target>
  
    <!-- ================================================================== -->
    <!-- Same as package-all. It is just here for compatibility.            -->
    <!-- ================================================================== -->
    <target name="dist" depends="package-all">
      <delete dir="${dist.root}" quiet="true"/>
    </target>
  
    <!-- =================================================================== -->
    <!-- Cleans up the build directory                                       -->
    <!-- =================================================================== -->
    <target name="clean">
        <delete dir="${build.dir}" quiet="true"/>
    </target>
    
    <!-- =================================================================== -->
    <!-- Make HTML version of Velocity documentation                         -->
    <!-- =================================================================== -->
  
    <target name="docs"
            depends="jar"
            description="--> generates the HTML documentation"
            >
  <!--
        <echo>
         ####################################################################
         #
         #  Fetching the latest stylesheet from jakarta-site2
         #
         #  NOTE : As this build target is meant for developers, this requires 
         #    a properly setup CVS.  But you are encouraged to use this to 
         #    experiment with Anakia - if the fetch fails, it may be because 
         #    you haven't yet logged into CVS. The way to do it, assuming you
         #    have a resonable CVS client setup is
         #
         #  $ cvs -d :pserver:anoncvs@jakarta.apache.org:/home/cvspublic login
         #  password: anoncvs
         #
         #  and that should solve it.  
         #
         #  See http://jakarta.apache.org/site/cvsindex.html for more 
         #      information, or http://www.cvshome.org/
         #
         #  Ant really is the bee's knees. http://jakarta.apache.org/ant/
         #
         ######################################################################
         </echo>
  
        <cvs cvsRoot=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic"
            command="checkout -p jakarta-site2/xdocs/stylesheets/site.vsl"
            output="${docs.src}/stylesheets/site.vsl"
        />
  -->
        <taskdef name="anakia"
            classname="org.apache.velocity.anakia.AnakiaTask">
            
            <classpath>
               <pathelement location="${build.dir}/${project}-${version}.jar"/>
               <pathelement location="${jdom.jar}"/>
            </classpath>
  
        </taskdef>
  
        <echo>
         #######################################################
         #
         #  Now using Anakia to transform our XML documentation
         #  to HTML.
         #
         #  Note : this step depends upon having the jakarta-site2
         #  project located as a peer to the jakarta-velocity
         #  directory (the directory that holds the Velocity
         #  distribution.)  That means that jakarta-site2 and
         #  jakarta-velocity are located in the same subdirectory.
         #
         #  Please see :
         #    http://jakarta.apache.org/site/cvsindex.html
         #  for more information on obtaining jakarta-site2.
         #
         #######################################################
         </echo>
  
        <anakia basedir="${docs.src}" destdir="${docs.dest}/"
             extension=".html" style="./site.vsl"
             projectFile="stylesheets/project.xml"
             excludes="**/stylesheets/** empty.xml"
             includes="**/*.xml"
             lastModifiedCheck="true"
             templatePath="../../jakarta-site2/xdocs/stylesheets">
        </anakia>
  
        <copy todir="${docs.dest}/images" filtering="no">
            <fileset dir="${docs.src}/images">
                <include name="**/*.gif"/>
                <include name="**/*.jpeg"/>
                <include name="**/*.jpg"/>
            </fileset>
        </copy>
    
        <!-- In case we have CSS someday
        <copy todir="${docs.dest}" filtering="no">
            <fileset dir="${docs.src}">
                <include name="**/*.css"/>
            </fileset>
        </copy>
        -->
    </target>
  
    <!-- =================================================================== -->
    <!-- Make PDF version of Velocity documentation                          -->
    <!-- =================================================================== -->
    <!--    
    <target name="pdf">
      <xslt 
        infile="../xdocs/site-book.xml" 
        xsltfile="xsl/xml2xml.xsl"
        outfile="${allfiles.xml}" 
        smart="yes"
      />
      
      <xslt 
        infile="${allfiles.xml}" 
        xsltfile="xsl/xml2pdf.xsl"
        outfile="${outfile.fo}" 
        smart="yes"
      />
      
      <fop 
        fofile="${outfile.fo}" 
        pdffile="${outfile.pdf}"
      /> 
          
      <delete file="${allfiles.xml}"/>
      <delete file="${outfile.fo}"/>
    
    </target>
    -->
      
    <!-- =================================================================== -->
    <!-- JUnit Tests for Velocity                                            -->
    <!-- =================================================================== -->
     <target name="test"
              depends="compile"
              description="--> Run the testcases">
          <ant antfile="build-testcases.xml" target="test-all"/>
     </target>
  
     <target name="test-clean"
              description="--> Cleanup after the testcases">
          <ant antfile="build-testcases.xml" target="test-clean"/>
     </target>
  
    <!-- =================================================================== -->
    <!-- Forum Demo Web App                                                  -->
    <!-- =================================================================== -->
    <target name="forumdemo" depends="compile">
         
      <echo>
        **************************************************
        ** Building the Forum demo ...
        ** Remember to set the PATH in Velocity.properties
        ** once you move the WAR to your Servlet engine.
        **
        ** The WAR can be found in the bin directory
        **************************************************
      </echo>
      
      <mkdir dir="${demo.dest}"/>
      <mkdir dir="${demo.lib}"/>
  
      <javac srcdir="${demo.src}"
        destdir="${demo.dest}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}">
        
       <classpath>
          <pathelement location="${build.dest}"/>
          <pathelement location="${servlet.jar}"/>
        </classpath>
   
      </javac>
  
      <copy todir="${demo.lib}">
        <fileset dir="${build.dir}"> 
          <include name="**/velocity*.jar"/>
        </fileset>
      </copy>
  
      <jar
        jarfile="${build.dir}/forumdemo.war"
        basedir="${demo.base}"
        excludes="**/package.html"
      />
      
    </target>
  
    <!-- Delete the demo files for re-build -->
    <target name="cleandemo">
      
      <delete dir="${demo.dest}/org" quiet="true"/>
      <delete file="${build.dir}/forumdemo.war" quiet="true"/>
      
    </target>
      
  </project>
  
  
  
  
  1.1                  jakarta-velocity/build/testcases.xml
  
  Index: testcases.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- Testcases for Velocity -->
  <project name="main" default="test-all">
  
    <property name="build.dir" value="../bin"/>
    <property name="build.dest" value="${build.dir}/classes"/>
    <property name="ant.home" value="."/>
    <property name="test.home" value="../test"/>
    <property name="junit.jar" value="lib/junit-3.2.jar"/>
  
    <!-- JUnit Testbed properties -->
    <property name="velocity.test.runner" value="junit.textui.TestRunner"/>
  
    <!-- Build classpath -->
    <path id="classpath">
      <fileset dir="./lib">
        <include name="**/*.jar"/>
      </fileset>
      <pathelement location="${build.dest}"/>
    </path>
  
    <!-- =================================================================== -->
    <!-- JUnit Test Cases                                                    -->
    <!-- =================================================================== -->
    <target name="test-all" depends="
                                     test-template,
                                     test-velocityapp,
                                     test-introspect,
                                     test-inlinevmscope,
                                     test-multi,
                                     test-cpload,
                                     test-contextsafety,
                                     test-anakia,
                                     test-configuration
                                     "/>
  
    <target name="test-template">
      <echo message="Running Template tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.TemplateTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
     </target>
  
    <target name="test-velocityapp"> 
      <echo message="Running app.Velocity tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.VelocityAppTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-introspect"> 
      <echo message="Running Introspector tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.IntrospectorTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-inlinevmscope">
      <echo message="Running Inline VM Scope tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.InlineScopeVMTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-multi">
      <echo message="Running Multiple File Resource Path tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.MultipleFileResourcePathTest"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-cpload">
      <echo message="Running Classpath Resource tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.ClasspathResourceTest"/>
        <classpath>
          <path refid="classpath"/>
          <pathelement location="../test/cpload/test1.jar"/>
          <pathelement location="../test/cpload/test2.jar"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-contextsafety">
      <echo message="Running Context Safety tests..."/>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.ContextSafetyTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-anakia">
      <echo message="Running Anakia tests..."/>
      
      <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </taskdef>
      <anakia basedir="../test/anakia/xdocs" destdir="../test/anakia/results"
              extension=".html" style="./site.vsl"
              projectFile="./stylesheets/project.xml"
              excludes="**/stylesheets/**"
              includes="**/*.xml"
              templatePath="../test/anakia/xdocs/stylesheets"
              lastModifiedCheck="false">
      </anakia>
  
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.AnakiaTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-configuration">
      <java classname="${velocity.test.runner}" fork="yes">
        <arg value="org.apache.velocity.test.ConfigurationTestCase"/>
        <classpath>
          <path refid="classpath"/>
        </classpath>
      </java>
    </target>
  
    <target name="test-clean">
      <mkdir dir="${test.home}/templates/results"/>
      <delete quiet="true" includeEmptyDirs="true" 
              dir="${test.home}/templates/results"/>
      <delete dir="${test.home}/anakia/results" quiet="true"/>
    </target>
  
  </project>