You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/06/27 05:31:40 UTC

cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/components Component1.java

donaldp     2002/06/26 20:31:40

  Modified:    containerkit build.xml
               containerkit/src/java/org/apache/excalibur/containerkit/kernel/components
                        Component1.java
  Log:
  Add in simple xdoclet task call and some decoration on Component to show example of descriptor generation
  
  Revision  Changes    Path
  1.4       +100 -80   jakarta-avalon-excalibur/containerkit/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml	23 Jun 2002 04:30:37 -0000	1.3
  +++ build.xml	27 Jun 2002 03:31:40 -0000	1.4
  @@ -17,6 +17,7 @@
           <pathelement location="${checkstyle.jar}"/>
           <pathelement location="${xml-apis.jar}"/>
           <pathelement path="${java.class.path}"/>
  +        <fileset dir="lib" includes="**/*.jar"/>
       </path>
   
       <path id="tools.class.path">
  @@ -127,11 +128,11 @@
               basedir="${build.classes}"
               compress="${build.compress}">
               <manifest>
  -              <attribute name="Extension-Name" value="${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="${package-version}"/>
  +                <attribute name="Extension-Name" value="${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="${package-version}"/>
               </manifest>
               <exclude name="**/test/**"/>
               <zipfileset dir="${build.conf}" prefix="META-INF/">
  @@ -261,12 +262,31 @@
   
       </target>
   
  +    <target name="xdoclet" depends="main" description="Generates the XML descriptors">
  +        <taskdef name="avalon-xinfo"
  +            classname="org.apache.excalibur.containerkit.xdoclet.AvalonXDoclet">
  +            <classpath>
  +                <path refid="project.class.path"/>
  +                <pathelement location="${build.classes}"/>
  +            </classpath>
  +        </taskdef>
  +
  +        <avalon-xinfo
  +            force="true"
  +            destdir="gen"
  +            classpathref="project.class.path">
  +            <fileset dir="${java.dir}">
  +                <include name="**/kernel/components/*.java" />
  +            </fileset>
  +            <componentinfo/>
  +        </avalon-xinfo>
  +    </target>
  +
       <!-- Creates the distribution -->
       <target name="dist"
           depends="dist-jar, test-reports, checkstyle-report, javadocs"
           description="Generates a distribution (jar + javadocs + unit tests + checkstyle reports)">
   
  -
           <copy file="${build.conf}/LICENSE.txt" todir="${dist.dir}"/>
           <copy file="../KEYS" todir="${dist.dir}"/>
           <copy file="README.txt" todir="${dist.dir}"/>
  @@ -325,92 +345,92 @@
   
       <!-- Setup the filters -->
       <target name="setup-filters">
  -      <filter token="Name" value="Avalon ${Name}"/>
  -      <filter token="name" value="${dir-name}"/>
  -      <filter token="version" value="${version}"/>
  -      <filter token="year" value="${year}"/>
  -      <filter token="status" value="${status}"/>
  -      <filter token="release" value="${release}"/>
  -      <filter token="short-version" value="${short.version}"/>
  -
  -      <property name="avalon.base" value="http://jakarta.apache.org/avalon"/>
  -      <property name="framework.base" value="http://jakarta.apache.org/avalon/framework"/>
  -      <property name="phoenix.base" value="http://jakarta.apache.org/avalon/phoenix"/>
  -      <property name="cornerstone.base" value="http://jakarta.apache.org/avalon/cornerstone"/>
  -      <property name="logkit.base" value="http://jakarta.apache.org/avalon/logkit"/>
  -      <property name="testlet.base" value="http://jakarta.apache.org/avalon/testlet"/>
  -
  -      <filter token="year" value="${year}"/>
  -      <filter token="AVALON_BASE" value="${avalon.base}"/>
  -      <filter token="FRAMEWORK_BASE" value="${framework.base}"/>
  -      <filter token="PHOENIX_BASE" value="${phoenix.base}"/>
  -      <filter token="CORNERSTONE_BASE" value="${cornerstone.base}"/>
  -      <filter token="LOGKIT_BASE" value="${logkit.base}"/>
  -      <filter token="TESTLET_BASE" value="${testlet.base}"/>
  +        <filter token="Name" value="Avalon ${Name}"/>
  +        <filter token="name" value="${dir-name}"/>
  +        <filter token="version" value="${version}"/>
  +        <filter token="year" value="${year}"/>
  +        <filter token="status" value="${status}"/>
  +        <filter token="release" value="${release}"/>
  +        <filter token="short-version" value="${short.version}"/>
  +
  +        <property name="avalon.base" value="http://jakarta.apache.org/avalon"/>
  +        <property name="framework.base" value="http://jakarta.apache.org/avalon/framework"/>
  +        <property name="phoenix.base" value="http://jakarta.apache.org/avalon/phoenix"/>
  +        <property name="cornerstone.base" value="http://jakarta.apache.org/avalon/cornerstone"/>
  +        <property name="logkit.base" value="http://jakarta.apache.org/avalon/logkit"/>
  +        <property name="testlet.base" value="http://jakarta.apache.org/avalon/testlet"/>
  +
  +        <filter token="year" value="${year}"/>
  +        <filter token="AVALON_BASE" value="${avalon.base}"/>
  +        <filter token="FRAMEWORK_BASE" value="${framework.base}"/>
  +        <filter token="PHOENIX_BASE" value="${phoenix.base}"/>
  +        <filter token="CORNERSTONE_BASE" value="${cornerstone.base}"/>
  +        <filter token="LOGKIT_BASE" value="${logkit.base}"/>
  +        <filter token="TESTLET_BASE" value="${testlet.base}"/>
       </target>
   
   
       <!-- Prepares the documentation directory -->
       <target name="docs" depends="setup-filters"> <!-- depends="javadocs" description="Generates the Docs" -->
  -      <mkdir dir="${docs.dir}"/>
  +        <mkdir dir="${docs.dir}"/>
   
  -      <mkdir dir="${build.context}"/>
  -      <mkdir dir="${build.xdocs}"/>
  -      <mkdir dir="${build.docs}"/>
  -      <mkdir dir="${build.dir}/work"/>
  -
  -      <!-- Base pointers for non-xdocs documentation. Override these in .ant.properties to link to local docs -->
  -      <copy todir="${build.context}" filtering="on">
  -        <fileset dir="${context.dir}">
  -          <exclude name="diagrams/**"/>
  -          <exclude name="resources/**"/>
  -          <exclude name="xdocs"/>
  -        </fileset>
  -      </copy>
  -
  -      <copy todir="${build.context}/xdocs" filtering="on" overwrite="yes">
  -        <fileset dir="${xdocs.dir}"/>
  -      </copy>
  -
  -      <copy todir="${build.context}/resources" filtering="off" overwrite="yes">
  -        <fileset dir="${context.dir}/resources"/>
  -        <fileset dir="${xdocs.dir}">
  -          <include name="**/images/**"/>
  -        </fileset>
  -      </copy>
  -
  -      <java classname="org.apache.cocoon.Main" fork="true">
  -        <arg value="-c${build.context}/"/>
  -        <arg value="-d${build.docs}"/>
  -        <arg value="-w${build.dir}/work"/>
  -        <arg value="-l${build.dir}/work/cocoon.log"/>
  -        <arg value="-uINFO"/>
  -        <arg value="-f${xdocs.dir}/${dir-name}.uris"/>
  -        <classpath>
  -          <path refid="tools.class.path"/>
  -          <fileset dir="${tools.dir}/ext"/>
  -        </classpath>
  -      </java>
  -
  -      <copy todir="${docs.dir}">
  -        <fileset dir="${build.docs}">
  -          <include name="**"/>
  -        </fileset>
  -      </copy>
  +        <mkdir dir="${build.context}"/>
  +        <mkdir dir="${build.xdocs}"/>
  +        <mkdir dir="${build.docs}"/>
  +        <mkdir dir="${build.dir}/work"/>
  +
  +        <!-- Base pointers for non-xdocs documentation. Override these in .ant.properties to link to local docs -->
  +        <copy todir="${build.context}" filtering="on">
  +            <fileset dir="${context.dir}">
  +                <exclude name="diagrams/**"/>
  +                <exclude name="resources/**"/>
  +                <exclude name="xdocs"/>
  +            </fileset>
  +        </copy>
   
  -      <!-- hack for stupid transport on api link -->
  -      <replace file="${docs.dir}/index.html" token="index.html.xml" value="index.html"/>
  +        <copy todir="${build.context}/xdocs" filtering="on" overwrite="yes">
  +            <fileset dir="${xdocs.dir}"/>
  +        </copy>
  +
  +        <copy todir="${build.context}/resources" filtering="off" overwrite="yes">
  +            <fileset dir="${context.dir}/resources"/>
  +            <fileset dir="${xdocs.dir}">
  +                <include name="**/images/**"/>
  +            </fileset>
  +        </copy>
  +
  +        <java classname="org.apache.cocoon.Main" fork="true">
  +            <arg value="-c${build.context}/"/>
  +            <arg value="-d${build.docs}"/>
  +            <arg value="-w${build.dir}/work"/>
  +            <arg value="-l${build.dir}/work/cocoon.log"/>
  +            <arg value="-uINFO"/>
  +            <arg value="-f${xdocs.dir}/${dir-name}.uris"/>
  +            <classpath>
  +                <path refid="tools.class.path"/>
  +                <fileset dir="${tools.dir}/ext"/>
  +            </classpath>
  +        </java>
  +
  +        <copy todir="${docs.dir}">
  +            <fileset dir="${build.docs}">
  +                <include name="**"/>
  +            </fileset>
  +        </copy>
  +
  +        <!-- hack for stupid transport on api link -->
  +        <replace file="${docs.dir}/index.html" token="index.html.xml" value="index.html"/>
   
       </target>
   
       <target name="site" depends="javadocs, docs" description=" Places Docs ready for hosting on website">
   
  -      <mkdir dir="../site/dist/docs/${dir-name}"/>
  -      <copy todir="../site/dist/docs/${dir-name}">
  -        <fileset dir="${docs.dir}">
  -          <include name="**"/>
  -        </fileset>
  -      </copy>
  +        <mkdir dir="../site/dist/docs/${dir-name}"/>
  +        <copy todir="../site/dist/docs/${dir-name}">
  +            <fileset dir="${docs.dir}">
  +                <include name="**"/>
  +            </fileset>
  +        </copy>
   
       </target>
   
  
  
  
  1.2       +16 -1     jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/components/Component1.java
  
  Index: Component1.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/components/Component1.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Component1.java	25 Jun 2002 07:43:24 -0000	1.1
  +++ Component1.java	27 Jun 2002 03:31:40 -0000	1.2
  @@ -11,10 +11,25 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
   
  +/**
  + * @avalon.component lifestyle="alternative" version="1.4"
  + * @avalon.service interface="org.apache.excalibur.containerkit.kernel.components.Service1" shareable="true"
  + */
   public class Component1
  -    implements Service1, Configurable, Initializable
  +    implements Service1, Configurable, Initializable, Serviceable
   {
  +    /**
  +     * @avalon.dependency interface="org.apache.excalibur.containerkit.kernel.components.Service1" shareable="true" role="fred"
  +     */
  +    public void service( final ServiceManager manager )
  +        throws ServiceException
  +    {
  +    }
  +
       public void configure( Configuration configuration )
           throws ConfigurationException
       {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>