curcuru     2003/02/19 08:48:17

  Modified:    java/xpath_rwapi Tag: xslt20 build.xml build.bat
  Log:
  Update so at least compile/jar/test targets run inside Eclipse
  Still cannot get style/javacc to run in Eclipse; run those using build.bat externally
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +43 -36    xml-xalan/java/xpath_rwapi/Attic/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/Attic/build.xml,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- build.xml 19 Feb 2003 14:24:02 -0000      1.1.2.7
  +++ build.xml 19 Feb 2003 16:48:17 -0000      1.1.2.8
  @@ -8,8 +8,6 @@
      Before running an Ant build, you must
      
        - set the JAVA_HOME environment variable to the JDK root directory
  -     - To build 'servlet' sample: Include Servlet SDK in your classpath
  -     - To build docs/javadocs/xsltc: use JDK 1.2.x or higher
      
   Build Instructions:   
     To build, run
  @@ -17,22 +15,17 @@
     in the directory where this file is located; you should also be 
     able to use an installation of Ant v1.4.1 or later.
      
  -  build -projecthelp  will show a list of supported targets.
  +  build -projecthelp  will  show a list of supported targets.
      
     Developers: include a description="" attribute in all user-callable targets.
           
  -  If you build a target that depends on other targets, those other 
  -  targets are *usually* created in the correct order; however a 
  -  few of the larger targets like dist do not list all dependencies.
  -  
   Authors:
     Shane Curcuru <[EMAIL PROTECTED]>
  -  Don Leslie <[EMAIL PROTECTED]>
     Scott Boag <[EMAIL PROTECTED]>
     Lionel Villard <[EMAIL PROTECTED]>
   
   Copyright:
  -  Copyright (c) 1999-2001 The Apache Software Foundation.
  +  Copyright (c) 1999-2003 The Apache Software Foundation.
      $Id$
   ==================================================================== -->
   
  @@ -41,7 +34,8 @@
     <property name="build.dir" value="../build"/>
     <property name="build.classes" value="${build.dir}/classes"/>
     <property name="build.debug" value="on"/>
  -  <property name="bin.dir" value="../bin"/>
  +  <!-- Note bin.dir assumes we're using Xalan's checked-in copy of ant.jar -->
  +  <property name="bin.dir" value="${ant.home}/bin"/>
     <property name="jarfilename" value="xpathapi.jar"/>
   
     <property name="spec" value="xpath"/>
  @@ -56,44 +50,58 @@
     <property name="test.expr" value="a/b/c"/>
     
     <path id="classpath">
  +    <!-- This should include all .jars needed to compile, including 
  +         a checked-in copy of xalan.jar and the JavaCC.zip file -->
       <fileset dir="${bin.dir}" includes="*.jar"/>
  +    <fileset dir="${bin.dir}" includes="*.zip"/>
     </path>
   
     <path id="test.classpath">
  +    <path refid="classpath" />
       <fileset dir="${build.dir}" includes="*.jar"/>
  -    <fileset dir="${bin.dir}" includes="*.jar"/>
     </path>
   
     <target name="clean"
  -    description="Clean up ALL classfiles and jars (but not generated .java source)">
  +    description="Clean up ALL classfiles, generated sources, and ${jarfilename}">
       <delete dir="${build.classes}"/>
       <delete file="${build.dir}/${jarfilename}"/>
  +    <delete file="${grammar.dir}/custom-xpath-grammar.xml"/>
  +    <delete file="${target.parser}/xpath-grammar.jjt"/>
  +  </target>
  +
  +  <target name="init">
  +    <echo message="Preset classpath is ${java.class.path}; ant.home is 
${ant.home}"/>
  +    <mkdir dir="${build.classes}"/>
  +    <mkdir dir="${target.parser}"/>
     </target>
   
  -  <target name="gen-grammar">
  -      <mkdir dir="${target.parser}"/>
  -    
  -             <!-- first customized from original xpath-grammar -->
  -      <style style="${grammar.dir}/customize.xsl" 
in="${grammar.dir}/xpath-grammar.xml" 
  -         out="${grammar.dir}/custom-xpath-grammar.xml" force="yes" extension=".xml" 
destdir="${grammar.dir}"/>
  -    
  -      <style style="${tree.xsl}" in="${grammar.dir}/custom-xpath-grammar.xml" 
  -         out="${target.parser}/xpath-grammar.jjt" force="yes" extension=".jjt" 
destdir="${spec}">
  -             <param name="spec" expression="${spec}"/>
  -             <param name="package-name" 
expression="org.apache.xpath.rwapi.impl.parser"/>
  -      </style>
  +  <!-- ==== Code generation targets ==== -->
  +  <target name="gen-grammar" depends="init"
  +    description="[1]Use style task to turn grammar into jjt files">
   
  +    <!-- first customized from original xpath grammar -->
  +    <style style="${grammar.dir}/customize.xsl" 
in="${grammar.dir}/xpath-grammar.xml" 
  +      out="${grammar.dir}/custom-xpath-grammar.xml" force="yes" extension=".xml" 
  +      destdir="${grammar.dir}" classpathref="classpath" />
  +
  +    <style style="${tree.xsl}" in="${grammar.dir}/custom-xpath-grammar.xml" 
  +      out="${target.parser}/xpath-grammar.jjt" force="yes" extension=".jjt" 
  +      destdir="${spec}" classpathref="classpath" >
  +        <param name="spec" expression="${spec}"/>
  +        <param name="package-name" expression="org.apache.xpath.rwapi.impl.parser"/>
  +    </style>
     </target>
     
  -  <target name="jjtree" depends="gen-grammar">
  +  <target name="jjtree" depends="gen-grammar"
  +    description="[2]Use JJTree to create tree sources">
       <jjtree target="${target.parser}/xpath-grammar.jjt" 
                javacchome="${bin.dir}" 
                outputdirectory="${target.parser}"
                static="false"/>
     </target>
   
  -  <target name="javacc" depends="jjtree">
  -     
  +  <target name="javacc" depends="jjtree"
  +    description="[3]Compile compile the tree sources">
       <javacc target="${target.parser}/xpath-grammar.jj" 
            javacchome="${bin.dir}"
            debugtokenmanager="${debug}"
  @@ -105,25 +113,24 @@
           outputdirectory="${target.parser}"/>
     </target>
     
  -  <target name="prepare">
  -             <mkdir dir="${build.classes}"/>
  -     </target>
  -  
  -  <target name="compile" depends="prepare">
  +  <!-- ==== Code compilation and jar targets ==== -->
  +  <target name="compile" depends="init"
  +    description="[4]Compile all sources, including generated parser">
        <javac srcdir="src" destdir="${build.classes}" debug="${build.debug}">
                <classpath refid="classpath"/>
        </javac>
     </target>
     
  -  <target name="jar" depends="compile">
  +  <target name="jar" depends="compile"
  +    description="[5]Jar standalone XPath engine into ${jarfilename}">
       <jar jarfile="${build.dir}/${jarfilename}">
         <fileset dir="${build.classes}"
                  includes="${rwapi.package}/**"/>
       </jar>
  -
     </target>
   
  -  <target name="test" depends="jar">
  +  <target name="test" depends="jar"
  +    description="[last]Run a simple test of XPath AST creation">
       <java fork="yes" classname="${test.class}" >
         <classpath refid="test.classpath" />
         <arg line="${test.expr}"/>
  
  
  
  1.1.2.3   +10 -8     xml-xalan/java/xpath_rwapi/Attic/build.bat
  
  Index: build.bat
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/Attic/build.bat,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- build.bat 23 Jan 2003 19:36:42 -0000      1.1.2.2
  +++ build.bat 19 Feb 2003 16:48:17 -0000      1.1.2.3
  @@ -25,28 +25,30 @@
   rem Default command used to call java.exe or equivalent
   if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
   
  -rem Default _ANT_HOME to Xalan's checked-in copy if not set
  -set _ANT_HOME=%ANT_HOME%
  -if "%_ANT_HOME%" == "" set _ANT_HOME=.
  +rem Currently, you must use Xalan's checkedin copy of ant etc.
  +set _ANT_HOME=..
   
   rem Default locations of jars we depend on to run Ant on our build.xml file
   rem Set our local vars to all start with _underscore
  +rem NOTE: *only* include Ant and parser; other .jars must be 
  +rem     included in the build.xml file to allow Eclipse use
  +rem Except, of course, the JavaCC.zip file which must be present too
   set _ANT_JAR=%ANT_JAR%
  -if "%_ANT_JAR%" == "" set 
_ANT_JAR=..\bin\optional.jar;..\bin\ant.jar;..\bin\JavaCC.jar;..\bin\xalan.jar
  +if "%_ANT_JAR%" == "" set _ANT_JAR=%_ANT_HOME%\bin\ant.jar
   set _PARSER_JAR=%PARSER_JAR%
  -if "%_PARSER_JAR%" == "" set _PARSER_JAR=..\bin\xercesImpl.jar
  +if "%_PARSER_JAR%" == "" set _PARSER_JAR=%_ANT_HOME%\bin\xercesImpl.jar
   set _XML-APIS_JAR=%XML-APIS_JAR%
  -if "%_XML-APIS_JAR%" == "" set _XML-APIS_JAR=..\bin\xml-apis.jar
  +if "%_XML-APIS_JAR%" == "" set _XML-APIS_JAR=%_ANT_HOME%\bin\xml-apis.jar
   
   rem Attempt to automatically add system classes to _CLASSPATH
   rem Use _underscore prefix to not conflict with user's settings
   set _CLASSPATH=%CLASSPATH%
   if exist "%JAVA_HOME%\lib\tools.jar" set 
_CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
   if exist "%JAVA_HOME%\lib\classes.zip" set 
_CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\classes.zip
  -set 
_CLASSPATH=%_ANT_JAR%;%_XML-APIS_JAR%;%_PARSER_JAR%;%_CLASSPATH%;..\bin\Tidy.jar
  +set _CLASSPATH=%_ANT_JAR%;%_XML-APIS_JAR%;%_PARSER_JAR%;%_CLASSPATH%
   
   @echo on
  -"%_JAVACMD%" -mx64m %JAVA_OPTS% -Dant.home="%ANT_HOME%" -classpath "%_CLASSPATH%" 
org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
  +"%_JAVACMD%" -mx64m %JAVA_OPTS% -Dant.home="%_ANT_HOME%" -classpath "%_CLASSPATH%" 
org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
   @echo off
   
   goto end
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to