stefano 00/06/06 16:09:44
Modified: . Tag: xml-cocoon2 build.xml
Log:
new build system
Revision Changes Path
No revision
No revision
1.6.2.9 +92 -132 xml-cocoon/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/build.xml,v
retrieving revision 1.6.2.8
retrieving revision 1.6.2.9
diff -u -r1.6.2.8 -r1.6.2.9
--- build.xml 2000/06/01 16:50:57 1.6.2.8
+++ build.xml 2000/06/06 23:09:43 1.6.2.9
@@ -9,44 +9,11 @@
Stefano Mazzocchi <[EMAIL PROTECTED]>
-
-
-Introduction
-============
-
-Cocoon is an highly componentized software. This means: we are lazy and reuse
-whatever possible. But also means: we avoid duplication of efforts and Cocoon
-development can go on concurrently with the other used projects without
-interference. At the end: Cocoon evolves much faster :)
-
-Anyway, any componentized software is based on "contracts" between the core
-and the modules used. Normally, these "contracts" are standard APIs (such as
-Java API or externally standardized API) but since Cocoon is a pioneer in
many
-fields, these APIs do not (yet) exist.
-
-For this reason, Cocoon itself provides some "glue" classes (decorators) that
-wrap around existing packages (for example, the different XSLT processors)
and
-come up with a simple interface for Cocoon to use them.
-
-Unfortunately, this requires the "glued" classes to be present at compile
time,
-that is: you have to download the packages to compile the glue classes.
-
-This is the main reason why the distribution includes a precompiled version
-that should be handy for most users, but power users willing to further tune
-the software or developers willing to play around with it, must be able
-to compile it and test it.
-
-Note, however, that Cocoon comes with all the packages required to build a
-fully functional distribution. You'll have to download external packages
-only if you have special requirements. See the build-FAQ section below for
more
-info on this.
-
-
Installing the build tools
==========================
-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
+The Cocoon build system is based on Ant, which is a Java building tool
+originally developed for the Tomcat project but now used in many other
Apache projects and extended by many developers.
Ant is a little but very handy tool that uses a build file written in XML
@@ -70,11 +37,9 @@
.\build.bat (win32)
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
-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.
-
-If something went wrong, go to the FAQ section below.
+will generate a file called "cocoon.jar" in the "./build/cocoon" directory.
+Note, that if you do further development, compilation time is reduced since
+Ant is able of detecting which files have changed an to recompile them at
need.
Also, you'll note that reusing a single JVM instance for each task, increases
tremendously the performance of the whole build system, compared to other
@@ -92,16 +57,17 @@
These are the meaningful targets for this build file:
- - package [default] -> creates ./build/cocoon.jar
- - war -> creates ./build/cocoon.war
- - docs -> generates the HTML documentation in ./build/docs
- - javadocs -> generates the API documentation in ./build/javadocs
- - dist-zip -> generates the Cocoon distribution
- - dist-tgz -> generates the Cocoon distribution
- - clean -> restores the distribution to its original and clean state
+ - package [default] -> creates ./build/cocoon/cocoon.jar
+ - war -> creates ./build/webapp/cocoon.war
+ - docs -> generates the HTML documentation in ./build/cocoon/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
-
-====================================== FAQ
=====================================
+
+NOTE: the "site" target is only useful for site mantainers.
============================================================================
-->
@@ -112,49 +78,50 @@
<!-- ===================================================================
-->
<target name="init">
<tstamp/>
- <property name="Name" value="Cocoon"/>
- <property name="name" value="cocoon"/>
+ <property name="Name" value="Cocoon"/>
+ <property name="name" value="cocoon"/>
<property name="version" value="2.0a1"/>
- <property name="year" value="1999-2000"/>
+ <property name="year" value="1999-2000"/>
<echo message="------------------- ${Name} ${version} [${year}]
----------------"/>
<property name="build.compiler" value="classic"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="on"/>
- <property name="deprecation" value="off"/>
-
- <property name="src.dir" value="./src"/>
- <property name="lib.dir" value="./lib"/>
- <property name="conf.dir" value="./conf"/>
- <property name="docs.dir" value="./xdocs"/>
- <property name="dtd.dir" value="./xdocs/dtd"/>
- <property name="skins.dir" value="./skins"/>
- <property name="images.dir" value="./xdocs/images"/>
+ <property name="debug" value="on"/>
+ <property name="optimize" value="on"/>
+ <property name="deprecation" value="off"/>
+
+ <property name="src.dir" value="./src"/>
+ <property name="lib.dir" value="./lib"/>
+ <property name="conf.dir" value="./conf"/>
+ <property name="docs.dir" value="./xdocs"/>
+ <property name="dtd.dir" value="./xdocs/dtd"/>
+ <property name="skins.dir" value="./skins"/>
+ <property name="images.dir" value="./xdocs/images"/>
<property name="samples.dir" value="./samples"/>
- <property name="packages" value="org.apache.*"/>
+ <property name="packages" value="org.apache.*"/>
<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"/>
- <property name="build.dest" value="./build/classes"/>
- <property name="build.docs" value="./build/docs"/>
- <property name="build.javadocs" value="./build/javadocs"/>
- <property name="build.war" value="./build/war"/>
- <property name="build.war.samples" value="./build/war/samples"/>
+ <property name="build.root" value="./build"/>
+ <property name="build.dir" value="${build.root}/${name}"/>
+ <property name="build.src" value="${build.dir}/src"/>
+ <property name="build.dest" value="${build.dir}/classes"/>
+ <property name="build.docs" value="${build.dir}/docs"/>
+ <property name="build.war" value="${build.dir}/webapp"/>
+ <property name="build.javadocs" value="${build.dir}/javadocs"/>
+
+ <property name="dist.root" value="./dist"/>
+ <property name="dist.dir" value="${dist.root}/${name}-${version}"/>
+ <property name="dist.target" value="${dist.root}"/>
- <property name="dist.root" value="./dist"/>
- <property name="dist.dir" value="${dist.root}/${name}-${version}"/>
-
<property name="site" value="../xml-site/targets/cocoon"/>
- <filter token="year" value="${year}"/>
+ <filter token="year" value="${year}"/>
<filter token="version" value="${version}"/>
- <filter token="date" value="${TODAY}"/>
- <filter token="log" value="true"/>
+ <filter token="date" value="${TODAY}"/>
+ <filter token="log" value="true"/>
<filter token="verbose" value="true"/>
</target>
@@ -169,15 +136,16 @@
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
- <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-zip --> generates the Cocoon distribution as
.zip"/>
- <echo message=" dist-tgz --> generates the Cocoon distribution as
.tar.gz"/>
- <echo message=" war --> generates the cocoon.war file"/>
- <echo message=" clean --> cleans up the directory"/>
- <echo message=" site --> generates the Cocoon web site"/>
+ <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=" 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="-------------------------------------------------------------"/>
@@ -193,33 +161,12 @@
</target>
<!-- ===================================================================
-->
- <!-- Creates the war file
-->
- <!-- ===================================================================
-->
- <target name="war" depends="prepare">
- <mkdir dir="${build.war}"/>
- <mkdir dir="${build.war.samples}"/>
- <copydir src="${conf.dir}" dest="${build.war}" filtering="on"/>
- <copydir src="${samples.dir}" dest="${build.war.samples}"
filtering="on"/>
- <delete file="${build.dir}/${name}.war"/>
- <delete file="${build.war.samples}/README"/>
- <jar jarfile="${build.dir}/${name}.war"
- basedir="${build.war}"
- includes="**"/>
- <deltree dir="${build.war}"/>
- </target>
-
- <!-- ===================================================================
-->
<!-- Prepares the source code
-->
<!-- ===================================================================
-->
<target name="prepare-src" depends="prepare">
- <!-- create directories -->
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
-
- <!-- copy src files -->
- <copydir src="${src.dir}"
- dest="${build.src}"
- filtering="on"/>
+ <copydir src="${src.dir}" dest="${build.src}" filtering="on"/>
</target>
<!-- ===================================================================
-->
@@ -235,7 +182,7 @@
<!-- ===================================================================
-->
<!-- Creates the jar file
-->
<!-- ===================================================================
-->
- <target name="jar" depends="compile">
+ <target name="package" depends="compile">
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.dest}"
manifest="${build.src}/Manifest.mf"
@@ -243,9 +190,15 @@
</target>
<!-- ===================================================================
-->
- <!-- Creates the class package
-->
+ <!-- Creates the war file
-->
<!-- ===================================================================
-->
- <target name="package" depends="jar,war">
+ <target name="webapp" depends="prepare">
+ <mkdir dir="${build.war}"/>
+ <copydir src="${conf.dir}" dest="${build.war}" filtering="on"/>
+ <copydir src="${samples.dir}" dest="${build.war}" filtering="on"
excludes="README"/>
+ <jar jarfile="${build.dir}/${name}.war"
+ basedir="${build.war}"
+ includes="**"/>
</target>
<!-- ===================================================================
-->
@@ -253,10 +206,10 @@
<!-- ===================================================================
-->
<target name="prepare-docs" depends="init">
<copyfile src="changes.xml" dest="${docs.dir}/changes.xml"
filtering="on"/>
- <copyfile src="todo.xml" dest="${docs.dir}/todo.xml"/>
+ <copyfile src="todo.xml" dest="${docs.dir}/todo.xml"/>
<replace file="${docs.dir}/changes.xml" token="./xdocs/dtd/"
value="dtd/"/>
- <replace file="${docs.dir}/todo.xml" token="./xdocs/dtd/" value="dtd/"/>
+ <replace file="${docs.dir}/todo.xml" token="./xdocs/dtd/"
value="dtd/"/>
</target>
<!-- ===================================================================
-->
@@ -265,7 +218,9 @@
<target name="docs" depends="prepare-docs">
<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}"
+ <java fork="yes"
+ classpath="${java.class.path}:${doc.generator.package}"
+ classname="${doc.generator}"
args="targetDirectory=${build.docs} ${docs.dir}/book.xml ${skin}"/>
</target>
@@ -275,7 +230,9 @@
<target name="site" depends="prepare-docs">
<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}"
+ <java fork="yes"
+ classpath="${java.class.path}:${doc.generator.package}"
+ classname="${doc.generator}"
args="targetDirectory=${site} ${docs.dir}/book.xml ${skin}"/>
</target>
@@ -301,7 +258,7 @@
<!-- ===================================================================
-->
<!-- Creates the distribution
-->
<!-- ===================================================================
-->
- <target name="dist" depends="package, docs, javadocs">
+ <target name="dist" depends="package, webapp, docs, javadocs">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/bin"/>
<mkdir dir="${dist.dir}/lib"/>
@@ -311,23 +268,26 @@
<mkdir dir="${dist.dir}/docs/api"/>
<mkdir dir="${dist.dir}/samples"/>
<mkdir dir="${dist.dir}/skins"/>
+ <mkdir dir="${dist.dir}/webapps"/>
<mkdir dir="${dist.dir}/xdocs"/>
- <copydir src="${build.src}" dest="${dist.dir}/src"/>
<copyfile src="${build.dir}/${name}.jar"
dest="${dist.dir}/bin/${name}.jar"/>
- <copydir src="${conf.dir}" dest="${dist.dir}/conf"/>
- <copydir src="${build.docs}" dest="${dist.dir}/docs"/>
+ <copyfile src="${build.war}/${name}.war"
dest="${dist.dir}/webapps/${name}.war"/>
+
+ <copydir src="${build.src}" dest="${dist.dir}/src"/>
+ <copydir src="${conf.dir}" dest="${dist.dir}/conf"/>
+ <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"/>
- <copydir src="${docs.dir}" dest="${dist.dir}/xdocs" excludes="book.xml,
changes.xml, todo.xml"/>
- <copydir src="${docs.dir}" dest="${dist.dir}" includes="changes.xml,
todo.xml"/>
- <copydir src="${skins.dir}" dest="${dist.dir}/skins"/>
- <copydir src="${lib.dir}" dest="${dist.dir}/lib"/>
+ <copydir src="${samples.dir}" dest="${dist.dir}/samples"/>
+ <copydir src="${docs.dir}" dest="${dist.dir}/xdocs"
excludes="book.xml, changes.xml, todo.xml"/>
+ <copydir src="${docs.dir}" dest="${dist.dir}"
includes="changes.xml, todo.xml"/>
+ <copydir src="${skins.dir}" dest="${dist.dir}/skins"/>
+ <copydir src="${lib.dir}" dest="${dist.dir}/lib"/>
<copydir src="." dest="${dist.dir}" includes="README, LICENSE, build.*,
index.html" filtering="on"/>
<chmod perm="+x" src="${dist.dir}/build.sh"/>
- <fixcrlf srcdir="${dist.dir}" includes="build.sh" cr="remove"/>
+ <fixcrlf srcdir="${dist.dir}" includes="build.sh" cr="remove"/>
<fixcrlf srcdir="${dist.dir}" includes="build.bat" cr="add"/>
</target>
@@ -335,32 +295,32 @@
<!-- Packages the distribution as .zip
-->
<!-- ===================================================================
-->
<target name="dist-zip" depends="dist">
- <zip zipfile="${Name}-${version}.zip" basedir="${dist.dir}"
includes="**"/>
+ <zip zipfile="${dist.target}/${Name}-${version}.zip"
basedir="${dist.dir}" includes="**"/>
</target>
<!-- ===================================================================
-->
<!-- Packages the distribution with .tar.gzip
-->
<!-- ===================================================================
-->
<target name="dist-tgz" depends="dist">
- <tar tarfile="${Name}-${version}.tar" basedir="${dist.root}"
includes="**"/>
- <gzip zipfile="${Name}-${version}.tar.gz" src="${Name}-${version}.tar"/>
+ <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>
<!-- ===================================================================
-->
<!-- Clean targets
-->
<!-- ===================================================================
-->
<target name="clean" depends="init">
- <deltree dir="${build.dir}"/>
<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">
+ <delete file="${dist.target}/${Name}-${version}.tar.gz"/>
+ <delete file="${dist.target}/${Name}-${version}.tar"/>
+ <delete file="${dist.target}/${Name}-${version}.zip"/>
<deltree dir="${dist.root}"/>
- <delete file="${Name}-${version}.tar.gz"/>
- <delete file="${Name}-${version}.tar"/>
- <delete file="${Name}-${version}.zip"/>
</target>
</project>