donaldp 02/03/06 01:33:08
Modified: proposal/myrmidon/src/make/org/apache/myrmidon/build
AntlibDescriptorTask.java
proposal/myrmidon build.xml antlib.xml
Added: proposal/myrmidon/src/make/org/apache/myrmidon/build
AntDocSubTask.java
Log:
Start to integrate antdocs generation into build process.
Revision Changes Path
1.2 +14 -3
jakarta-ant/proposal/myrmidon/src/make/org/apache/myrmidon/build/AntlibDescriptorTask.java
Index: AntlibDescriptorTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/make/org/apache/myrmidon/build/AntlibDescriptorTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AntlibDescriptorTask.java 1 Mar 2002 01:44:04 -0000 1.1
+++ AntlibDescriptorTask.java 6 Mar 2002 09:33:08 -0000 1.2
@@ -25,13 +25,14 @@
public class AntlibDescriptorTask
extends DocletTask
{
+ private static final String DESCRIPTOR_TEMPLATE =
"/org/apache/myrmidon/build/ant-descriptor.j";
+ private static final String ROLES_TEMPLATE =
"/org/apache/myrmidon/build/ant-roles.j";
+
+ private TemplateSubTask m_antDocs;
private String m_libName;
private String m_descriptorFileName;
private String m_rolesFileName;
- private static final String DESCRIPTOR_TEMPLATE =
"/ant-descriptor.template";
- private static final String ROLES_TEMPLATE = "/ant-roles.template";
-
/**
* Specifies the Antlib name, which is used to name the generated files.
*/
@@ -56,6 +57,11 @@
m_rolesFileName = rolesFileName;
}
+ public void addAntdoc( final AntDocSubTask antDocs )
+ {
+ m_antDocs = antDocs;
+ }
+
public void execute() throws BuildException
{
// Add the base directories of all the filesets to the sourcepath
@@ -75,6 +81,11 @@
final TemplateSubTask rolesTemplate =
makeTemplateSubTask( ROLES_TEMPLATE, getRolesFileName() );
addTemplate( rolesTemplate );
+
+ if( null != m_antDocs )
+ {
+ addTemplate( m_antDocs );
+ }
if( !upToDate() )
{
1.1
jakarta-ant/proposal/myrmidon/src/make/org/apache/myrmidon/build/AntDocSubTask.java
Index: AntDocSubTask.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.myrmidon.build;
import com.sun.javadoc.ClassDoc;
import java.io.File;
import java.net.URL;
import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
/**
* Generates the XML Documentation for Ant types (including tasks and
DataTypes).
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2002/03/06 09:33:08 $
*/
public class AntDocSubTask
extends TemplateSubTask
{
public final static String SUBTASK_NAME = "antdoc";
private static final String GENERATED_FILE_NAME = "{0}.xml";
private static final String DEFAULT_TEMPLATE_FILE =
"/org/apache/myrmidon/build/type.j";
private File m_docsDestDir;
public AntDocSubTask()
{
setTemplateFile( new File( DEFAULT_TEMPLATE_FILE ) );
setDestinationFile( GENERATED_FILE_NAME );
final TemplateSubTask.ExtentTypes extent = new
TemplateSubTask.ExtentTypes();
extent.setValue( "hierarchy" );
setExtent( extent );
}
/**
* Specifies the directory that is the destination of generated generated
* xml documentation for types.
*/
public void setDocsDestDir( final File docsDestDir )
{
m_docsDestDir = docsDestDir;
}
public String getSubTaskName()
{
return SUBTASK_NAME;
}
/**
* Called to validate configuration parameters.
*/
public void validateOptions()
throws XDocletException
{
super.validateOptions();
if( null == m_docsDestDir )
{
throw new XDocletException( "'docsDestDir' attribute is missing
." );
}
}
protected boolean matchesGenerationRules( final ClassDoc clazz )
throws XDocletException
{
if( !super.matchesGenerationRules( clazz ) )
{
return false;
}
else if( clazz.isAbstract() )
{
return false;
}
else
{
return true;
}
}
}
1.66 +18 -4 jakarta-ant/proposal/myrmidon/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/build.xml,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- build.xml 1 Mar 2002 02:13:35 -0000 1.65
+++ build.xml 6 Mar 2002 09:33:08 -0000 1.66
@@ -185,12 +185,15 @@
<!-- Compiles and installs the custom build tasks -->
<target name="custom-tasks">
<property name="custom-tasks-dir" value="${build.dir}/tasks"/>
+ <property name="custom-package-dir"
value="${custom-tasks-dir}/org/apache/myrmidon/build"/>
<mkdir dir="${custom-tasks-dir}"/>
<javac srcdir="src/make" destdir="${custom-tasks-dir}">
<classpath refid="project.class.path"/>
</javac>
- <copy file="${manifest.dir}/ant-descriptor.template"
todir="${build.dir}/tasks"/>
- <copy file="${manifest.dir}/ant-roles.template"
todir="${build.dir}/tasks"/>
+
+ <copy file="${manifest.dir}/ant-descriptor.template"
tofile="${custom-package-dir}/ant-descriptor.j"/>
+ <copy file="${manifest.dir}/ant-roles.template"
tofile="${custom-package-dir}/ant-roles.j"/>
+ <copy file="${manifest.dir}/type.j"
tofile="${custom-package-dir}/type.j"/>
<taskdef name="antlib-jar"
classname="org.apache.myrmidon.build.AntlibJarTask">
<classpath location="${custom-tasks-dir}"/>
@@ -320,6 +323,15 @@
<include name="org/apache/myrmidon/launcher/*" />
</patternset>
+ <patternset id="myrmidon-api-xdoclet.include">
+ <include name="org/apache/myrmidon/api/*" />
+ <include name="org/apache/myrmidon/aspects/*" />
+ <include name="org/apache/myrmidon/interfaces/**" />
+ <include name="org/apache/myrmidon/listeners/*" />
+ <include name="org/apache/myrmidon/framework/**" />
+ <include name="org/apache/aut/converter/**" />
+ </patternset>
+
<patternset id="myrmidon-api.include">
<include name="org/apache/myrmidon/api/*" />
<include name="org/apache/myrmidon/aspects/*" />
@@ -357,12 +369,13 @@
<!-- The "builtin" descriptors include metainfo for both
myrmidon-api and myrmidon-container jars.
(Packaged with myrmidon-api.jar). -->
+
<antlib-descriptor libName="builtin"
destdir="${gen.dir}"
classpathref="project.class.path">
<fileset dir="${java.dir}">
- <patternset refid="myrmidon-api.include"/>
- <patternset refid="myrmidon-container.include"/>
+ <patternset refid="myrmidon-api-xdoclet.include"/>
+ <!-- <patternset refid="myrmidon-container.include"/>-->
</fileset>
</antlib-descriptor>
@@ -373,6 +386,7 @@
<patternset refid="selftest.include"/>
</fileset>
</antlib-descriptor>
+
</target>
<!-- Package the jar files -->
1.6 +3 -0 jakarta-ant/proposal/myrmidon/antlib.xml
Index: antlib.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/antlib.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- antlib.xml 1 Mar 2002 02:13:35 -0000 1.5
+++ antlib.xml 6 Mar 2002 09:33:08 -0000 1.6
@@ -18,6 +18,7 @@
<property name="build.dir" value="build"/>
<property name="build.lib" value="${build.dir}/lib"/>
+ <property name="build.custom-tasks" value="${build.dir}/tasks"/>
<property name="src.base" value="src"/>
<property name="java.dir" value="${src.base}/java"/>
@@ -36,6 +37,7 @@
<include name="*.jar" />
</fileset>
<pathelement path="${build.classes}" />
+ <pathelement path="${build.custom-tasks}" />
</path>
<!-- Main target -->
@@ -59,6 +61,7 @@
<fileset dir="${java.dir}">
<patternset refid="antlib.include"/>
</fileset>
+ <!-- antdoc docsDestDir="${gen.dir}/docs"/-->
</antlib-descriptor>
</target>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>