cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon build.xml
Date Wed, 09 Feb 2000 21:31:16 GMT
stefano     00/02/09 13:31:16

  Modified:    .        build.xml
  Log:
  updated
  
  Revision  Changes    Path
  1.28      +90 -61    xml-cocoon/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/build.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- build.xml	2000/02/02 00:52:13	1.27
  +++ build.xml	2000/02/09 21:31:16	1.28
  @@ -1,5 +1,5 @@
  -<?xml version="1.0"?>
   
  +
   <!-- ===========================================================================
   
    Cocoon build file 
  @@ -9,6 +9,7 @@
    
   Todo:
    - write the target rule that reacts on class presence.
  + - !!!!!!!!!! update build instructions !!!!!!!!!!
    
   ================================================================================
   
  @@ -27,7 +28,7 @@
   
   The Cocoon build system is based on Jakarta Ant, which is a Java building tool
   originally developed for the Jakarta Tomcat project but now used in many other
  -Apache projects and extended by many developers, myself included.
  +Apache projects and extended by many developers.
   
   Ant is a little but very handy tool that uses a build file written in XML 
   (this file) as building instructions. There are targets (like in make) and
  @@ -36,6 +37,10 @@
   element attributes, using bean-like 'setter' methods.
   
   First thing you should do to be able to compile Cocoon or generate its 
  +<<<<<<< build.xml
  +documentation, is to install Ant on your system. To do this, look into the 
  +/lib directory of the distribution where you will find
  +=======
   documentation, is to install Ant on your system.  Ant is available
   under the jakarta.apache.org project, but unfortunately at the moment
   the latest milestone build does not include some fixes required to
  @@ -50,35 +55,53 @@
     - xml.jar
     
   that you should place into your classpath.
  +
  +Ok, at this point, you need to make the java compiler available to Ant.
   
  -Ok, at this point, you need to make the java compiler available so you should
  -either add
  +If you are using Java 1.1 you can go ahead since your java compiler is already
  +in your classpath. Otherwise, if you're using Java 1.2 or later, you should
  +add
    
     - tools.jar
   
  -that you find in your <java_home>/lib/ directory in case you have Java 1.2 or
  -later. If you have Java 1.1.x, the required javac classes are located in your
  -classes.zip file and should already be in your classpath (otherwise, make sure).
  +that you find in your <java_home>/lib/ directory, to your classpath (or place
  +it into the <java_home>/jre/lib/ext directory).
   
   Now that the build tool is in place, you need to download the following
   packages from the indicated URL:
   
  - Apache Xerces 1.0.1+   - http://xml.apache.org/dist/
  - Apache Xalan 0.19.1+   - http://xml.apache.org/dist/
  - Apache FOP 0.12.0+     - http://xml.apache.org/dist/
  + Apache Xerces 1.0.1+   - in the /lib directory or http://xml.apache.org/dist/
  + Apache Xalan 0.19.1+   - in the /lib directory or http://xml.apache.org/dist/
  + Apache FOP 0.12.0+     - in the /lib directory or http://xml.apache.org/dist/
    
  - Sun ProjectX (TR2)     - http://java.sun.com/xml/index.html
  - Sun Servlet API (2.2+) - http://java.sun.com/products/servlet/index.html
  + Sun Servlet API (2.2+) - http://jakarta.apache.org (download any Tomcat version)
    Sun JNDI API (1.2.1+)  - http://java.sun.com/products/jndi/index.html
   
    James Clark XT         - ftp://ftp.jclark.com/pub/xml/xt.zip
    FESI (1.21+)           - http://home.worldcom.ch/jmlugrin/fesi/download.html
  - GNU RegExp (1.0.8+)    - http://www.cacas.org/java/gnu/regexp/
   
  - StyleBook (1.0b1+)     - xml-stylebook CVS at xml.apache.org
  + StyleBook (1.0b1+)     - xml-stylebook CVS module from xml.apache.org
   
   [xml-stylebook are required only for documentation generation, not for compilation]
  +
  +Some of these packages will require you to download an archive file (.zip or .jar)
  +and extract a jar file from that (typically the name of the program, e.g. xerces.jar)
    
  +You should have the following jar files in your classpath before going on:
  +
  + - tools.jar
  + - ant.jar
  + - xml.jar
  + - xerces.jar
  + - xalan.jar
  + - fop_bin_0_12_0.jar
  + - servlet.jar
  + - jndi.jar
  + - ldap.jar
  + - xt.jar
  + - fesi.jar
  + - gnu-regexp-1.0.8.jar 
  + 
   once you have placed all the ".jar" files in your classpath, you're ready to
   build the whole thing.
   
  @@ -88,7 +111,7 @@
     java org.apache.tools.ant.Main
   
   if everything is right and all the required packages are visible, this action
  -will generate a file called "Cocoon.jar" in the "./build" directory. Note, that
  +will generate a file called "cocoon.jar" in the "./build" directory. Note, that
   if you do further development, compilation time is reduced since Ant is able
   to detect which files have changed an to recompile them at need.
   
  @@ -98,7 +121,7 @@
   
   These are the meaningful targets for this build file:
   
  - - package -> creates ./build/Cocoon.jar
  + - package -> creates ./build/cocoon.jar
    - docs -> generates the HTML documentation in ./build/docs (requires StyleBook)
    - javadocs -> generates the API documentation in ./build/javadocs
    - dist -> generates the Cocoon distribution
  @@ -115,33 +138,6 @@
   unsupported classes out of the compilation. For now, it's easier to download
   all the required packages or to remove/rename the Cocoon modules you don't use.
   
  -2) why not using make or more standard stuff?
  -
  - - performance: Ant is faster because it allows a single JVM to be reused
  - - portability: Ant is pure java, very small, works every java platform and can
  -   be easily tuned for special needs.
  - - fitness: unlike other tools, Ant is specifically developed for java building
  -   and it adds features that are found in every java building process 
  -   transparently reducing verbosity, increasing visibility and reducing 
  -   management and portability costs.
  - - simplicity: Ant is not as flexible as other systems on purpose. This is done
  -   to allow newbies, expecially from the non-Unix world to be up to speed
  -   sooner, without requiring to learn other languages and paradigms.
  -   
  -3) can I use Ant for my stuff?
  -
  -Sure. We highly welcome you to do so, but please, if you clone or copy parts
  -of build files, give credits to the original authors. Thank you.
  -
  -4) why does Ant replies with the following message?
  -
  -"BUILD CONFIG ERROR: Could not create task of type: javadoc 
  - due to java.lang.NullPointerException"
  -
  -This is because you need to upgrade your installed Ant, major improvements
  -in the build process make older versions obsolete and Cocoon requires these
  -new improvements in order to build correctly.
  -
   ============================================================================ -->
   
   <project default="package" basedir=".">
  @@ -151,19 +147,21 @@
     <!-- =================================================================== -->
     <target name="init">
       <tstamp/>
  -    <property name="name" value="Cocoon"/>
  +    <property name="Name" value="Cocoon"/>
  +    <property name="name" value="cocoon"/>
       <property name="version" value="1.6.2-dev"/>
       <property name="year" value="1999-2000"/>
   
  -    <echo message="------------------- ${name} ${version} [${year}] ----------------"/>
 
  +    <echo message="------------------- ${Name} ${version} [${year}] ----------------"/>
 
       
       <property name="build.compiler" value="classic"/>
       <!-- <property name="build.compiler" value="jikes"/> -->
       <property name="debug" value="off"/>
       <property name="optimize" value="on"/>
       <property name="deprecation" value="off"/>
  -  
  +    
       <property name="src.dir" value="./src"/>
  +    <property name="lib.dir" value="./lib"/>
       <property name="docs.dir" value="./xdocs"/>
       <property name="dtd.dir" value="./xdocs/dtd"/>
       <property name="skins.dir" value="./skins"/>
  @@ -171,9 +169,12 @@
       <property name="samples.dir" value="./samples"/>
       <property name="version.file" value="org/apache/cocoon/Defaults.java"/>
       <property name="packages" value="org.apache.cocoon.*"/>
  +
  +    <property name="classpath" value="${lib.dir}/xerces_1_0_1.jar:${lib.dir}/xalan_0_19_2.jar:${lib.dir}/fop_0_12_0.jar:${lib.dir}/servlet_2_2.jar"/>
     
       <property name="skin" value="./skins/xml.apache.org/"/>
       <property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
  +    <property name="doc.generator.package" value="${lib.dir}/stylebook-1.0-b2.jar"/>
     
       <property name="build.dir" value="./build"/>
       <property name="build.src" value="./build/src"/>
  @@ -197,11 +198,12 @@
       <echo message=""/>
       <echo message=" available targets are:"/>
       <echo message=""/>
  -    <echo message="   package  --> generates the Cocoon.jar file (default)"/>
  +    <echo message="   package  --> generates the cocoon.jar file (default)"/>
       <echo message="   compile  --> compiles the source code"/>
       <echo message="   docs     --> generates the HTML documentation"/>
       <echo message="   javadocs --> generates the API documentation (java 1.2 only)"/>
  -    <echo message="   dist     --> generates the Cocoon distribution"/>
  +    <echo message="   dist-zip --> generates the Cocoon distribution as .zip"/>
  +    <echo message="   dist-tgz --> generates the Cocoon distribution as .tar.gz"/>
       <echo message="   clean    --> cleans up the directory"/>
       <echo message="   site     --> generates the Cocoon web site"/>
       <echo message=""/>
  @@ -238,20 +240,27 @@
     <!-- Compiles the source directory                                       -->
     <!-- =================================================================== -->
     <target name="compile" depends="prepare-src">
  -    <javac srcdir="${build.src}" destdir="${build.dest}" classpath="${classpath}" debug="${debug}"/>
  +    <javac srcdir="${build.src}" 
  +           destdir="${build.dest}" 
  +           classpath="${classpath}" 
  +           debug="${debug}"
  +           optimize="${optimize}"/>
     </target>
   
     <!-- =================================================================== -->
     <!-- Creates the class package                                           -->
     <!-- =================================================================== -->
     <target name="package" depends="compile">
  -    <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}" manifest="${build.src}/Manifest.mf"
items="org"/>
  +    <jar jarfile="${build.dir}/${name}.jar" 
  +         basedir="${build.dest}" 
  +         manifest="${build.src}/Manifest.mf" 
  +         includes="org/**"/>
     </target>
   
     <!-- =================================================================== -->
     <!-- Prepares the docs                                                   -->
     <!-- =================================================================== -->
  -  <target name="prepare-docs" depends="init">
  +  <target name="prepare-docs">
       <copyfile src="changes.xml" dest="${docs.dir}/changes.xml"/>
       <copyfile src="todo.xml" dest="${docs.dir}/todo.xml"/>
   
  @@ -269,7 +278,8 @@
       <mkdir dir="${build.docs}"/>
       <copyfile src="${docs.dir}/docs-book.xml" dest="${docs.dir}/book.xml"/>
       <replace file="${docs.dir}/book.xml" token="@@year@@" value="${year}"/>
  -    <java class="${doc.generator}" args="targetDirectory=${build.docs} ${docs.dir}/book.xml
${skin}" fork="yes"/>
  +    <java fork="yes" classpath="${doc.generator.package}" class="${doc.generator}" 
  +          args="targetDirectory=${build.docs} ${docs.dir}/book.xml ${skin}"/>
     </target>
   
     <!-- =================================================================== -->
  @@ -279,7 +289,8 @@
       <mkdir dir="${site.dir}"/>  
       <copyfile src="${docs.dir}/site-book.xml" dest="${docs.dir}/book.xml"/>
       <replace file="${docs.dir}/book.xml" token="@@year@@" value="${year}"/>
  -    <java class="${doc.generator}" args="targetDirectory=${site} ${docs.dir}/book.xml
${skin}" fork="yes"/>
  +    <java fork="yes" classpath="${doc.generator.package}" class="${doc.generator}" 
  +          args="targetDirectory=${site} ${docs.dir}/book.xml ${skin}"/>
     </target>
     
     <!-- =================================================================== -->
  @@ -292,9 +303,10 @@
                destdir="${build.javadocs}"
                author="true"
                version="true"
  -             use="true"
  -             windowtitle="${name} API"
  -             doctitle="${name}"
  +             use="false"
  +             noindex="true"
  +             windowtitle="${Name} API"
  +             doctitle="${Name}"
                bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights
Reserved."
                stylesheetfile="${skins.dir}/javadoc.css"
       />
  @@ -306,6 +318,7 @@
     <target name="dist" depends="package, docs, javadocs">
       <mkdir dir="${dist.dir}"/>
       <mkdir dir="${dist.dir}/bin"/>
  +    <mkdir dir="${dist.dir}/lib"/>
       <mkdir dir="${dist.dir}/src"/>
       <mkdir dir="${dist.dir}/conf"/>
       <mkdir dir="${dist.dir}/docs"/>
  @@ -314,24 +327,40 @@
       <mkdir dir="${dist.dir}/skins"/>
       <mkdir dir="${dist.dir}/xdocs"/>
   
  -    <copydir src="${build.src}" dest="${dist.dir}/src" ignore="cocoon.properties"/>
  +    <copydir src="${build.src}" dest="${dist.dir}/src" excludes="cocoon.properties"/>
       <copyfile src="${src.dir}/org/apache/cocoon/cocoon.properties" dest="${dist.dir}/conf/cocoon.properties"/>
       <copyfile src="${build.dir}/${name}.jar" dest="${dist.dir}/bin/${name}.jar"/>
       <copydir src="${build.docs}" dest="${dist.dir}/docs"/>
       <copydir src="${build.javadocs}" dest="${dist.dir}/docs/api"/>
       <copydir src="${samples.dir}" dest="${dist.dir}/samples"/>
       <replace file="${samples.dir}/index.xsl" token="@@year@@" value="${year}"/>
  -    <copydir src="${docs.dir}" dest="${dist.dir}/xdocs" ignore="book.xml, changes.xml,
todo.xml"/>
  +    <copydir src="${docs.dir}" dest="${dist.dir}/xdocs" excludes="book.xml, changes.xml,
todo.xml"/>
       <copydir src="${skins.dir}" dest="${dist.dir}/skins"/>
  +    <copydir src="${lib.dir}" dest="${dist.dir}/lib"/>
   
       <copyfile src="README" dest="${dist.dir}/README"/>
  -    <replace file="${dist.dir}/README" token="@@version@@" value="${version}"/>
       <copyfile src="LICENSE" dest="${dist.dir}/LICENSE"/>
  -    <copyfile src="build.xml" dest="${dist.dir}/build.xml"/>
  +    <replace file="${dist.dir}/README" token="@@version@@" value="${version}"/>
  +
  +    <copydir src="." dest="${dist.dir}" includes="build.*"/>
  +    
       <copyfile src="${docs.dir}/changes.xml" dest="${dist.dir}/changes.xml"/>
       <copyfile src="${docs.dir}/todo.xml" dest="${dist.dir}/todo.xml"/>
  +  </target>
  +  
  +  <!-- =================================================================== -->
  +  <!-- Packages the distribution with ZIP                                  -->
  +  <!-- =================================================================== -->
  +  <target name="dist-zip" depends="dist">
  +    <zip zipfile="${Name}-${version}.zip" basedir="${dist.dir}" includes="**"/>
  +  </target>
   
  -    <jar jarfile="${name}-${version}.jar" basedir="${dist.dir}" items="."/>
  +  <!-- =================================================================== -->
  +  <!-- Packages the distribution with TAR-GZIP                             -->
  +  <!-- =================================================================== -->
  +  <target name="dist-tgz" depends="dist">
  +    <!-- <tar tarfile="${Name}-${version}.tar" basedir="${dist.dir}" includes="**"/>
-->
  +    <gzip zipfile="${Name}-${version}.tar.gz" src="${Name}-${version}.tar"/>
     </target>
   
     <!-- =================================================================== -->
  
  
  

Mime
View raw message