You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@locus.apache.org on 2000/09/16 02:12:24 UTC
cvs commit: xml-cocoon build.bat build.sh index.html build.xml
stefano 00/09/15 17:12:24
Modified: . Tag: xml-cocoon2 build.bat build.sh index.html
build.xml
Log:
MUCH better building system (with docs!!!)
Revision Changes Path
No revision
No revision
1.10.2.11 +20 -29 xml-cocoon/build.bat
Index: build.bat
===================================================================
RCS file: /home/cvs/xml-cocoon/build.bat,v
retrieving revision 1.10.2.10
retrieving revision 1.10.2.11
diff -u -r1.10.2.10 -r1.10.2.11
--- build.bat 2000/08/17 16:44:53 1.10.2.10
+++ build.bat 2000/09/16 00:12:23 1.10.2.11
@@ -1,41 +1,32 @@
@echo off
+:: -----------------------------------------------------------------------------
+:: build.bat - Win32 Build Script for Apache Cocoon
+::
+:: $Id: build.bat,v 1.10.2.11 2000/09/16 00:12:23 stefano Exp $
+:: -----------------------------------------------------------------------------
-if "%JAVA_HOME%" == "" goto error
+:: ----- Verify and Set Required Environment Variables -------------------------
-if not "%LIB_HOME%" == "" goto skip
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo You must set JAVA_HOME to point at your Java Development Kit installation
+goto cleanup
+:gotJavaHome
-set LIB_HOME=.\lib
+if not "%ANT_HOME%" == "" goto gotAntHome
+set ANT_HOME=.
+:gotAntHome
-:skip
+:: ----- Set Up The Runtime Classpath ------------------------------------------
-echo.
-echo Cocoon Build System
-echo -------------------
+set CP=%JAVA_HOME%\lib\tools.jar;%ANT_HOME%\lib\ant.jar;
-set ANT_HOME=.\lib
+:: ----- Execute The Requested Build -------------------------------------------
-set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar
-for %%i in (%LIB_HOME%\*.jar) do call lcp.bat %%i
+%JAVA_HOME%\bin\java.exe %ANT_OPTS% -classpath %CP% org.apache.tools.ant.Main -Dant.home=%ANT_HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
-echo.
-echo Building with classpath %LOCALCLASSPATH%
+:: ----- Cleanup the environment -----------------------------------------------
-echo.
-echo Starting Ant...
+:cleanup
+set CP=
-%JAVA_HOME%\bin\java.exe -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%" 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 variable in your environment to match the"
-echo "location of the Java Virtual Machine you want to use."
-
-:end
-
-set LOCALCLASSPATH=
-set ANT_HOME=
-set LIB_HOME=
1.10.2.9 +17 -14 xml-cocoon/build.sh
Index: build.sh
===================================================================
RCS file: /home/cvs/xml-cocoon/build.sh,v
retrieving revision 1.10.2.8
retrieving revision 1.10.2.9
diff -u -r1.10.2.8 -r1.10.2.9
--- build.sh 2000/06/25 17:46:08 1.10.2.8
+++ build.sh 2000/09/16 00:12:23 1.10.2.9
@@ -1,26 +1,29 @@
#!/bin/sh
+# -----------------------------------------------------------------------------
+# build.sh - Unix Build Script for Apache Cocoon
+#
+# $Id: build.sh,v 1.10.2.9 2000/09/16 00:12:23 stefano Exp $
+# -----------------------------------------------------------------------------
-echo
-echo "Cocoon Build System"
-echo "-------------------"
+# ----- Verify and Set Required Environment Variables -------------------------
+if [ "$ANT_HOME" = "" ] ; then
+ ANT_HOME=.
+fi
+
if [ "$JAVA_HOME" = "" ] ; then
- echo "ERROR: JAVA_HOME not found in your environment."
- echo
- echo "Please, set the JAVA_HOME variable in your environment to match the"
- echo "location of the Java Virtual Machine you want to use."
+ echo You must set JAVA_HOME to point at your Java Development Kit installation
exit 1
fi
+
+# ----- Set Up The Runtime Classpath ------------------------------------------
-ANT_HOME=./lib
-LOCALCLASSPATH=`echo lib/*.jar | tr ' ' ':'`:$JAVA_HOME/lib/tools.jar:$CLASSPATH
+CP=$ANT_HOME/lib/ant.jar:$JAVA_HOME/lib/tools.jar
-echo
-echo Building with classpath $LOCALCLASSPATH
+# ----- Make sure Ant script is executable ------------------------------------
chmod 0755 $ANT_HOME/bin/antRun
-echo
-echo Starting Ant...
+# ----- Execute The Requested Build -------------------------------------------
-$JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH org.apache.tools.ant.Main $*
+$JAVA_HOME/bin/java $ANT_OPTS -classpath $CP org.apache.tools.ant.Main -Dant.home=$ANT_HOME $*
1.3.2.2 +2 -2 xml-cocoon/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/xml-cocoon/index.html,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- index.html 2000/03/20 21:22:02 1.3.2.1
+++ index.html 2000/09/16 00:12:23 1.3.2.2
@@ -8,7 +8,7 @@
<body BGCOLOR="#FFFFFF">
-<p ALIGN="CENTER">The Apache XML project is proud to present</p>
+<p ALIGN="CENTER">The Apache XML Project is proud to present</p>
<h3 ALIGN="CENTER"><img border="0" src="docs/images/cocoon2.gif"></h3>
@@ -34,7 +34,7 @@
<p ALIGN="CENTER">
<font SIZE="-1">
- Copyright (c) @year@ <a HREF="http://xml.apache.org">The Apache Software Foundation.</a><br>
+ Copyright (c) @year@ <a HREF="http://www.apache.org">The Apache Software Foundation.</a><br>
All rights reserved.
</font>
</p>
1.6.2.32 +101 -94 xml-cocoon/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/build.xml,v
retrieving revision 1.6.2.31
retrieving revision 1.6.2.32
diff -u -r1.6.2.31 -r1.6.2.32
--- build.xml 2000/09/14 22:39:39 1.6.2.31
+++ build.xml 2000/09/16 00:12:23 1.6.2.32
@@ -1,9 +1,9 @@
<!-- ===========================================================================
- * ==================== *
- | How to build Cocoon |
- * ==================== *
+ * =========================== *
+ | Apache Cocoon Build System |
+ * =========================== *
by
@@ -25,7 +25,8 @@
version of Ant and the build scripts take care of all the classpath issues.
The only thing that you have to make sure, is the "JAVA_HOME" environment
-property should be set to match the JVM you want to use. That's it.
+property should be set to match the JVM you want to use. That's all you have
+to do.
Building instructions
@@ -47,6 +48,23 @@
tools (i.e. make or shell scripts) where a new JVM is started for each task.
+Building on another directory
+=============================
+
+Sometimes you might want to build on an external directory to keep the
+distribution clean: no worries, this is just an environment property away.
+Suppose you want to use the "../build" directory instead you simply tipe
+
+ [unix] ./build.sh -Dbuild.root=../build
+ [win32] .\build.bat -Dbuild.root=..\build
+
+By using the -Dxxx=yyy argument, you are setting environments in the JVM: Ant
+is designed to give higher priority to system environments to allow you to
+modify _any_ <property> that you can find in the building instructions below,
+so it's just a matter of understanding what property you want to change
+and you don't have to touch this file.
+
+
Build targets
=============
@@ -55,31 +73,50 @@
distributions and web site. In fact, the file you have here is _exactly_ what
is used by cocoon maintainers to take care of everything in the Cocoon
project, no less and no more.
+
+To know more about the available targets take a look at this file, which is
+pretty self-explanatory or type
+
+ [unix] ./build.sh -projecthelp
+ [win32] .\build.bat -projecthelp
+
-These are the meaningful targets for this build file:
+Install target
+==============
- - package [default] -> creates ./build/cocoon/cocoon.jar
- - webapp -> creates ./build/cocoon/cocoon.war
- - webapp-lib -> creates ./build/cocoon/cocoon.war with included libraries
- - docs -> generates the HTML documentation in ./build/cocoon/docs
- - printer-docs -> generates printer friendly HTML documentation in ./build/printer-docs
- - javadocs -> generates the API documentation in ./build/cocoon/javadocs
- - dist-zip -> generates the Cocoon distribution in ./dist
- - dist-tgz -> generates the Cocoon distribution in ./dist
- - clean -> cleans the distribution after builds
- - distclean -> restores the distribution to its original and clean state
- - site -> generates the web site in ../xml-site/targets/cocoon
+The install target is mainly a facility to allow you to install a newly build
+cocoon + web application in your servlet container. If called normally it
+doesn't do anything, but if you type
-NOTE: the "site" target is only useful for site mantainers.
+ [unix] ./build.sh -Dinstall.lib="../tomcat/lib" -Dinstall.war="../tomcat/webapps" install
+ [win32] .\build.bat -Dinstall.lib="..\tomcat\lib" -Dinstall.war="..\tomcat\webapps" install
+overriding the installation properties, it copies all the required libraries
+and the default web application so that you just have to fire up your servlet
+container without doing anything else. Pretty slick, isn't it?
+
+That's all you have to know to start hacking Cocoon... so what are you
+waiting for? C'mon, dive in and have fun.
+
+ Happy hacking from the Apache Cocoon Dev Team:)
+
============================================================================ -->
<project default="package" basedir=".">
<!-- =================================================================== -->
+ <!-- Indentify Classpath -->
+ <!-- =================================================================== -->
+ <path id="classpath">
+ <fileset dir="./lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
- <target name="init">
+ <target name="init" description="Sets the build properties">
<tstamp/>
<property name="fullname" value="Apache Cocoon"/>
<property name="Name" value="Cocoon"/>
@@ -107,7 +144,6 @@
<property name="browser.skin" value="${skins.dir}/xml.apache.org/"/>
<property name="printer.skin" value="${skins.dir}/printer/"/>
<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.root" value="./build"/>
<property name="build.dir" value="${build.root}/${name}"/>
@@ -123,7 +159,7 @@
<property name="dist.target" value="${dist.root}"/>
<property name="site" value="../xml-site/targets/${name}"/>
-
+
<filter token="name" value="${fullname}"/>
<filter token="year" value="${year}"/>
<filter token="version" value="${version}"/>
@@ -145,45 +181,16 @@
</target>
<!-- =================================================================== -->
- <!-- Help on usage -->
- <!-- =================================================================== -->
- <target name="usage">
- <echo message=""/>
- <echo message=""/>
- <echo message="Cocoon Build file"/>
- <echo message="-------------------------------------------------------------"/>
- <echo message=""/>
- <echo message=" available targets are:"/>
- <echo message=""/>
- <echo message=" package --> generates the cocoon.jar file (default)"/>
- <echo message=" webapp --> generates the cocoon.war file"/>
- <echo message=" compile --> compiles the source code"/>
- <echo message=" docs --> generates the HTML documentation"/>
- <echo message=" printer-docs --> generates printer-friendly HTML documentation"/>
- <echo message=" javadocs --> generates the API documentation"/>
- <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 after building"/>
- <echo message=" distclean --> cleans up to original CVS state"/>
- <echo message=" site --> generates the Cocoon web site"/>
- <echo message=""/>
- <echo message=" See the comments inside the build.xml file for more details."/>
- <echo message="-------------------------------------------------------------"/>
- <echo message=""/>
- <echo message=""/>
- </target>
-
- <!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
- <target name="prepare" depends="init">
+ <target name="prepare" depends="init" description="Prepares the build directory">
<mkdir dir="${build.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Prepares the source code -->
<!-- =================================================================== -->
- <target name="prepare-src" depends="prepare">
+ <target name="prepare-src" depends="prepare" description="Copies and filters the source code into the build directory">
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<copydir src="${src.dir}" dest="${build.src}" filtering="on"/>
@@ -192,7 +199,7 @@
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
- <target name="compile" depends="prepare-src">
+ <target name="compile" depends="prepare-src" description="Compiles the source code">
<copydir src="${build.src}" dest="${build.dest}">
<include name="**/Manifest.mf"/>
<include name="**/*.xsl"/>
@@ -212,24 +219,25 @@
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}">
+ <classpath refid="classpath"/>
<exclude name="**/*.html"/>
<exclude name="**/CocoonServlet*.java" unless="servlet.present"/>
- <exclude name="**/XT*.java" unless="xt.present"/>
- <exclude name="**/SVG*.java" unless="svg.present"/>
- <exclude name="**/Javascript*" unless="rhino.present"/>
- <exclude name="**/Jstyle*" unless="jstyle.present"/>
- <exclude name="**/FO2*" unless="fop.present"/>
- <exclude name="**/Php*" unless="php.present"/>
- <exclude name="**/JPEGEncoder*.java" unless="jpeg.present"/>
- <exclude name="**/PNGEncoder*.java" unless="png.present"/>
- <exclude name="**/JAI*.java" unless="jai.present"/>
+ <exclude name="**/XT*.java" unless="xt.present"/>
+ <exclude name="**/SVG*.java" unless="svg.present"/>
+ <exclude name="**/Javascript*" unless="rhino.present"/>
+ <exclude name="**/Jstyle*" unless="jstyle.present"/>
+ <exclude name="**/FO2*" unless="fop.present"/>
+ <exclude name="**/Php*" unless="php.present"/>
+ <exclude name="**/JPEGEncoder*.java" unless="jpeg.present"/>
+ <exclude name="**/PNGEncoder*.java" unless="png.present"/>
+ <exclude name="**/JAI*.java" unless="jai.present"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Creates the jar file -->
<!-- =================================================================== -->
- <target name="package" depends="compile">
+ <target name="package" depends="compile" description="Generates the jar package">
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.dest}"
manifest="${build.src}/Manifest.mf"
@@ -239,7 +247,7 @@
<!-- =================================================================== -->
<!-- Prapares the webapp directories -->
<!-- =================================================================== -->
- <target name="prepare-webapp" depends="prepare">
+ <target name="prepare-webapp" depends="prepare" description="Prepares the web application">
<mkdir dir="${build.war}"/>
<copydir src="${webapp.dir}" dest="${build.war}" filtering="on">
@@ -263,27 +271,28 @@
<!-- =================================================================== -->
<!-- Creates the war file -->
<!-- =================================================================== -->
- <target name="webapp" depends="prepare-webapp">
+ <target name="webapp" depends="prepare-webapp" description="Generates the war package">
<jar jarfile="${build.dir}/${name}.war" basedir="${build.war}" includes="**"/>
</target>
<!-- =================================================================== -->
- <!-- Creates the war file -->
+ <!-- Installs Cocoon file -->
<!-- =================================================================== -->
- <target name="webapp-lib" depends="package, prepare-webapp">
- <copydir src="${lib.dir}" dest="${build.war}/WEB-INF/lib" filtering="off">
+ <target name="install" depends="package, webapp" if="install.lib" description="Installs all jar and war packages">
+ <copydir src="${lib.dir}" dest="${install.lib}">
+ <include name="*.jar"/>
<exclude name="ant*.jar"/>
- <exclude name="**/bin/**"/>
<exclude name="stylebook*.jar"/>
+ <exclude name="servlet*.jar"/>
</copydir>
- <copyfile src="${build.dir}/${name}.jar" dest="${build.war}/WEB-INF/lib/${name}.jar"/>
- <jar jarfile="${build.dir}/${name}.war" basedir="${build.war}" includes="**"/>
+ <copyfile src="${build.dir}/${name}.jar" dest="${install.lib}/${name}.jar"/>
+ <copyfile src="${build.dir}/${name}.war" dest="${install.war}/${name}.war"/>
</target>
<!-- =================================================================== -->
<!-- Prepares the docs -->
<!-- =================================================================== -->
- <target name="prepare-docs" depends="init">
+ <target name="prepare-docs" depends="init" description="Prepares the documentation source files">
<copyfile src="changes.xml" dest="${docs.dir}/changes.xml" filtering="on"/>
<copyfile src="todo.xml" dest="${docs.dir}/todo.xml"/>
@@ -294,46 +303,43 @@
<!-- =================================================================== -->
<!-- Generate HTML docs -->
<!-- =================================================================== -->
- <target name="docs" depends="prepare-docs">
+ <target name="docs" depends="prepare-docs" description="Generates the documentation">
<mkdir dir="${build.docs}"/>
<copyfile src="${docs.dir}/docs-book.xml" dest="${docs.dir}/book.xml" filtering="on"/>
- <java fork="yes"
- classpath="${java.class.path}:${doc.generator.package}"
- classname="${doc.generator}">
- <arg line="targetDirectory=${build.docs} ${docs.dir}/book.xml ${browser.skin}"/>
+ <java classname="${doc.generator}">
+ <classpath refid="classpath"/>
+ <arg line="targetDirectory=${build.docs} ${docs.dir}/book.xml ${browser.skin}"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Generate printer-friendly HTML docs -->
<!-- =================================================================== -->
- <target name="printer-docs" depends="prepare-docs">
+ <target name="printer-docs" depends="prepare-docs" description="Generates printer-friendly documentation">
<mkdir dir="${build.docs.printer}"/>
<copyfile src="${docs.dir}/docs-book.xml" dest="${docs.dir}/book.xml" filtering="on"/>
- <java fork="yes"
- classpath="${java.class.path}:${doc.generator.package}"
- classname="${doc.generator}">
- <arg line="targetDirectory=${build.docs} ${docs.dir}/book.xml ${printer.skin}"/>
+ <java classname="${doc.generator}">
+ <classpath refid="classpath"/>
+ <arg line="targetDirectory=${build.docs.printer} ${docs.dir}/book.xml ${printer.skin}"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the web site -->
<!-- =================================================================== -->
- <target name="site" depends="prepare-docs">
+ <target name="site" depends="prepare-docs" description="Generates the web site (for site maintainers only)">
<mkdir dir="${site}"/>
<copyfile src="${docs.dir}/site-book.xml" dest="${docs.dir}/book.xml" filtering="on"/>
- <java fork="yes"
- classpath="${java.class.path}:${doc.generator.package}"
- classname="${doc.generator}">
- <arg line="targetDirectory=${site} ${docs.dir}/book.xml ${browser.skin}"/>
+ <java classname="${doc.generator}">
+ <classpath refid="classpath"/>
+ <arg line="targetDirectory=${site} ${docs.dir}/book.xml ${browser.skin}"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
- <target name="javadocs" depends="prepare-src">
+ <target name="javadocs" depends="prepare-src" description="Generates the API documentation">
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${build.src}"
@@ -345,14 +351,15 @@
windowtitle="${Name} API"
doctitle="${Name}"
bottom="Copyright © ${year} Apache Software Foundation. All Rights Reserved."
- stylesheetfile="${resource.dir}/javadoc.css"
- />
+ stylesheetfile="${resource.dir}/javadoc.css">
+ <classpath refid="classpath"/>
+ </javadoc>
</target>
<!-- =================================================================== -->
<!-- Creates the distribution -->
<!-- =================================================================== -->
- <target name="dist" depends="package, webapp, docs, javadocs">
+ <target name="dist" depends="package, webapp, docs, javadocs" description="Prepares the distribution">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/lib"/>
<mkdir dir="${dist.dir}/src"/>
@@ -387,14 +394,14 @@
<!-- =================================================================== -->
<!-- Packages the distribution as .zip -->
<!-- =================================================================== -->
- <target name="dist-zip" depends="dist">
+ <target name="dist-zip" depends="dist" description="Generates the distribution as a .zip file">
<zip zipfile="${dist.target}/${Name}-${version}.zip" basedir="${dist.dir}" includes="**"/>
</target>
<!-- =================================================================== -->
<!-- Packages the distribution with .tar.gzip -->
<!-- =================================================================== -->
- <target name="dist-tgz" depends="dist">
+ <target name="dist-tgz" depends="dist" description="Generates the distribution as a .tar.gz file">
<tar tarfile="${dist.target}/${Name}-${version}.tar" basedir="${dist.root}" includes="**"/>
<gzip zipfile="${dist.target}/${Name}-${version}.tar.gz" src="${dist.target}/${Name}-${version}.tar"/>
</target>
@@ -402,14 +409,14 @@
<!-- =================================================================== -->
<!-- Clean targets -->
<!-- =================================================================== -->
- <target name="clean" depends="init">
+ <target name="clean" depends="init" description="Cleans the build directories">
<delete file="${docs.dir}/changes.xml"/>
<delete file="${docs.dir}/todo.xml"/>
<delete file="${docs.dir}/book.xml"/>
<deltree dir="${build.dir}"/>
</target>
- <target name="distclean" depends="clean">
+ <target name="distclean" depends="clean" description="Cleans everything to the original state">
<deltree dir="${build.root}"/>
<delete file="${dist.target}/${Name}-${version}.tar.gz"/>
<delete file="${dist.target}/${Name}-${version}.tar"/>