dleslie     00/06/12 13:55:32

  Modified:    .        build.xml
  Added:       .        build.bat
  Log:
  Updated build.xml to handle doc and samples. Javadoc will not build
  correctly (with groups) until the Ant tool is updated (I submitted a
  patch).
  build.bat is a preliminary batch file for setting classpath and
  calling Ant with this build.xml. A build.sh to follow soon....
  
  Revision  Changes    Path
  1.6       +140 -87   xml-xalan/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/build.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- build.xml 2000/05/27 21:54:30     1.5
  +++ build.xml 2000/06/12 20:55:31     1.6
  @@ -2,78 +2,103 @@
   
   <!-- ===================================================================
   
  -   Build file for Xalan
  -
  -Notes:
  -   This is a build file for use with the Jakarta Ant java build tool.
  +   Build file for Xalan - for use with the Jakarta Ant java build tool
  +   
  +Installation Instructions:
  +   To install Ant on your system, you need to download jakarta-ant from
  +   jakarta.apache.org/builds/tomcat/release/v3.1/src/ or check out the
  +   jakarta-ant module from the xml.apache.org CVS repository.
      
  -Installation Instructions:   
  -   To install Ant on your system, you need to checkout the
  -   "jakarta-tools" CVS module. Then you should place the files
  -     - ant.jar
  -     - projectx-tr2.jar
  -     - javac.jar
  -   in your classpath. (XML parser abstraction is currently in
  -   the todo list, volunteers welcome!)
  +   Then you should 
  +   
  +     - set the ANT_HOME environment variable to the jakarta-ant root 
directory
  +     - set the JAVA_HOME environment variable to the JDK (1.2.2 or higher) 
root directory
  +     
  +   When the Xalan team uses this tool to build a distribution, we also need 
to
  +     - copy the correct version (FOR THIS BUILD) of xerces.jar to the 
directory in which this file is located
  +     - update the (Xalan-J) version property in the "init" target
      
   Build Instructions:   
      To build, run
       
  -     java org.apache.tools.ant.Main
  +     build.bat (win32) or build.sh (linux) - optionally with a target arg as 
indicated below -
        
  -   on the directory where this file is located.
  +   in the directory where this file is located.
  +   
  +   The batch/shell file sets up your classpath and calls java 
org.apache.tools.ant.Main
  +   
  +Build targets
  +    This build file supports the following targets:
  +    - compile  compiles Xalan-J in ./build/classes.
  +    - package  creates ./build/xalan.jar [the default]
  +    - docs     creates the html User's Guide in ./build/docs
  +    - javadocs generates the API documentation in ./build/docs/apidocs
  +    - dist     creates a complete distribution in ./xalan-j_x_x_x
  +    - site     creates the site documentation tree in ./xml-site/target/xalan
  +    - clean    purges the build and distribution trees.
  +    
  +If you build a target that requires other targets, those other targets are 
created in 
  +the correct order.
   
   Authors:
     Stefano Mazzocchi <[EMAIL PROTECTED]>
     Shane Curcuru <[EMAIL PROTECTED]>
     Sam Ruby <[EMAIL PROTECTED]>
  +  Don Leslie <[email protected]>
     
   Fixme:
  -  - Still need to update docs, javadocs, dist targets to work properly
  +  - patch jakarta-ant to support use of javadoc -group option
     - use token evaluation to keep versining info in this file only - nearly 
ready
  -  - Much of this file now stolen from Stefano's xml-xerces build.xml
  +  - Much of this file stolen from Stefano's xml-xerces build.xml
   
   Copyright:
  -  Copyright (c) 1999 The Apache Software Foundation.
  +  Copyright (c) 1999-2000 The Apache Software Foundation.
     
  -   $Id: build.xml,v 1.5 2000/05/27 21:54:30 rubys Exp $
  +   $Id: build.xml,v 1.6 2000/06/12 20:55:31 dleslie Exp $
      
   ==================================================================== -->
   
   <project name="Xalan" default="package" basedir=".">
   
   <!-- You must set up your classpath ahead of time! -->
  -<!-- It must include: xerces.jar, bsf.jar, bsfengines.jar -->
  -
  -<!-- ====== You should not need to touch anything below here ====== -->
  -
  +<!-- It must include xerces.jar, bsf.jar, bsfengines.jar, and (to compile 
samples/servlet) servlet.jar -->
  +<!-- ====== You should not need to touch anything below here ====== -->      
  
     <target name="init">
  -    <property name="version" value="0.19.3-dev"/>
  +    <property name="version" value="1_1_0"/>
  +    <property name="xerces.bin.dir" value="/xerces-1_1_1"/>
  +    
       <property name="name" value="xalan"/>
  -    <property name="Name" value="Xalan"/>
  +    <property name="Name" value="Xalan-Java"/>
       <property name="year" value="2000"/>
  -    <property name="jarname" value="${name}"/>
   
       <property name="build.compiler" value="classic"/>
       <property name="debug" value="off"/>
   
       <property name="src.dir" value="./src"/>
  -    <property name="docs.dir" value="./docs"/>
  +    <property name="xdocs.dir" value="./xdocs"/>
       <property name="samples.dir" value="./samples"/>
       <property name="version.file" 
value="org/apache/xalan/xslt/XSLProcessorVersion.java"/>
       <property name="packages" value="org.*"/><!-- Check that this correctly 
gets all needed javadoc 17-Jan-00 SCurcuru -->
   
  -    <property name="docs.book" value="${docs.dir}/docs-book.xml"/>
  -    <property name="doc.generator" value="Stylebook"/>
  +    <property name="xdocs.book" value="${xdocs.dir}/sources/xalanlocal.xml"/>
  +    <property name="xdocs.style" value="${xdocs.dir}/style"/>
  +    <property name="xdocs.javadocbook" 
value="${xdocs.dir}/sources/javadocPackages.xml"/>
  +    <property name="xdocs.javadocloader" value="sbk:/style/loaderjdoc.xml"/>
  +    <property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
  +    <property name="doc.generator.javadocresource" 
value="${xdocs.dir}/xml-site-style.tar.gz"/>
   
       <property name="build.dir" value="./build"/>
       <property name="build.src" value="./build/src"/>
       <property name="build.dest" value="./build/classes"/>
       <property name="build.docs" value="./build/docs"/>
       <property name="build.samples" value="./build/samples"/>
  -    <property name="build.javadocs" value="./build/javadocs"/>  <!-- Changed 
name from old Makefile 17-Jan-00 SCurcuru -->
  -
  -    <property name="dist.dir" value="./${name}-${version}"/>    <!-- Check 
dir name dash/underscore 17-Jan-00 SCurcuru -->
  +    <property name="build.apidocs" value="./build/docs/apidocs"/>
  +    
  +    <property name="dist.file" value="${name}-j_${version}"/>
  +    <property name="dist.dir" value="./${dist.file}"/>    <!-- Check dir 
name dash/underscore 17-Jan-00 SCurcuru -->
  +    
  +    <property name="build.site" value="./build/site"/>
  +    <property name="site.book" value="${xdocs.dir}/sources/xalan.xml"/>
     </target>
   
     <!-- =================================================================== 
-->
  @@ -99,6 +124,7 @@
       <!-- <replace file="${build.src}/${version.file}" token="@@year@@" 
value="${year}"/> -->
     </target>
   
  +
     <!-- =================================================================== 
-->
     <!-- Compiles the source directory                                       
-->
     <!-- You must have already set your classpath appropriately! -->
  @@ -111,71 +137,80 @@
     <!-- Creates the class package                                           
-->
     <!-- =================================================================== 
-->
     <target name="package" depends="compile">
  -    <jar jarfile="${build.dir}/${jarname}.jar" basedir="${build.dest}" 
items="org"/>
  +    <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"/>
     </target>
   
     <!-- =================================================================== 
-->
     <!-- Compiles the samples                                                
-->
     <!-- =================================================================== 
-->
     <target name="samples" depends="package">
  +    <property name="exclude" value="*.xml,*.xsl,*.txt,*.html.*.properties"/>
       <mkdir dir="${build.samples}"/>
  -    <copydir src="${samples.dir}" dest="${build.samples}"/>
  +
       <!-- Since the samples are packageless, they must be compiled 
separately. -->
  -    <javac srcdir="${build.samples}/AppletXMLtoHTML" 
  -           destdir="${build.samples}/AppletXMLtoHTML" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/ApplyXPath" 
  -           destdir="${build.samples}/ApplyXPath" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/Extensions" 
  -           destdir="${build.samples}/Extensions" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/Pipe" 
  -           destdir="${build.samples}/Pipe" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/PureSAX" 
  -           destdir="${build.samples}/PureSAX" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/Servlet" 
  -           destdir="${build.samples}/Servlet" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/SimpleTransform" 
  -           destdir="${build.samples}/SimpleTransform" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/TransformToDom" 
  -           destdir="${build.samples}/TransformToDom" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <javac srcdir="${build.samples}/UseStylesheetParam" 
  -           destdir="${build.samples}/UseStylesheetParam" 
  -           classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  +    
  +    <javac srcdir="${samples.dir}/ApplyXPath" 
  +           destdir="${build.samples}" excludes="${exclude}"
  +           debug="${debug}"/>           
  +    <javac srcdir="${samples.dir}/Extensions" 
  +           destdir="${build.samples}" excludes="${exclude}" 
  +           debug="${debug}"/>
  +    <javac srcdir="${samples.dir}/Pipe" 
  +           destdir="${build.samples}"  excludes="${exclude}"
  +           debug="${debug}"/> 
  +    <javac srcdir="${samples.dir}/SimpleTransform" 
  +           destdir="${build.samples}"  excludes="${exclude}"
  +           debug="${debug}"/>
  +    <javac srcdir="${samples.dir}/TransformToDom" 
  +           destdir="${build.samples}"  excludes="${exclude}"
  +           debug="${debug}"/>
  +    <javac srcdir="${samples.dir}/PureSAX" 
  +           destdir="${build.samples}"  excludes="${exclude}"
  +           debug="${debug}"/>  -->           
  +    <javac srcdir="${samples.dir}/UseStylesheetParam" 
  +           destdir="${build.samples}"  excludes="${exclude}"
  +           debug="${debug}"/>           
  +    <javac srcdir="${samples.dir}/Servlet" 
  +           destdir="${build.samples}" excludes="${exclude}"
  +           debug="${debug}"/>
  +    <jar   jarfile="${build.samples}/${name}samples.jar" 
basedir="${build.samples}"
  +            includes="*.class"/> 
     </target>
   
     <!-- =================================================================== 
-->
     <!-- Generate HTML docs                                                  
-->
     <!-- =================================================================== 
-->
  -  <target name="docs" depends="package">
  +  <target name="docs" depends="init">
       <mkdir dir="${build.docs}"/>
  -    <copydir src="${docs.dir}" dest="${build.docs}"/>
  -    <echo message="FIXME: Compile and then run the Xalan-specific Stylebook 
class"/>
  -    <javac srcdir="${build.docs}" destdir="${build.docs}" 
classpath="${build.dir}/${jarname}.jar" debug="${debug}"/>
  -    <java class="${doc.generator}"/>
  +    <java fork="yes" classname="${doc.generator}"
  +         args="targetDirectory=${build.docs} ${xdocs.book} ${xdocs.style}"/> 
   
     </target>
   
     <!-- =================================================================== 
-->
     <!-- Creates the API documentation                                       
-->
     <!-- =================================================================== 
-->
     <target name="javadocs" depends="prepare-src">
  +  
  +    <!--gunzip src="${doc.generator.javadocresource}" dest="${xdocs.dir}"/-->
  +  
  +    <java fork="yes" classname="${doc.generator}"
  +          args="loaderConfig=${xdocs.javadocloader} 
targetDirectory=${build.src} ${xdocs.javadocbook} ${xdocs.style}"/>
  +
       <mkdir dir="${build.javadocs}"/>
  -    <echo message="FIXME: javadocs target still need updating; see 
docs/Makefile"/>
  -    <javadoc2 packagenames="${packages}"
  -              sourcepath="${build.src}"
  -              destdir="${build.javadocs}"
  -              author="true"
  -              version="true"
  -              use="true"
  -              windowtitle="${Name}"
  -              doctitle="${Name}"
  -              bottom="Copyright &#169; ${year} Apache XML Project. All 
Rights Reserved."
  +    <javadoc
  +         public="true"
  +         doclet="xalanjdoc.Standard"
  +         sourcepath="${build.src}"
  +         overview="${build.src}/javadocOverview.html"                      
packagenames="org.apache.xalan.xpath,org.apache.xalan.xpath.xdom,org.apache.xalan.xpath.dtm,org.apache.xalan.xpath.xml,org.apache.xalan.xslt,org.apache.xalan.xslt.trace,org.apache.xalan.xslt.client,org.apache.xalan.xslt.extensions"
 
  +         group="XSLT_Packages org.apache.xalan.xslt*,XPath_Packages 
org.apache.xalan.xpath*"
  +         verbose="true"
  +         destdir="${build.apidocs}"
  +         author="true"
  +         version="true"
  +         use="true"
  +         windowtitle="${Name}" 
  +         doctitle="${Name}"
  +         bottom="Copyright &#169; ${year} Apache XML Project. All Rights 
Reserved."
       />
     </target>
   
  @@ -190,34 +225,52 @@
     <!-- =================================================================== 
-->
     <!-- Creates the distribution                                            
-->
     <!-- =================================================================== 
-->
  -  <target name="dist" depends="package, javadocs, samples">
  +  <target name="dist" depends="docs,javadocs">
       <mkdir dir="${dist.dir}"/>
       <mkdir dir="${dist.dir}/src"/>
  +    <mkdir dir="${dist.dir}/xdocs"/>
       <mkdir dir="${dist.dir}/docs"/>
  -    <mkdir dir="${dist.dir}/docs/images"/>
       <mkdir dir="${dist.dir}/docs/javadocs"/>
       <mkdir dir="${dist.dir}/samples"/>
   
       <copydir src="${build.src}" dest="${dist.dir}/src"/>
  -    <copydir src="${build.javadocs}" dest="${dist.dir}/docs/javadocs"/>
  -    <copydir src="${build.samples}" dest="${dist.dir}/samples"/>
  +    <copydir src="${xdocs.dir}" dest="${dist.dir}/xdocs"/>
  +    <copydir src="${build.docs}" dest="${dist.dir}/docs"/>
  +
  +    <copydir src="${samples.dir}" dest="${dist.dir}/samples"/>   
  +    <copyfile src="${build.samples}/${${name}samples.jar" 
dest="${dist.dir}/samples/${name}samples.jar"/>
   
       <copyfile src="${build.dir}/${name}.jar" dest="${dist.dir}/${name}.jar"/>
  +    <copyfile src="xerces.jar" dest="${dist.dir}/xerces.jar"/>
  +    <copyfile src="bsf.jar" dest="${dist.dir}/bsf.jar"/>
  +    <copyfile src="bsfengines.jar" dest="${dist.dir}/bsfengines.jar"/>
       <copyfile src="README" dest="${dist.dir}/README"/>
  -    <copyfile src="DONE" dest="${dist.dir}/DONE"/>
  -    <copyfile src="BUGS" dest="${dist.dir}/BUGS"/>
  +    <copyfile src="README.html" dest="${dist.dir}/README.html"/>
       <copyfile src="CREDITS" dest="${dist.dir}/CREDITS"/>
       <copyfile src="KEYS" dest="${dist.dir}/KEYS"/>
       <copyfile src="License" dest="${dist.dir}/License"/>
  -    <copyfile src="STATUS" dest="${dist.dir}/STATUS"/>
       <copyfile src="build.xml" dest="${dist.dir}/build.xml"/>
  -    <copyfile src="bsf.jar" dest="${dist.dir}/bsf.jar"/>
  -    <copyfile src="bsfengines.jar" dest="${dist.dir}/bsfengines.jar"/>
       <copyfile src="Makefile" dest="${dist.dir}/Makefile"/>
       <copyfile src="make.include" dest="${dist.dir}/make.include"/>
       <copyfile src="make.include2" dest="${dist.dir}/make.include2"/>
  -
  -    <echo message="FIXME: Should really be creating a jar file, not a zip 
file! 17-Jan-00 SCurcuru"/>
  -    <zip zipfile="${name}-${version}.zip" basedir="${dist.dir}" items="*"/>
  +    
  +    <zip zipfile="${dist.file}.zip" basedir="${dist.dir}" includes="*"/>
  +    <tar tarfile="${dist.file}.tar" basedir="${dist.dir}" includes="*"/>
  +    <gzip src="${dist.file}.tar" zipfile="${dist.file}.tar.gz"/>
     </target>
  +  
  +  <!-- =================================================================== 
-->
  +  <!-- Creates the documentation tree for the org.apache.xml website       
-->
  +  <!-- =================================================================== 
-->
  +  <target name="site" depends="javadocs">
  + 
  +    <mkdir dir="${build.site}"/>
  +    <mkdir dir="${build.site}/apidocs"/>
  +    
  +    <java fork="yes" classname="${doc.generator}" 
  +         args="targetDirectory=${build.site} ${site.book} ${xdocs.style}"/>
  +       
  +    <copydir src="${build.apidocs}" dest="${build.site}/apidocs"/>
  +  </target>  
  +    
   </project>
  
  
  
  1.1                  xml-xalan/build.bat
  
  Index: build.bat
  ===================================================================
  @echo off
  
  if "%JAVA_HOME%" == "" goto error
  
  echo.
  echo Xalan-J Build
  echo -------------
  
  set ANT_HOME=\jakarta-ant
  set SERVLET=\jswdk-1.0.1\lib\servlet.jar
  
  set ANT=%ANT_HOME%\lib\ant.jar
  set XML=%ANT_HOME%\lib\xml.jar
  set JAVAC=%JAVA_HOME%\lib\tools.jar
  set JAXP=
  set XERCES=xerces.jar
  set BSF=bsf.jar
  set BSFENGINES=bsfengines.jar
  set XALAN=xalan.jar
  set DOCGENERATOR=xdocs\stylebook-1.0-b2.jar
  set DOCLET=xdocs\xalanjdoc.jar
  
  set HOLDPATH=%CLASSPATH%
  set 
CLASSPATH=%ANT%;%XML%;%JAVAC%;%XERCES%;%XALAN%;%BSF%;%BSFENGINES%;%SERVLET%;%DOCGENERATOR%;%DOCLET%;%CLASSPATH%
  
  echo.
  echo Building with classpath %CLASSPATH%
  
  echo.
  echo Starting Ant...
  
  rem -classpath "%CLASSPATH%" 
  
  %JAVA_HOME%\bin\java.exe -Dant.home="%ANT_HOME%" org.apache.tools.ant.Main %1 
%2 %3 %4 %5
  
  goto end
  
  :error
  
  echo "ERROR: JAVA_HOME not found in your environment."
  echo.
  echo "Please, set the JAVA_HOME environment variable to match the"
  echo "root directory of the Java Virtual Machine you want to use."
  
  :end
  
  rem set CLASSPATH=%HOLDPATH%
  set HOLDPATH=
  set JAXP=
  set XERCES=
  set XALAN=
  set BSF=
  set BSFENGINES=
  set SERVLET=
  set DOCGENERATOR=
  set DOCLET=
  set ANT=
  set XML=
  set ANT_HOME=
  set JAVAC=
  
  

Reply via email to