You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2003/04/11 20:58:40 UTC
cvs commit: avalon build.xml
leosutic 2003/04/11 11:58:40
Modified: . build.xml
Log:
Interface/Impl separation by splitting class files between jars.
Revision Changes Path
1.179 +232 -116 avalon/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/avalon/build.xml,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -r1.178 -r1.179
--- build.xml 1 Mar 2003 02:27:25 -0000 1.178
+++ build.xml 11 Apr 2003 18:58:39 -0000 1.179
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
- <!DOCTYPE project [
+<!DOCTYPE project [
<!ENTITY forrest-targets SYSTEM "file:forrest-targets.ent">
- <!ENTITY check-targets SYSTEM "file:check-targets.ent">
- ]>
+<!ENTITY check-targets SYSTEM "file:check-targets.ent">
+]>
<!--
==============================================================================
- Avalon build file
+Avalon build file
==============================================================================
You need ant 1.5 or later and forrest 0.2 or later installed in order to
build avalon from source. See:
@@ -17,19 +17,19 @@
type `ant -projecthelp` for more info
Legal:
- Copyright (c) 1999-2003 The Apache Software Foundation. All Rights Reserved.
+Copyright (c) 1999-2003 The Apache Software Foundation. All Rights Reserved.
==============================================================================
-->
<project name="Avalon Framework" default="main" basedir=".">
<property name="project.home" value="${basedir}"/>
<!--
- Give user a chance to override without editing this file
- (and without typing -D each time he compiles it)
+ Give user a chance to override without editing this file
+ (and without typing -D each time he compiles it)
-->
<property file="ant.properties"/>
<property file="${user.home}/.ant.properties"/>
-
+
<property name="name" value="avalon"/>
<property name="Name" value="Avalon"/>
<property name="framework.name" value="avalon-framework"/>
@@ -38,12 +38,12 @@
<property name="status" value="final"/>
<property name="release" value="5th"/>
<property name="short.version" value="4.1"/>
-
+
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>
<property name="compress.jars" value="true"/>
-
+
<!-- Set the properties for intermediate directory -->
<property name="target.dir" value="target"/>
<property name="target.lib" value="${target.dir}/lib"/>
@@ -54,7 +54,7 @@
<property name="target.docs" value="${target.dir}/docs"/>
<property name="target.testdocs" value="${target.docs}/test"/>
<property name="target.reports" value="${target.dir}/reports"/>
-
+
<!-- Set the properties for source directories -->
<property name="src.dir" value="src"/>
<property name="java.dir" value="${src.dir}/java"/>
@@ -67,22 +67,22 @@
<property name="www.dir" value="../avalon-site/site/framework"/>
<property name="javadocs.dir" value="${docs.dir}/api"/>
<property name="context.dir" value="${src.dir}/documentation"/>
-
+
<property name="dist.name" value="${Name}-${version}"/>
<property name="dist.base" value="distributions"/>
-
+
<property name="tools.jar" value="${java.home}/../lib/tools.jar"/>
-
+
<property name="announce2txt" value="${tools.dir}/announcement2txt.xsl"/>
<property name="announce2header" value="${tools.dir}/announcement2header.xsl"/>
<property name="announce2readme" value="${tools.dir}/announcement2readme.xsl"/>
<property name="announce2site" value="${tools.dir}/announcement2site.xsl"/>
<property name="document2docbook" value="${context.dir}/stylesheets/document2docbook.xsl"/>
-
+
<property name="junit.jar" value=""/>
<property name="log4j.jar" value=""/>
<property name="logkit.jar" value=""/>
-
+
<path id="project.class.path">
<pathelement path="${java.class.path}"/>
<pathelement path="${junit.jar}"/>
@@ -93,31 +93,31 @@
</fileset>
<pathelement path="${target.classes}"/>
</path>
-
+
<path id="tools.class.path">
<path refid="project.class.path"/>
<pathelement location="${tools.jar}"/>
</path>
-
+
<path id="test.class.path">
<path refid="tools.class.path"/>
<path refid="project.class.path"/>
</path>
-
+
&check-targets;
&forrest-targets;
-
+
<!-- Main target -->
<target name="main" depends="all" description="generates the Avalon distribution without the javadocs"/>
-
+
<!-- Help on usage -->
<target name="usage">
<echo message="Use the -projecthelp option instead"/>
</target>
-
+
<target name="dist.lite" depends="main"/>
<target name="help" depends="usage"/>
-
+
<!-- Set up properties -->
<target name="setup-properties" depends="setup-dependencies">
<property name="dist.dir" value="${dist.name}"/>
@@ -126,7 +126,7 @@
<property name="dist.lib" value="${dist.dir}/lib"/>
<property name="dist.docs" value="${dist.dir}/docs"/>
<property name="dist.javadocs" value="${dist.dir}/docs/api"/>
-
+
<property name="src.dist.dir" value="${dist.name}-src"/>
<property name="src.dist.src" value="${src.dist.dir}/src"/>
<property name="src.dist.docs" value="${src.dist.dir}/docs"/>
@@ -134,24 +134,24 @@
<property name="src.dist.lib" value="${src.dist.dir}/lib"/>
<property name="src.dist.tools" value="${src.dist.dir}/tools"/>
</target>
-
+
<!-- defer to check-targets.ent for figuring out dependencies -->
<target name="check-dependencies" depends="junit-check,log4j-check,logkit-check,jdk14-check"/>
-
+
<!-- defer to check-targets.ent for downloading dependencies -->
<target name="import-dependencies" depends="import-junit,import-log4j,import-logkit"/>
-
+
<!-- Prepares the build directory -->
<target name="prepare" depends="check-dependencies">
<tstamp/>
<mkdir dir="${target.dir}"/>
</target>
-
+
<!-- Compiles the source code -->
<target name="compile" depends="setup-properties,setup-dependencies,prepare" description="compiles the source code">
-
+
<mkdir dir="${target.classes}"/>
-
+
<javac srcdir="${java.dir}"
destdir="${target.classes}"
debug="${debug}"
@@ -172,7 +172,7 @@
unless="logkit.present"/>
<exclude name="org/apache/avalon/framework/logger/Jdk14Logger.java"
unless="jdk14.present"/>
-
+
<!-- leave out test cases if junit not installed -->
<exclude name="org/apache/avalon/framework/test/**"
unless="junit.present"/>
@@ -188,12 +188,12 @@
unless="junit.present"/>
</javac>
</target>
-
+
<!-- Creates the exceptionutil.jar file -->
<target name="compile-exceptionutil" depends="setup-properties,prepare">
-
+
<mkdir dir="${target.classes}"/>
-
+
<javac srcdir="${java.dir}"
destdir="${target.classes}"
debug="${debug}"
@@ -204,7 +204,7 @@
<include name="org/apache/avalon/framework/Cascading*"/>
</javac>
</target>
-
+
<target name="jar-exceptionutil" depends="compile-exceptionutil, prepare-conf">
<mkdir dir="${target.lib}"/>
<jar jarfile="${target.lib}/exceptionutil.jar"
@@ -225,15 +225,15 @@
</zipfileset>
</jar>
</target>
-
+
<target name="test" depends="check"/>
-
+
<target name="check" depends="compile,junit-check" description="perform unit tests">
<echo message="Avalon Framework is mostly interfaces."/>
<echo message="But some tests to be performed at this time."/>
-
+
<mkdir dir="${target.reports}"/>
-
+
<echo message="Performing Unit Tests"/>
<junit fork="true" printsummary="yes" dir="${target.reports}">
<formatter type="plain" usefile="false"/>
@@ -247,13 +247,13 @@
</fileset>
</batchtest>
</junit>
-
+
</target>
-
+
<target name="test-report" depends="compile,junit-check">
<mkdir dir="${target.testdocs}"/>
<mkdir dir="${target.reports}"/>
-
+
<echo message="Performing Unit Tests"/>
<junit fork="true" printsummary="yes" dir="${target.reports}">
<formatter type="xml"/>
@@ -269,7 +269,7 @@
</fileset>
</batchtest>
</junit>
-
+
<junitreport todir="${target.reports}">
<fileset dir="${target.reports}">
<include name="TEST-*.xml"/>
@@ -277,9 +277,9 @@
<report format="frames" todir="${target.testdocs}"/>
</junitreport>
</target>
-
+
<target name="checkstyle" if="checkstyle.present" description="Checkstyle">
-
+
<!-- this invocation of checkstyle requires that checkstyle be downloaded and setup -->
<!-- thats why you are required to define do.checkstyle property to generate the report -->
<taskdef name="checkstyle"
@@ -313,21 +313,21 @@
<formatter type="plain"/>
</checkstyle>
</target>
-
+
<!-- Prepares the documentation directory -->
<target name="docs" depends="html-docs, javadocs" description="generates all the Avalon documentation"/>
-
+
<target name="html-docs" depends="site" description="generates the xdocs-based documentation">
<!-- todo: remove -->
<mkdir dir="${target.docs}/framework/diagrams"/>
</target>
-
+
<!-- Create the API documentation -->
<target name="javadocs" description="generates the API documentation (java 1.2+ only)">
-
+
<delete dir="${target.javadocs}"/>
<mkdir dir="${target.javadocs}"/>
-
+
<javadoc packagenames="org.apache.*"
sourcepath="${java.dir}"
destdir="${target.javadocs}">
@@ -342,44 +342,44 @@
<param name="-link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
</doclet>
</javadoc>
-
+
</target>
-
+
<!-- Create the Local site documentation -->
<target name="local-xdocs" depends="docs">
-
+
<delete>
<fileset dir="${docs.dir}">
<exclude name="api/**"/>
</fileset>
</delete>
<mkdir dir="${docs.dir}"/>
-
+
<copy todir="${docs.dir}">
<fileset dir="${target.docs}"/>
</copy>
-
+
</target>
-
+
<!-- Create the Local API documentation -->
<target name="local-javadocs" depends="javadocs">
-
+
<delete dir="${javadocs.dir}"/>
<mkdir dir="${javadocs.dir}"/>
-
+
<copy todir="${javadocs.dir}">
<fileset dir="${target.javadocs}"/>
</copy>
-
+
</target>
-
+
<target name="local-docs" depends="local-javadocs,local-xdocs"/>
-
+
<!-- Update the www directory -->
<target name="site-docs" depends="local-docs">
-
+
<mkdir dir="${www.dir}"/>
-
+
<!-- delete all old documents but keep CVS directories -->
<!-- note that by doing an include the defaultexcludes (CVS dirs) will be kept -->
<delete>
@@ -392,16 +392,16 @@
<exclude name="testlet/**"/>
</fileset>
</delete>
-
+
<copy todir="${www.dir}">
<fileset dir="${docs.dir}"/>
</copy>
-
+
</target>
-
+
<!-- Create the announcements and HEADER.html -->
<target name="announcement" depends="setup-properties">
-
+
<filter token="Name" value="Avalon Framework"/>
<filter token="name" value="framework"/>
<filter token="version" value="${version}"/>
@@ -409,10 +409,10 @@
<filter token="status" value="${status}"/>
<filter token="release" value="${release}"/>
<filter token="short-version" value="${short.version}"/>
-
+
<mkdir dir="${target.dir}"/>
<mkdir dir="${dist.base}"/>
-
+
<copy todir="${target.docs}" overwrite="true" filtering="on">
<fileset dir="${xdocs.dir}">
<include name="changes.xml"/>
@@ -421,7 +421,7 @@
<include name="announcement.xml"/>
</fileset>
</copy>
-
+
<style style="${announce2txt}" in="${target.docs}/announcement.xml"
out="Announcement.txt" classpathref="project.class.path"/>
<style style="${announce2header}" in="${target.docs}/announcement.xml"
@@ -430,27 +430,44 @@
out="${dist.base}/README.html" classpathref="project.class.path"/>
<style style="${announce2site}" in="${target.docs}/announcement.xml"
out="jakarta-news.xml" classpathref="project.class.path"/>
-
+
</target>
-
+
<!-- Copies and filters the license. Used by jar and dist -->
<target name="prepare-conf">
<mkdir dir="${target.conf}"/>
<copy todir="${target.conf}" flatten="true">
<fileset dir="." includes="LICENSE.txt"/>
-
+
<filterset>
<filter token="name" value="${framework.name}"/>
<filter token="version" value="${version}"/>
<filter token="year" value="${year}"/>
</filterset>
</copy>
-
+
</target>
-
+
<!-- Creates all the .jar files -->
<target name="all" depends="compile, prepare-conf, check-dependencies" description="generates the Avalon jar files">
<mkdir dir="${target.lib}"/>
+
+ <!--
+
+ OK, we're going to create three jar files:
+ 1. one that contains everything
+ 2. one with interfaces only
+ 3. one with implementation only
+
+ The idea is to first jar everything (as usual). Then move all the interface classes to
+ a separate directory and jar *that* directory. What's left should be the impl classes.
+
+ This ensures that we get everything in the two jars (too easy to forget to include
+ a class in either - that's why we're not doing this with filesets).
+
+ -->
+
+ <!-- First, jar everything. -->
<jar jarfile="${target.lib}/${framework.name}.jar"
basedir="${target.classes}"
compress="${compress.jars}">
@@ -468,39 +485,138 @@
<include name="LICENSE.txt"/>
</zipfileset>
</jar>
+
+ <!-- Move the interface classes -->
+ <mkdir dir="${target.dir}/interfaces/org/apache/avalon/framework"/>
+ <property name="framework.root" value="${target.classes}/org/apache/avalon/framework/"/>
+
+ <move todir="${target.dir}/interfaces/org/apache/avalon/framework" overwrite="true">
+ <!-- The following filesets should include all the ***INTERFACE*** classes -->
+
+ <fileset dir="${framework.root}">
+ <include name="Cascading*.class"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="activity/*"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="component/Component*.class"/>
+ <include name="component/Composable.class"/>
+ <include name="component/Recomposable.class"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="configuration/Configuration.class"/>
+ <include name="configuration/ConfigurationException.class"/>
+ <include name="configuration/Configurable.class"/>
+ <include name="configuration/Reconfigurable.class"/>
+ </fileset>
+
+ <!-- nothing from here... <fileset dir="${framework.root}" includes="container/"/> -->
+
+ <fileset dir="${framework.root}">
+ <include name="context/Context*.class"/>
+ <include name="context/Recontextualizable.class"/>
+ <include name="context/Resolvable.class"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="logger/LogEnabled.class"/>
+ <include name="logger/Loggable.class"/>
+ <include name="logger/Logger.class"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="parameters/*"/>
+ <exclude name="parameters/test"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="service/Service*.class"/>
+ </fileset>
+
+ <fileset dir="${framework.root}">
+ <include name="thread/*"/>
+ </fileset>
+ </move>
+
+ <!-- jar the interface classes -->
+ <jar jarfile="${target.lib}/${framework.name}-api.jar"
+ basedir="${target.dir}/interfaces/"
+ compress="${compress.jars}">
+ <manifest>
+ <attribute name="Extension-Name" value="${framework.name}"/>
+ <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
+ <attribute name="Specification-Version" value="1.0"/>
+ <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ <attribute name="Implementation-Vendor-Id" value="ASF"/>
+ </manifest>
+ <exclude name="**/test/*"/>
+ <include name="org/apache/avalon/framework/**"/>
+ <zipfileset dir="${target.conf}" prefix="META-INF/">
+ <include name="LICENSE.txt"/>
+ </zipfileset>
+ </jar>
+
+ <!-- Jar what's left (should be impl) -->
+ <jar jarfile="${target.lib}/${framework.name}-impl.jar"
+ basedir="${target.classes}"
+ compress="${compress.jars}">
+ <manifest>
+ <attribute name="Extension-Name" value="${framework.name}"/>
+ <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
+ <attribute name="Specification-Version" value="1.0"/>
+ <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ <attribute name="Implementation-Vendor-Id" value="ASF"/>
+ </manifest>
+ <exclude name="**/test/*"/>
+ <include name="org/apache/avalon/framework/**"/>
+ <zipfileset dir="${target.conf}" prefix="META-INF/">
+ <include name="LICENSE.txt"/>
+ </zipfileset>
+ </jar>
+
+ <!-- Move everything back, so nothing breaks in the build file -->
+ <move todir="${target.classes}">
+ <fileset dir="${target.dir}/interfaces/" includes="**/*"/>
+ </move>
</target>
-
+
<target name="install" depends="all,install-check-cjan">
<mkdir dir="${cjan.lib}"/>
<copy file="${target.lib}/${framework.name}.jar" todir="${cjan.lib}"/>
</target>
-
+
<target name="install-check-cjan" unless="cjan.lib">
<fail message="cjan.lib not specified."/>
</target>
-
+
<target name="uninstall" depends="install-check-cjan">
<delete file="${target.lib}/${framework.name}.jar" dir="${cjan.lib}"/>
</target>
-
+
<!-- Create the distribution -->
<target name="bin-dist" depends="all">
-
+
<mkdir dir="${dist.dir}"/>
<copy file="${target.lib}/${framework.name}.jar" tofile="${dist.dir}/${framework.name}-${version}.jar"/>
<!-- <copy file="${lib.dir}/${logkit.jar}" todir="${dist.dir}"/> -->
-
+
<mkdir dir="${dist.docs}"/>
<mkdir dir="${dist.javadocs}"/>
-
+
<copy todir="${dist.docs}">
<fileset dir="${target.docs}"/>
</copy>
-
+
<copy todir="${dist.javadocs}">
<fileset dir="${target.javadocs}"/>
</copy>
-
+
<copy todir="${dist.dir}">
<fileset dir=".">
<include name="README.txt"/>
@@ -508,24 +624,24 @@
<include name="LICENSE.txt"/>
</fileset>
</copy>
-
+
<chmod dir="${dist.dir}" perm="go-rwx"/>
-
+
</target>
-
+
<!-- Create the source distribution -->
<target name="src-dist" depends="setup-properties">
-
+
<mkdir dir="${src.dist.dir}"/>
-
+
<copy todir="${src.dist.lib}">
<fileset dir="${lib.dir}">
<include name="README.txt"/>
</fileset>
</copy>
-
+
<!-- <copy file="${lib.dir}/${logkit.jar}" todir="${src.dist.lib}"/> -->
-
+
<copy todir="${src.dist.src}">
<fileset dir="${src.dir}">
<exclude name="**/*.zip"/>
@@ -536,21 +652,21 @@
<exclude name="proposal/**"/>
</fileset>
</copy>
-
+
<copy todir="${src.dist.docs}">
<fileset dir="${target.docs}"/>
</copy>
-
+
<copy todir="${src.dist.javadocs}">
<fileset dir="${target.javadocs}"/>
</copy>
-
+
<copy todir="${src.dist.dir}/tools">
<fileset dir="${tools.dir}">
<include name="*.xsl"/>
</fileset>
</copy>
-
+
<filter token="version" value="${version}"/>
<filter token="year" value="${year}"/>
<copy todir="${src.dist.dir}" filtering="on">
@@ -567,54 +683,54 @@
<include name="forrest.properties"/>
</fileset>
</copy>
-
+
<fixcrlf srcdir="${src.dist.dir}" includes="target.sh" eol="lf"/>
<fixcrlf srcdir="${src.dist.dir}" includes="target.bat" eol="crlf"/>
-
+
<fixcrlf srcdir="${src.dist.src}/java" includes="**/*.java" eol="lf"/>
-
+
<chmod dir="${src.dist.dir}" perm="go-rwx"/>
-
+
</target>
-
+
<!-- Completely build all dists -->
<target name="dist" depends="site-docs, setup-properties" description="generates the Avalon distribution">
<mkdir dir="${dist.base}"/>
-
+
<antcall target="bin-dist">
<param name="dist.dir" value="${dist.name}"/>
</antcall>
-
+
<copy file="${target.lib}/avalon-framework.jar" tofile="${tools.dir}/ext/avalon-framework.jar"/>
-
+
<zip file="${dist.base}/${dist.name}-bin.zip"
basedir="${dist.name}/.."
includes="${dist.name}/**"/>
-
+
<tar longfile="gnu" tarfile="${dist.base}/${dist.name}-bin.tar">
<tarfileset dir="${dist.name}/.." username="avalon" group="avalon">
<include name="${dist.name}/**"/>
</tarfileset>
</tar>
-
+
<gzip zipfile="${dist.base}/${dist.name}-bin.tar.gz"
src="${dist.base}/${dist.name}-bin.tar"/>
-
+
<delete file="${dist.base}/${dist.name}-bin.tar"/>
<delete dir="${dist.name}"/>
-
+
<antcall target="src-dist">
<param name="src.dist.dir" value="${dist.name}"/>
</antcall>
-
+
<copy todir="${dist.name}">
<fileset dir="${src.dist.dir}"/>
</copy>
-
+
<zip file="${dist.base}/${dist.name}-src.zip"
basedir="${dist.name}/.."
includes="${dist.name}/**"/>
-
+
<tar longfile="gnu" tarfile="${dist.base}/${dist.name}-src.tar">
<tarfileset dir="${dist.name}/.." mode="755" username="avalon" group="avalon">
<include name="${dist.name}/target.sh"/>
@@ -624,16 +740,16 @@
<exclude name="${dist.name}/target.sh"/>
</tarfileset>
</tar>
-
+
<gzip zipfile="${dist.base}/${dist.name}-src.tar.gz"
src="${dist.base}/${dist.name}-src.tar"/>
-
+
<delete file="${dist.base}/${dist.name}-src.tar"/>
<delete dir="${dist.name}"/>
<delete dir="${src.dist.dir}"/>
-
+
</target>
-
+
<target name="sitebook2docbook" description="goes through all the xdocs and transforms them to docbook">
<style style="${document2docbook}"
basedir="${context.dir}/xdocs"
@@ -641,7 +757,7 @@
extension=".xml"
includes="*.xml,*/*.xml,*/*/*.xml"/>
</target>
-
+
<!-- Cleans up build and distribution directories -->
<target name="clean" depends="setup-properties" description="cleans up the created directories">
<delete dir="${target.dir}"/>
@@ -650,7 +766,7 @@
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
</delete>
</target>
-
+
<!-- Cleans absolutely everything up -->
<target name="distclean" depends="clean" description="cleans up all generated files and directories">
<delete dir="${docs.dir}"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org