You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@locus.apache.org on 2000/11/02 00:25:54 UTC

cvs commit: xml-xalan/test/java build.bat build.sh build.xml

curcuru     00/11/01 15:25:53

  Added:       test/java build.bat build.sh build.xml
  Log:
  Build scripts for Xalan Java-based test automation
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/java/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  @goto start
  @REM	Name:   build.bat
  @REM	Author: Shane Curcuru
  :usage
  @echo build.bat - compiles Xalan Java-based test automation
  @echo   Usage:  build [targets]
  @echo                 [package.xalan1, package.trax, clean, javadocs]
  @echo.
  @echo Notes/prerequisites: 
  @echo   - Must be in the xml-xalan\test\java directory;
  @echo   - java.exe must be in %JAVAHOME%\bin or in the path;
  @echo   - must set classpath to include JDK system classes; and
  @echo   (either) set JARDIR=dir where all product/test jars needed are
  @echo   (either) be in the xml-xalan\test\java dir with all jars in 'default' tree
  @echo   (or) have your CLASSPATH already set to include *all* needed jars
  @echo   Pre-built 'default' tree assumed to be:
  @echo   [rootDir]\    
  @echo   JAVA_OPTS environment variable Will be passed to java.exe
  @echo.
  goto done
  @REM ------------------------------------------------------------------------
  
  :start
  @REM Check for help requests
  if '%1' == '' goto usage
  if '%1' == '-h' goto usage
  if '%1' == '-H' goto usage
  if '%1' == '-?' goto usage
  @echo %0 beginning...
  
  @REM Trickery to guess appropriate location of java.exe program
  if '%JAVA_HOME%' == '' set JAVA_EXE=java
  if not '%JAVA_HOME%' == '' set JAVA_EXE=%JAVA_HOME%\bin\java
  
  set TANT_HOME=.
  
  @REM If JARDIR blank, use the existing classpath first, so we pick up 
  @REM    any classes the user may have specified before default ones
  @REM Note that this could cause conflicts if the user only specified 
  @REM    some of the needed jars in the classpath, and then we add separate
  @REM    copies of them later on.
  @REM HACK! Includes only Xalan-J 2.x build
  if '%JARDIR%' == '' set TEST_CP=.\build;%classpath%;%TANT_HOME%\bin\ant.jar;..\..\java\bin\xerces.jar;..\..\java\build\xalan.jar;..\xml-xalan\bsf.jar
  
  @REM If JARDIR set, put those references first then default classpath
  @REM note that we still assume you're in xsl-test dir because of .\conf\Extend reference
  if not '%JARDIR%' == '' set TEST_CP=.\build;%TANT_HOME%\bin\ant.jar;%JARDIR%\xerces.jar;%JARDIR%\xalan.jar;%JARDIR%\bsf.jar;%classpath%
  
  :doant
  @REM Simply execute Ant to build it all
  echo %JAVA_EXE% %JAVA_OPTS% -Dant.home=%TANT_HOME% -classpath %TEST_CP% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
  %JAVA_EXE% %JAVA_OPTS% -Dant.home=%TANT_HOME% -classpath %TEST_CP% org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
  goto done
  
  :done
  @echo %0 complete!
  set TEST_CP=
  set JAVA_EXE=
  set TANT_HOME=
  :end
  
  
  
  1.1                  xml-xalan/test/java/build.sh
  
  Index: build.sh
  ===================================================================
  #!/bin/sh
  
  #	Name:   build.sh
  #	Author: Shane Curcuru
  #	Copyright (c)2000 Lotus Development Corp.
  
  echo build.sh beginning...
  
  if [ "$JAVA_HOME" = "" ] ; then
      echo You must set JAVA_HOME, sorry!
      exit 1
  fi
  if [ "$1" = "-h" ] ; then
      echo build.sh - compiles Xalan andor LotusXSL test automation
      echo   Usage:  build [targets]
      echo                 [all, package.xalan, package.lotusxsl, clean, javadoc]
      echo.
      echo Notes/prerequisites: 
      echo   - Must be in the xsl-test directory;
      echo   - java.exe must be in JAVAHOME/bin or in the path;
      echo   \(either\) set JARDIR=dir where all product/test jars needed are
      echo   \(either\) be in the ./xsl-test dir with all jars in 'default' tree
      echo   \(or\) have your CLASSPATH already set to include *all* needed jars
      echo   Pre-built 'default' tree assumed to be:
      echo   [rootDir]/    
      echo           xsl-test/test*.bat, testxsl.jar
      echo           xsl-test/conf/Extend, etc.
      echo           xml-xalan/xalan.jar, bsf.jar, bsfengines.jar, xerces.jar
      echo           js/js.jar       - appropriate JavaScript jar
      echo   JAVA_OPTS Will be passed to java.exe
      exit 1
  fi
  
  # Default locations for Ant; note home dir contains the bin dir
  TANT_HOME=.
  ANT=$TANT_HOME/bin/ant.jar
  
  # Add whichever JDK's system classes to CLASSPATH we find
  if [ -f $JAVA_HOME/lib/tools.jar ] ; then
      CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
  fi
  if [ -f $JAVA_HOME/lib/classes.zip ] ; then
      CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip
  fi
  
  # Set classpath for our use based on JARDIR
  if [ "$JARDIR" = "" ] ; then
      # append default jar locations to classpath
      TEST_CP="$CLASSPATH:./build:./prod/extend:$ANT:$TOOLS_JAR:../xml-xalan/xalan.jar:../xml-xalan/xerces.jar:../xml-xalan/bsf.jar:../xml-xalan/bsfengines.jar"
  else
      # prepend JARDIR-referenced jars to classpath
      TEST_CP="./build:./prod/extend:$ANT:$TOOLS_JAR:$JARDIR/xalan.jar:$JARDIR/xerces.jar:$JARDIR/bsf.jar:$JARDIR/bsfengines.jar:$CLASSPATH"
  fi
  
  echo Starting Ant with targets: $@
  echo         ...with classpath: $TEST_CP
  
  "$JAVA_HOME"/bin/java $JAVA_OPTS -Dant.home="$TANT_HOME" -classpath "$TEST_CP" org.apache.tools.ant.Main $@
  
  echo build.sh complete!
  
  
  
  
  
  
  
  1.1                  xml-xalan/test/java/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <!-- 
  /**
   * build.xml
   * Ant 1.2x build script for Xalan-J tests.  
   * @author shane_curcuru@lotus.com
   *
   */
  -->
  
  <project name="xslqetest" default="package.trax" basedir=".">
  
  <!-- @see build.bat,build.sh for how to use this -->
  <!-- The user should first setup system stuff in the CLASSPATH,
       like classes.zip, servlet.jar, and the JAVA_HOME env. var.
       build.bat/build.sh should then setup our other basic CLASSPATH
       dependencies: either from defaults of ../../java/bin, etc., 
       or from some user-specified JARDIR.
  
       For wrapper targets, the user must include any other JARS needed
       for the various wrappers, like xt.jar, xp.jar, ezx.jar, etc.
       Note, however, that pre-compiled .class files are already checked in 
       for some other wrappers. -->
  
      <property name="name" value="testxsl"/>
      <property name="Name" value="Testxsl"/>
      <property name="version" value="3.0"/>
      <property name="year" value="2000"/>
      <property name="copyright" value="Copyright &#169; ${year} The Apache Software Foundation.  All rights reserved."/>
      <property name="testxsl.jar" value="${name}.jar"/>
  
      <property name="build.compiler" value="classic"/>
      <property name="compiler" value="${build.compiler}"/>
      <property name="debug" value="on"/>
  
      <property name="src.dir" value="./src"/>
      <property name="test.root" value="/org/apache/qetest"/>
      <property name="test.dir" value="${src.dir}${test.root}"/>
      <property name="build.dir" value="./build"/>
      <property name="build.docs" value="${build.dir}/apidocs"/>
      <!-- // TODO add org.apache.qetest.xalanj2, xalanc1, etc.  -->
  
      <property name="javadocs.packages" 
                value="org.apache.qetest,org.apache.qetest.xslwrapper,org.apache.qetest.xsl,org.apache.qetest.trax,org.apache.qetest.xalanj1"/>
  
      <!-- Prepare output tree; copy over prebuilt classes -->
      <target name="prepare">
          <mkdir dir="${build.dir}" />
          <mkdir dir="${build.docs}" />
          <mkdir dir="${build.dir}${test.root}" />
          <!-- Also copy over precompiled external processor wrapper classes -->
          <copy todir="${build.dir}${test.root}/xslwrapper" >
              <fileset dir="${test.dir}/xslwrapper">
                  <include name="**/*.class" />
                  <include name="**/*.properties" />
              </fileset>
          </copy>
          
          <tstamp />
      </target>
  
      <!-- Compile generic qetest reporter; used by all tests; no code dependencies -->
      <target name="compile.reporter" depends="prepare">
          <javac srcdir="${test.dir}" 
                 destdir="${build.dir}" 
                 includes="*.java" 
                 debug="${debug}" />
      </target>
  
      <!-- Compile Processor-wrapper based tests; must also compile ProcessorWrapper itself -->
      <target name="compile.xsl" depends="compile.reporter">
          <javac srcdir="${test.dir}/xslwrapper" 
                 destdir="${build.dir}" 
                 includes="ProcessorWrapper.java"
                 debug="${debug}" />
          <javac srcdir="${test.dir}/xsl" 
                 destdir="${build.dir}" 
                 debug="${debug}" />
      </target>
      <target name="package.xsl" depends="compile.xsl">
          <jar jarfile="${build.dir}/${testxsl.jar}" 
               basedir="${build.dir}" 
               includes="**/*.class,**/*.properties" />
      </target>
  
      <!-- For Xalan-J 1.x testing, use these targets -->
      <target name="compile.xalan1" depends="compile.xsl">
          <javac srcdir="${test.dir}/xslwrapper" 
                 destdir="${build.dir}" 
                 includes="XalanWrapper.java"
                 debug="${debug}" />
          <javac srcdir="${test.dir}/xalanj1" 
                 destdir="${build.dir}" 
                 debug="${debug}" />
      </target>
      <target name="package.xalan1" depends="compile.xalan1">
          <jar jarfile="${build.dir}/${testxsl.jar}" 
               basedir="${build.dir}" 
               includes="**/*.class,**/*.properties" />
      </target>
  
      <!-- For TRAX interface-only testing, use these targets -->
      <target name="compile.trax" depends="compile.xsl">
          <javac srcdir="${test.dir}/xslwrapper" 
                 destdir="${build.dir}" 
                 includes="TraxWrapper.java"
                 debug="${debug}" />
          <javac srcdir="${test.dir}/trax" 
                 destdir="${build.dir}" 
                 debug="${debug}" />
      </target>
      <target name="package.trax" depends="compile.trax">
          <jar jarfile="${build.dir}/${testxsl.jar}" 
               basedir="${build.dir}" 
               includes="**/*.class,**/*.properties" />
      </target>
  
  
      <!-- All wrappers; requires competitor's jars in the classpath, as appropriate
           (You may be better off compiling other wrappers by hand, and then simply 
           checking in their .class files instead) -->
      <target name="compile.xslwrapper.wrappers" depends="prepare">
          <javac srcdir="${test.dir}/xslwrapper" 
                  destdir="${build.dir}" 
                  debug="${debug}" />
      </target>
  
      <target name="clean">
          <delete dir="${build.dir}"/>
      </target>
  
      <!-- =================================================================== -->
      <!-- Creates the API documentation                                       -->
      <!-- =================================================================== -->
      <target name="javadocs" depends="prepare">
          <javadoc
               sourcepath="${src.dir}"
               destdir="${build.docs}"
               packagenames="${javadocs.packages}"
               public="true"
               author="true"
               version="true"
               use="true"
               windowtitle="${Name}" 
               doctitle="${Name}"
               bottom="${copyright}"
          />
      </target>
  
  </project>