Browse Source

move xdocs proposal

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@896786 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
1f8ba82cf4
36 changed files with 0 additions and 3446 deletions
  1. +0
    -567
      proposal/xdocs/build.xml
  2. +0
    -16
      proposal/xdocs/dvsl/README.txt
  3. +0
    -45
      proposal/xdocs/dvsl/build.xml
  4. BIN
      proposal/xdocs/dvsl/lib/dom4j-1.2-jp.jar
  5. +0
    -19
      proposal/xdocs/dvsl/lib/dom4j-README.txt
  6. BIN
      proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar
  7. BIN
      proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar
  8. +0
    -524
      proposal/xdocs/dvsl/task.dvsl
  9. +0
    -4
      proposal/xdocs/dvsl/toolbox.props
  10. +0
    -37
      proposal/xdocs/lib/LICENSE.xdoclet.txt
  11. BIN
      proposal/xdocs/lib/commons-collections-2.0.jar
  12. BIN
      proposal/xdocs/lib/commons-logging.jar
  13. BIN
      proposal/xdocs/lib/xdoclet-1.2.jar
  14. BIN
      proposal/xdocs/lib/xdoclet-ejb-module-1.2.jar
  15. BIN
      proposal/xdocs/lib/xdoclet-web-module-1.2.jar
  16. BIN
      proposal/xdocs/lib/xdoclet-xdoclet-module-1.2.jar
  17. BIN
      proposal/xdocs/lib/xjavadoc-1.0.2.jar
  18. +0
    -33
      proposal/xdocs/log4j.properties
  19. +0
    -23
      proposal/xdocs/metadata/xdoclet.xml
  20. +0
    -80
      proposal/xdocs/src/org/apache/ant/xdoclet/AntDocletTask.java
  21. +0
    -174
      proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java
  22. +0
    -144
      proposal/xdocs/src/org/apache/ant/xdoclet/IndexGen.java
  23. +0
    -39
      proposal/xdocs/src/org/apache/ant/xdoclet/TaskDefPropertiesSubTask.java
  24. +0
    -60
      proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java
  25. +0
    -855
      proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java
  26. +0
    -92
      proposal/xdocs/src/org/apache/ant/xdoclet/resources/task_xml.xdt
  27. +0
    -2
      proposal/xdocs/src/org/apache/ant/xdoclet/resources/taskdef_properties.xdt
  28. +0
    -54
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/ConditionTask.xml
  29. +0
    -195
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javac.xml
  30. +0
    -59
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javadoc.xml
  31. +0
    -65
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/Property.xml
  32. +0
    -129
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml
  33. +0
    -111
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/Tar.xml
  34. +0
    -67
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/Test.java
  35. +0
    -49
      proposal/xdocs/templates/datatype_xdoc.template
  36. +0
    -3
      proposal/xdocs/templates/type_defaults_properties.template

+ 0
- 567
proposal/xdocs/build.xml View File

@@ -1,567 +0,0 @@
<?xml version="1.0" ?>
<project name="xdocs" default="default">

<!--
Give user a chance to override without editing this file
(and without typing -D each time)
-->
<property file="${user.home}/.${ant.project.name}.properties"/>

<property name="src.root"
location="../../src/main"/>
<property name="docs.src"
location="../../xdocs"/>
<property name="xdocs.dir"
location="xdocs"/>
<property name="build.dir" location="build"/>
<property name="antdoclet.src.dir" location="src"/>
<property name="gen.dir" location="${build.dir}/gen"/>
<property name="build.docs.dir" location="${build.dir}/docs"/>
<property name="ant.package" value="org/apache/tools/ant"/>
<property name="optional.package" value="${ant.package}/taskdefs/optional"/>
<property name="optional.type.package" value="${ant.package}/types/optional"/>
<property name="apache.resolver.type.package" value="${ant.package}/types/resolver"/>
<property name="util.package" value="${ant.package}/util"/>
<property name="regexp.package" value="${util.package}/regexp"/>

<path id="classpath">
</path>

<!-- depends on JDK version -->
<selector id="needs.jdk1.3+">
<or>
<filename name="${ant.package}/taskdefs/TestProcess*"/>
<filename name="${optional.package}/extension/**"/>
</or>
</selector>

<selector id="needs.jdk1.4+">
<or>
<filename name="${regexp.package}/Jdk14Regexp*"/>
</or>
</selector>

<!-- classes that should be present in Sun based JVMs, but not in
Kaffe for example -->
<selector id="needs.sun.tools">
<or>
<filename name="${optional.package}/Native2Ascii*"/>
<filename name="${optional.package}/Javah*"/>
</or>
</selector>

<selector id="needs.sun.uue">
<filename name="${ant.package}/taskdefs/email/UUMailer*"/>
</selector>

<selector id="needs.sun.b64">
<or>
<filename name="${optional.package}/splash/SplashTask*"/>
</or>
</selector>

<!-- depends on external libraries -->
<selector id="needs.trax">
<or>
<filename name="${optional.package}/TraXLiaison*"/>
<filename name="${optional.package}/sitraka/**"/>
<filename name="${optional.package}/metamata/MMetrics*"/>
<filename name="${optional.package}/XsltTest*"/>
<filename name="${ant.package}/types/XMLCatalogBuildFileTest*"/>
</or>
</selector>

<selector id="needs.xalan1">
<or>
<filename name="${optional.package}/XalanLiaison*"/>
<filename name="${optional.package}/junit/Xalan1Executor*"/>
</or>
</selector>

<selector id="needs.xalan2">
<filename name="${optional.package}/junit/Xalan2Executor*"/>
</selector>

<selector id="needs.xslp">
<filename name="${optional.package}/XslpLiaison*"/>
</selector>

<selector id="needs.apache.resolver">
<filename name="${apache.resolver.type.package}/**"/>
</selector>

<selector id="needs.junit">
<filename name="${optional.package}/junit/**"/>
</selector>

<selector id="needs.jakarta.regexp">
<filename name="${regexp.package}/JakartaRegexp*"/>
</selector>

<selector id="needs.jakarta.oro">
<or>
<filename name="${regexp.package}/JakartaOro*"/>
<filename name="${optional.package}/perforce/*"/>
<filename name="${optional.package}/metamata/MAudit*"/>
</or>
</selector>

<selector id="needs.jakarta.bcel">
<or>
<filename name="${ant.package}/filters/util/JavaClassHelper*"/>
<filename name="${util.package}/depend/bcel/*"/>
<filename name="${optional.type.package}/depend/ClassFileSetTest*"/>
</or>
</selector>

<selector id="needs.jakarta.log4j">
<filename name="${ant.package}/listener/Log4jListener*"/>
</selector>

<selector id="needs.commons.logging">
<filename name="${ant.package}/listener/CommonsLoggingListener*"/>
</selector>

<selector id="needs.bsf">
<or>
<filename name="${optional.package}/Script*"/>
<filename name="${optional.package}/script/**/*"/>
<filename name="${optional.type.package}/Script*"/>
<filename name="${util.package}/Script*"/>
</or>
</selector>

<selector id="needs.stylebook">
<filename name="${optional.package}/StyleBook*"/>
</selector>

<selector id="needs.javamail">
<or>
<filename name="${ant.package}/taskdefs/email/MimeMailer*"/>
</or>
</selector>

<selector id="needs.icontract">
<filename name="${optional.package}/IContract*"/>
</selector>

<selector id="needs.netrexx">
<filename name="${optional.package}/NetRexxC*"/>
</selector>

<selector id="needs.weblogic.ejbc">
<filename name="${optional.package}/ejb/Ejbc*"/>
</selector>

<selector id="needs.weblogic.ddcreator">
<filename name="${optional.package}/ejb/DDCreator*"/>
</selector>

<selector id="needs.weblogic.server">
<or>
<filename name="${optional.package}/ejb/WLRun*"/>
<filename name="${optional.package}/ejb/WLStop*"/>
</or>
</selector>

<selector id="needs.commons.net">
<or>
<filename name="${optional.package}/net/FTP*"/>
<filename name="${optional.package}/net/RExec*"/>
<filename name="${optional.package}/net/TelnetTask*"/>
</or>
</selector>

<selector id="needs.starteam">
<or>
<filename name="${optional.package}/scm/AntStarTeam*"/>
<filename name="${optional.package}/starteam/*"/>
</or>
</selector>

<selector id="needs.vaj">
<filename name="${optional.package}/ide/VAJ*"/>
</selector>

<selector id="needs.antlr">
<filename name="${optional.package}/ANTLR*"/>
</selector>

<selector id="needs.jmf">
<filename name="${optional.package}/sound/*"/>
</selector>

<selector id="needs.jai">
<or>
<filename name="${optional.package}/image/*"/>
<filename name="${ant.package}/types/optional/image/*"/>
</or>
</selector>

<selector id="needs.jdepend">
<filename name="${optional.package}/jdepend/*"/>
</selector>

<selector id="needs.swing">
<filename name="${optional.package}/splash/*"/>
</selector>

<selector id="needs.jsch">
<filename name="${optional.package}/ssh/*"/>
</selector>

<available property="jdk1.3+" classname="java.lang.StrictMath"/>
<available property="jdk1.4+" classname="java.lang.CharSequence"/>
<available property="kaffe" classname="kaffe.util.NotImplemented"/>
<available property="bsf.present"
classname="org.apache.bsf.BSFManager"
classpathref="classpath"/>
<available property="netrexx.present"
classname="netrexx.lang.Rexx"
classpathref="classpath"/>
<available property="trax.present"
classname="javax.xml.transform.Transformer"
classpathref="classpath"/>
<condition property="trax.impl.present">
<or>
<and>
<isset property="javax.xml.transform.TransformerFactory"/>
<available classname="${javax.xml.transform.TransformerFactory}"
classpathref="classpath"/>
</and>
<available resource="META-INF/services/javax.xml.transform.TransformerFactory"/>
</or>
</condition>
<available property="xslp.present"
classname="com.kvisco.xsl.XSLProcessor"
classpathref="classpath"/>
<available property="apache.resolver.present"
classname="org.apache.xml.resolver.tools.CatalogResolver"
classpathref="classpath"/>
<available property="xalan.present"
classname="org.apache.xalan.xslt.XSLTProcessorFactory"
classpathref="classpath"/>
<available property="xalan2.present"
classname="org.apache.xalan.transformer.TransformerImpl"
classpathref="classpath"/>
<available property="ejb.ejbc.present"
classname="weblogic.ejbc"
classpathref="classpath"/>
<available property="ejb.DDCreator.present"
classname="weblogic.ejb.utils.DDCreator"
classpathref="classpath"/>
<available property="ejb.wls.present"
classname="weblogic.Server"
classpathref="classpath"/>
<available property="junit.present"
classname="junit.framework.TestCase"
classpathref="classpath"/>
<available property="commons.net.present"
classname="org.apache.commons.net.ftp.FTPClient"
classpathref="classpath"/>
<available property="starteam.present"
classname="com.starbase.util.Platform"
classpathref="classpath"/>
<available property="antlr.present"
classname="antlr.Tool"
classpathref="classpath"/>
<available property="vaj.present"
classname="com.ibm.ivj.util.base.Workspace"
classpathref="classpath"/>
<available property="stylebook.present"
classname="org.apache.stylebook.Engine"
classpathref="classpath"/>
<available property="jakarta.regexp.present"
classname="org.apache.regexp.RE"
classpathref="classpath"/>
<available property="jakarta.oro.present"
classname="org.apache.oro.text.regex.Perl5Matcher"
classpathref="classpath"/>
<available property="jmf.present"
classname="javax.sound.sampled.Clip"
classpathref="classpath"/>
<available property="jai.present"
classname="javax.media.jai.JAI"
classpathref="classpath"/>
<available property="icontract.present"
classname="com.reliablesystems.iContract.IContracted"
classpathref="classpath"/>
<available property="jdepend.present"
classname="jdepend.framework.JDepend"
classpathref="classpath"/>
<available property="log4j.present"
classname="org.apache.log4j.Category"
classpathref="classpath"/>
<available property="commons.logging.present"
classname="org.apache.commons.logging.LogFactory"
classpathref="classpath"/>
<available property="xalan.envcheck"
classname="org.apache.xalan.xslt.EnvironmentCheck"
classpathref="classpath"/>
<available property="which.present"
classname="org.apache.env.Which"
classpathref="classpath"/>

<available property="xerces.present"
classname="org.apache.xerces.parsers.SAXParser"
classpathref="classpath"/>
<available property="bcel.present"
classname="org.apache.bcel.Constants"
classpathref="classpath"/>
<available property="sunuue.present"
classname="sun.misc.UUEncoder"
classpathref="classpath"/>

<condition property="javamail.complete">
<and>
<available classname="javax.activation.DataHandler"
classpathref="classpath"/>
<available classname="javax.mail.Transport"
classpathref="classpath"/>
</and>
</condition>

<condition property="some.regexp.support">
<or>
<isset property="jdk1.4+"/>
<isset property="jakarta.regexp.present"/>
<isset property="jakarta.oro.present"/>
</or>
</condition>

<condition property="tests.and.ant.share.classloader">
<or>
<equals arg1="${junit.fork}" arg2="true"/>
<equals arg1="${build.sysclasspath}" arg2="only"/>
</or>
</condition>

<condition property="sun.tools.present">
<and>
<available classname="sun.tools.native2ascii.Main"/>
<available classname="com.sun.tools.javah.Main"/>
</and>
</condition>

<available property="base64.present" classname="sun.misc.BASE64Encoder"/>

<property name="build.tests.resolved" location="${build.tests}"/>
<condition property="tests.are.on.system.classpath">
<or>
<!-- relative paths in CLASSPATH -->
<contains string="${java.class.path}"
substring="${build.tests}"/>
<!-- absolute paths in CLASSPATH -->
<contains string="${java.class.path}"
substring="${build.tests.resolved}"/>
</or>
</condition>

<condition property="jasper.present">
<and>
<available classname="org.apache.jasper.compiler.Compiler"/>
<available classname="org.apache.jasper.JasperException"/>
</and>
</condition>

<condition property="swing.present">
<or>
<not>
<isset property="kaffe"/>
</not>
<available classname="javax.swing.ImageIcon"
classpathref="classpath"/>
</or>
</condition>
<condition property="wsdl.found">
<or>
<available file="wsdl" filepath="${env.PATH}"/>
<available file="wsdl.exe" filepath="${env.PATH}"/>
<available file="wsdl.exe" filepath="${env.Path}"/>
</or>
</condition>
<echo level="verbose"> wsdl.found=${wsdl.found}</echo>
<condition property="csc.found">
<or>
<available file="csc" filepath="${env.PATH}"/>
<available file="csc.exe" filepath="${env.PATH}"/>
<available file="csc.exe" filepath="${env.Path}"/>
</or>
</condition>
<echo level="verbose"> csc.found=${csc.found}</echo>
<condition property="dotnetapps.found">
<and>
<isset property="csc.found"/>
<isset property="wsdl.found"/>
</and>
</condition>
<echo level="verbose"> dotnetapps.found=${dotnetapps.found}</echo>

<available property="rhino.present"
classname="org.mozilla.javascript.Scriptable"
classpathref="classpath"/>
<available property="beanshell.present"
classname="bsh.StringUtil"
classpathref="classpath"/>
<available property="jsch.present"
classname="com.jcraft.jsch.Session"
classpathref="classpath"/>

<path id="xdoclet.classpath">
<path>
<fileset dir="lib" includes="*.jar"/>
</path>
<path>
<fileset dir="${ant.home}/lib" includes="*.jar"/>
</path>
<!-- do not remove this. This is an extension point used by things like Axis
and other projects that autogen their task docs -->
<pathelement path="${xdoclet.extra.classpath}" />
</path>

<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${gen.dir}" />
<mkdir dir="${build.docs.dir}" />
<property name="xdoclet.classpath.asprop"
refid="xdoclet.classpath"/>
<echo level="verbose">
xdoclet.classpath=${xdoclet.classpath}
xdoclet.extra.classpath=${xdoclet.extra.classpath}
</echo>
<!-- <echoproperties/> -->
</target>

<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${gen.dir}"/>
</target>

<target name="declare-tasks" depends="package">
<taskdef name="antdoclet"
classname="org.apache.ant.xdoclet.AntDocletTask">
<classpath>
<path refid="xdoclet.classpath"/>
<pathelement location="${build.dir}/classes"/>
</classpath>
</taskdef>
</target>
<target name="gen" depends="declare-tasks"
description="generate the XML files from the annotated source">
<antdoclet destdir="${gen.dir}"
excludedtags="@version,@author"
force="${xdoclet.force}"
mergedir="${antdoclet.src.dir}">
<fileset dir="${src.root}">
<selector id="conditional-patterns">
<not>
<or>
<selector refid="needs.jdk1.3+" unless="jdk1.3+"/>
<selector refid="needs.jdk1.4+" unless="jdk1.4+"/>
<selector refid="needs.sun.tools" unless="sun.tools.present"/>
<selector refid="needs.sun.uue" unless="sunuue.present"/>
<selector refid="needs.sun.b64" unless="base64.present"/>

<selector refid="needs.trax" unless="trax.present"/>
<selector refid="needs.xalan1" unless="xalan.present"/>
<selector refid="needs.xalan2" unless="xalan2.present"/>
<selector refid="needs.xslp" unless="xslp.present"/>
<selector refid="needs.apache.resolver" unless="apache.resolver.present"/>
<selector refid="needs.junit" unless="junit.present"/>
<selector refid="needs.jakarta.regexp"
unless="jakarta.regexp.present"/>
<selector refid="needs.jakarta.oro" unless="jakarta.oro.present"/>
<selector refid="needs.jakarta.bcel" unless="bcel.present"/>
<selector refid="needs.jakarta.log4j" unless="log4j.present"/>
<selector refid="needs.commons.logging"
unless="commons.logging.present"/>
<selector refid="needs.bsf" unless="bsf.present"/>
<selector refid="needs.stylebook" unless="stylebook.present"/>
<selector refid="needs.javamail" unless="javamail.complete"/>
<selector refid="needs.icontract" unless="icontract.present"/>
<selector refid="needs.netrexx" unless="netrexx.present"/>
<selector refid="needs.weblogic.ejbc" unless="ejb.ejbc.present"/>
<selector refid="needs.weblogic.ddcreator"
unless="ejb.DDCreator.present"/>
<selector refid="needs.weblogic.server" unless="ejb.wls.present"/>
<selector refid="needs.commons.net" unless="commons.net.present"/>
<selector refid="needs.starteam" unless="starteam.present"/>
<selector refid="needs.vaj" unless="vaj.present"/>
<selector refid="needs.antlr" unless="antlr.present"/>
<selector refid="needs.jmf" unless="jmf.present"/>
<selector refid="needs.jai" unless="jai.present"/>
<selector refid="needs.jdepend" unless="jdepend.present"/>
<selector refid="needs.swing" unless="swing.present"/>
<selector refid="needs.jsch" unless="jsch.present"/>
</or>
</not>
</selector>
</fileset>
<taskdescriptor/>
<!-- <taskdefproperties/> -->
</antdoclet>
</target>

<target name="prepare-for-docs">
<copy todir="${build.docs.dir}">
<fileset dir="${basedir}/../../docs" includes="artwork/**" />
</copy>
<mkdir dir="${xdocs.dir}" />
<copy todir="${xdocs.dir}">
<fileset dir="${docs.src}" includes="stylesheets/project.xml" />
</copy>
</target>
<!--inserted for external build files to call -->
<target name="gen-and-prepare-for-docs"
depends="gen,prepare-for-docs" />
<target name="docs" depends="prepare-for-docs" >
<!-- Copy stuff so things are in the correct relative location. -->
<!-- Generate HTML using DVSL -->
<ant dir="dvsl"/>
</target>

<target name="compile" depends="init">
<mkdir dir="${build.dir}/classes"/>
<javac destdir="${build.dir}/classes"
srcdir="${antdoclet.src.dir}"
deprecation="on"
debug="true"
classpathref="xdoclet.classpath"
/>
</target>

<target name="package" depends="compile">
<!-- <jar destfile="${build.dir}/xdoclet-ant.jar">
<fileset dir="${build.dir}/classes"/>
<metainf dir="metadata" includes="xdoclet.xml"/>
<fileset dir="src" includes="**/*.xdt"/>
</jar> -->

<mkdir dir="${build.dir}/classes/META-INF"/>
<copy todir="${build.dir}/classes/META-INF">
<fileset dir="metadata"/>
</copy>
<copy todir="${build.dir}/classes">
<fileset dir="src" includes="**/*.xdt"/>
</copy>
</target>

<target name="indexgen" depends="compile">
<taskdef name="indexgen"
classpath="${build.dir}/classes"
classname="org.apache.ant.xdoclet.IndexGen"
/>
<indexgen rootdir="${build.dir}/docs/manual"/>
</target>

<target name="docs-from-scratch" depends="clean,gen,docs,indexgen"/>

<target name="default" depends="gen"/>

</project>


+ 0
- 16
proposal/xdocs/dvsl/README.txt View File

@@ -1,16 +0,0 @@
This directory contains support for generating HTML task documentation
from the XDoclet generated XML. DVSL
(http://jakarta.apache.org/velocity/dvsl/) is used for this purpose. It has
many of the benefits of XSLT but uses Velocity as its template language.

This is in a subdirectory as it is effectively a sub-proposal demonstrating
one way the task XML can be transformed into HTML.

Directions:
1. Generate the XML task docs by running the build.xml in the parent
directory.
2. Generate the HTML docs by running the build file in this directory.
The output is written to ../build/docs/manual.

-Bill Burton <billb@progress.com>


+ 0
- 45
proposal/xdocs/dvsl/build.xml View File

@@ -1,45 +0,0 @@
<project name="AntManual" default="taskdocs" basedir=".">

<property file="${basedir}/build.properties"/>

<property name="lib.dir" location="${basedir}/lib" />
<property name="build.dir" location="${basedir}/../build" />
<property name="docs.src" location="${basedir}/../../../xdocs" />
<property name="taskdocs.src" location="${build.dir}/gen" />
<property name="stylesheet" location="${docs.src}/stylesheets/project.xml"/>

<!-- The docs destination directory -->
<property name="docs.dest" location="${build.dir}/docs"/>
<property name="manual.dest" location="${docs.dest}/manual" />
<property name="xdocs.dir" location="${basedir}/xdocs"/>
<property name="stylesheet.dir" location="${xdocs.dir}/stylesheets"/>

<!-- Construct compile classpath -->
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>

<target name="init">
<taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
<classpath>
<path refid="classpath"/>
</classpath>
</taskdef>
<!-- Make stuff available relative to current location -->
<mkdir dir="${stylesheet.dir}" />
<copy todir="${stylesheet.dir}" file="${stylesheet}"/>
</target>

<target name="taskdocs" depends="init"
description="Generate Task Documentation">
<dvsl basedir="${taskdocs.src}" destdir="${manual.dest}"
style="task.dvsl" extension=".html"
toolboxfile="toolbox.props"
includes="**/*.xml">
<velconfig name="velocimacro.library" value="" />
</dvsl>
</target>

</project>

BIN
proposal/xdocs/dvsl/lib/dom4j-1.2-jp.jar View File


+ 0
- 19
proposal/xdocs/dvsl/lib/dom4j-README.txt View File

@@ -1,19 +0,0 @@
This is the standard dom4j 1.2 release with a patch applied to jaxen. The
patch fixes a problem where DocumentHelper.createPattern("aaa | bbb") would
fail never matching the element <bbb> because the pattern for "bbb" had been
overwritten by the pattern for "aaa".

--- org/jaxen/pattern/UnionPattern.java.orig Wed Aug 8 17:29:49 2001
+++ org/jaxen/pattern/UnionPattern.java Wed Mar 6 01:39:51 2002
@@ -91,7 +91,7 @@
public Pattern simplify()
{
this.lhs = lhs.simplify();
- this.rhs = lhs.simplify();
+ this.rhs = rhs.simplify();
init();
return this;
}




BIN
proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar View File


BIN
proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar View File


+ 0
- 524
proposal/xdocs/dvsl/task.dvsl View File

@@ -1,524 +0,0 @@
#*
* DVSL Stylesheet to format the Ant Task documentation.
*#

#set( $relative-path = "../../" )
#if (false)
#set( $body-bg = '#ffffff' )
#set( $body-fg = '#000000' )
#set( $body-link = '#525D76' )
##set( $banner-bg = '#EEEEEE')
#set( $banner-fg = '#000000')
#set( $sub-banner-bg = '#828DA6')
#set( $sub-banner-fg = '#ffffff')
##set( $table-th-bg = '#FFEEEE')
##set( $table-td-bg = '#FFEEEE')
##set( $source-color = '#CCFFFF')

#set( $table-th-bg = '#EEEEEE')
#set( $table-td-bg = '#EEEEEE')
#set( $banner-bg = '#a0ddf0')
##set( $banner-bg = '#525D76')
##set( $table-th-bg = '#039acc')
##set( $table-td-bg = '#a0ddf0')
#set( $source-color = '#023264')
#end

#set( $body-bg = '#ffffff' )
#set( $body-fg = '#000000' )
#set( $body-link = '#525D76' )
#set( $banner-bg = '#525D76')
#set( $banner-fg = '#ffffff')
#set( $sub-banner-bg = '#828DA6')
#set( $sub-banner-fg = '#ffffff')
#set( $table-th-bg = '#cccccc')
#set( $table-td-bg = '#eeeeee')
#set( $source-color = '#023264')
#set( $source-font-size = '+0')

## Double quote for convenience
#set ($qq = '"')

## Macro to output argument if test evaluates to true
#macro(ifset $test $output)
#if ( $test )$output#end
#end

## Macro to capitalize a word making the first letter upper case
#macro(capitalize $word)
$word.substring(0,1).toUpperCase()$word.substring(1)
#end


#match( "task" )
#set( $project = $node.selectSingleNode("document('xdocs/stylesheets/project.xml')/project" ) )
#if ($node.name().equals("task"))
#set( $title = "#capitalize($attrib.name) Task" )
#set( $summary = $node.short-description )
#end

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>$title</title>
</head>

<body bgcolor="$body-bg" text="$body-fg" link="$body-link"
alink="$body-link" vlink="$body-link">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>$title</strong></font>
#* *##if( $summary )
<br><font face="arial,helvetica,sanserif">$summary</font>
#* *##end
</td>
<td>
#* *##if( $project.logo )
#set( $alt = $project.logo )
#set( $home = $project.attribute("href") )
#set( $src = $project.logo.attribute( "href" ) )
<!-- PROJECT LOGO -->
<a href="$home">
<img src="${relative-path}$src" align="right" alt="$alt" border="0"/>
</a>
#* *##end
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">
#* *##if ($node.name().equals("task"))
#* Use description from merged XML if available, else javadoc comment *#
#* *##if ($node.external.description)
<!-- Applying task/description -->
#* *#$context.applyTemplates("external/description")
#* *##else
<!-- Applying task/long-description -->
#* *#$context.applyTemplates("long-description")
#* *##end
#* *#$context.applyTemplates("short-description")
#* *#$context.applyTemplates("attribute/description")
#* *#$context.applyTemplates("element/description")
#* *#$context.applyTemplates("structure/attribute-groups")
#* *#$context.applyTemplates("structure/elements")
#* *#$context.applyTemplates("external/section")
#* *##end
</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

<!-- FOOTER SEPARATOR -->
<tr>
<td>
<hr noshade="" size="1"/>
</td>
</tr>

<!-- PAGE FOOTER -->
<tr>
<td>
<div align="center"><font color="$body-link" size="-1"><em>
Copyright &#169; 2000-2005, Apache Software Foundation
</em></font></div>
</td>
</tr>

</table>

</body>
</html>
#end

#*
Macro to format a table heading cell
*#
#macro( th $text )
<td bgcolor="$table-th-bg" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>$text</b></font>
</td>
#end

#*
Macro to format a table body cell
*#
#macro( td $text )
<td bgcolor="$table-td-bg" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">$text</font>
</td>
#end

#*
Macro to format a table body cell that spans multiple rows
*#
#macro( tdmr $text $rows )
<td bgcolor="$table-td-bg" valign="top" align="left" rowspan="$rows">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">$text</font>
</td>
#end


#*
Macro to format a section banner
*#
#macro( section $anchor $name )
<tr><td bgcolor="$banner-bg">
<font color="$banner-fg" face="arial,helvetica.sanserif">
<a name="$anchor">
<strong>$name</strong></a></font>
</td></tr>
#end

#*
Macro to format a subsection banner
*#
#macro( subsection $anchor $name )
<tr><td bgcolor="$sub-banner-bg">
<font color="$sub-banner-fg" face="arial,helvetica.sanserif">
<a name="$anchor">
<strong>$name</strong></a></font>
</td></tr>
#end


#*
Process javadoc long description section
*#
#match( "long-description" )
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

#* *##section("description" "Description")

<tr><td><blockquote>
$node.value().trim()
</blockquote></td></tr>

</table>
<!-- End Description -->
#end

#*
Process javadoc short description section
*#
#match( "short-description" )
<!-- Ignore -->
#end

#*
Process javadoc attribute/description section
*#
#match( "attribute/description" )
<!-- Ignore -->
#end

#*
Process javadoc element/description section
*#
#match( "element/description" )
<!-- Ignore -->
#end


#*
Process external desciption
*#
#match( "external/description" )
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

#* *##section("description" "Description")

<tr><td><blockquote>
#* *#$context.applyTemplates("*")
</blockquote></td></tr>

</table>
<!-- End Description -->
#end

#*
Process top level attributes
*#
#match( "structure/attribute-groups" )
<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
#* *##section("attributes" "Parameters")
<tr><td><blockquote>
<table>
<tr>
#* *##th("Attribute")
#* *##th("Description")
#* *##th("Type")
#* *##th("Requirement")
</tr>
#* *#$context.applyTemplates("*")
</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->
#end

#*
Process attribute group
*#
#match( "structure/attribute-groups/attribute-group" )
<!-- Attribute Group -->
#set ($attributeGroup = $attrib.description)
#set ($numGroups = $node.selectNodes("attribute").size())
#set ($inGroup = true)
#* *#$context.applyTemplates("*")
#end

#*
Process a single attribute
*#
#match( "structure/attribute-groups/attribute-group/attribute" )
<!-- Attribute -->
<tr>
#* *##td($attrib.name)
#* *##td($node.description)
#* *##td($attrib.briefType)
#if ($inGroup)
#* *##tdmr($attributeGroup $numGroups)
#set ($inGroup = false)
#end
</tr>
#end

#*
Process all elements
*#
#match( "elements" )
<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

#* *##section("elements" "Parameters as nested elements")

<tr><td><blockquote>
#* *#$context.applyTemplates("*")
</blockquote></td></tr>

</table>
<!-- End Elements -->
#end

#*
Process a single element
*#
#match( "element" )
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="$sub-banner-bg">
<font color="$sub-banner-fg" face="arial,helvetica.sanserif" size="-1">
<strong>$attrib.name</strong> ($attrib.type)</font>
</td></tr>
<tr><td><blockquote>
$node.description.toString().trim()
#* *#$context.applyTemplates("*")
</blockquote></td></tr>
</table>
<!-- End Element -->
#end

#*
Process attributes within elements
*#
#match( "element/attributes" )
<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td>
<table>
<tr>
#* *##th("Attribute")
#* *##th("Description")
#* *##th("Type")
</tr>
#* *#$context.applyTemplates("*")
</table>
</td></tr>

</table>
<!-- End Attributes -->
#end


#*
* Process a menu for the navigation bar
*#
#match( "menu" )
<tr><td>
<p>
<strong>$attrib.name</strong>
</p>
</td><td>
<ul>
$context.applyTemplates("item")
</ul></td></tr>
#end


#*
* Process a menu item for the navigation bar
*#
#match( "item" )
#if( $attrib.href.endsWith("$outputfilename") && !$attrib.href.startsWith("http"))
<strong>$attrib.name</strong>
#else
#if( $attrib.href.startsWith("http") )
<a href="$attrib.href">$attrib.name</a>
#else
<a href="${relative-path}$attrib.href">$attrib.name</a>
#end
#end
#end

#*
* process a documentation section
*#
#match( "section" )
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="$banner-bg">
<font color="$banner-fg" face="arial,helvetica.sanserif">
#if ( $attrib.anchor )
#set( $anchor = $attrib.anchor )
#else
#set( $anchor = $attrib.name )
#end
<a name="$anchor">
<strong>$attrib.name</strong></a></font>
</td></tr>

<tr><td><blockquote>
$context.applyTemplates("*")
</blockquote></td></tr>

</table>
#end

#match( "subsection" )
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<!-- Subsection heading -->
<tr><td bgcolor="$sub-banner-bg">
<font color="$sub-banner-fg" face="arial,helvetica.sanserif">
#if ( $attrib.anchor )
#set( $anchor = $attrib.anchor )
#else
#set( $anchor = $attrib.name )
#end
<a name="$anchor">
<strong>$attrib.name</strong></a></font>
</td></tr>
<!-- Subsection body -->
<tr><td>
$context.applyTemplates("*")
</td></tr>
</table>
#end

#*
* process a the requirement groups
*#
#match( "requirement-group" )
#if ($regGroup == $attrib.name)
#* *#$attrib.description
#end
#end

#match( "source" )
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
</tr>
<tr>
<td bgcolor="$source-color" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="#ffffff" height="1">
<font size="$source-font-size"><pre>$toolbox.htmlescape.getText( $node.value() )</pre></font>
</td>
<td bgcolor="$source-color" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
</tr>
<tr>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
</tr>
</table>
</div>
#end


#match("table")
<table>
$context.applyTemplates("*")
</table>
#end

#match("tr")
<tr>
$context.applyTemplates("*")
</tr>
#end

#match( "td" )
<td bgcolor="$table-td-bg" #*
*##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
*##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
*#valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
$node.copy( $node.children() )
</font>
</td>
#end

#match( "th" )
<td bgcolor="$table-th-bg" #*
*##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
*##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
*#valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<b>$node.copy( $node.children())</b>
</font>
</td>
#end

#match("*")
$node.copy()
#end


+ 0
- 4
proposal/xdocs/dvsl/toolbox.props View File

@@ -1,4 +0,0 @@
toolbox.contextname = toolbox
toolbox.tool.htmlescape = org.apache.velocity.anakia.Escape



+ 0
- 37
proposal/xdocs/lib/LICENSE.xdoclet.txt View File

@@ -1,37 +0,0 @@


Copyright (c) 2000-2003, XDoclet Team
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

Neither the name of the XDoclet team nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Other Licenses

Licenses of the products XDoclet depends on:

* Jakarta Ant
* Xerces


BIN
proposal/xdocs/lib/commons-collections-2.0.jar View File


BIN
proposal/xdocs/lib/commons-logging.jar View File


BIN
proposal/xdocs/lib/xdoclet-1.2.jar View File


BIN
proposal/xdocs/lib/xdoclet-ejb-module-1.2.jar View File


BIN
proposal/xdocs/lib/xdoclet-web-module-1.2.jar View File


BIN
proposal/xdocs/lib/xdoclet-xdoclet-module-1.2.jar View File


BIN
proposal/xdocs/lib/xjavadoc-1.0.2.jar View File


+ 0
- 33
proposal/xdocs/log4j.properties View File

@@ -1,33 +0,0 @@
log4j.rootCategory=INFO, Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
#log4j.appender.Console.layout.ConversionPattern=%m%n
log4j.appender.Console.layout.ConversionPattern=(%-35c{2} %-4L) %m%n

# Uncomment to debug all
log4j.category.xdoclet=DEBUG

# Uncomment to debug all Ejb Module tasks only
#log4j.category.xdoclet.modules.ejb=DEBUG

# Uncomment to debug the class SubTask only
#log4j.category.xdoclet.SubTask=DEBUG
#log4j.category.xdoclet.TemplateSubTask=DEBUG
#log4j.category.xdoclet.template.TemplateEngine=DEBUG

# Uncomment to debug the execute() method of SubTask only
#log4j.category.xdoclet.SubTask.execute=DEBUG

# Uncomment this line if you want to see stack traces
# Please always do so when you want to report a bug
#log4j.category.xdoclet.DocletTask=DEBUG
#log4j.category.xdoclet.XDocletMain=DEBUG

# Uncomment to debug the ModuleFinder
#log4j.category.xdoclet.loader.ModuleFinder.findModules=DEBUG

# Uncomment to debug the MethodTagsHandler
#log4j.category.xdoclet.tagshandler.MethodTagsHandler=DEBUG

# Uncomment to debug the GenerationManager
#log4j.category.xdoclet.GenerationManager.generation=DEBUG

+ 0
- 23
proposal/xdocs/metadata/xdoclet.xml View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
<!DOCTYPE xdoclet-module PUBLIC "-//XDoclet Team//DTD XDoclet Module 1.0//EN" "http://xdoclet.sourceforge.net/dtd/xdoclet-module_1_0.dtd">
-->

<xdoclet-module>
<taghandler
namespace="Ant"
class="org.apache.ant.xdoclet.TaskTagsHandler"
/>

<subtask
name="taskdescriptor"
implementation-class="org.apache.ant.xdoclet.TaskDescriptorSubTask"
parent-task-class="org.apache.ant.xdoclet.AntDocletTask"
/>
<subtask
name="taskdefproperties"
implementation-class="org.apache.ant.xdoclet.TaskDefPropertiesSubTask"
parent-task-class="org.apache.ant.xdoclet.AntDocletTask"
/>
</xdoclet-module>

+ 0
- 80
proposal/xdocs/src/org/apache/ant/xdoclet/AntDocletTask.java View File

@@ -1,80 +0,0 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/

package org.apache.ant.xdoclet;

import org.apache.tools.ant.BuildException;

import xdoclet.DocletTask;

/**
* @created January 5, 2003
* @ant.element name="antdoclet" display-name="AntDoclet Task"
*/
public class AntDocletTask extends DocletTask
{
public AntDocletTask()
{
// by default, binary classes do not provide their
// methods for performance reasons, but it is needed
// here to climb up and find true tasks.
System.setProperty("xjavadoc.compiledmethods", "true");
}

protected void validateOptions() throws BuildException
{
super.validateOptions();
checkClass("org.apache.tools.ant.IntrospectionHelper");
}
}

+ 0
- 174
proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java View File

@@ -1,174 +0,0 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.ant.xdoclet;

import java.util.Collection;
import java.util.Iterator;
import xjavadoc.XClass;
import xjavadoc.XJavaDoc;
import xjavadoc.XMethod;

import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
import xdoclet.util.TypeConversionUtil;

/**
* @created January 5, 2003
*/
public abstract class AntSubTask extends TemplateSubTask
{

/**
* Checks many factors to determine if the class is indeed an Ant task or not.
*
* @param clazz
* @return
* @todo perhaps make deprecation switch configurable
*/
public final static boolean isAntTask(XClass clazz)
{
if (clazz.isAbstract()) {
return false;
}

// no inner classes (for now - but is this possible? desired?)
if (clazz.isInner()) {
return false;
}

String ignoreValue = clazz.getDoc().getTagAttributeValue("ant.task", "ignore");
boolean ignore = TypeConversionUtil.stringToBoolean(ignoreValue, false);

if (ignore) {
return false;
}

/*
* Tag[] tags = clazz.tags();
* for (int i = 0; i < tags.length; i++) {
* if ("@deprecated".equals(tags[i].name())) {
* return false;
* }
* }
*/
if (hasExecuteMethod(clazz)) {
return true;
}

return false;
}

/**
* Check for class implementing an execute() method. Recursive calls are made to superclasses.
*
* @param clazz
* @return
*/
private static boolean hasExecuteMethod(XClass clazz)
{
if (clazz == null) {
return false;
}

// It ain't a task if we've climbed back to Task itself.
// Also ignore other special Ant classes
if ("org.apache.tools.ant.Task".equals(clazz.getQualifiedName()) ||
"org.apache.tools.ant.Target".equals(clazz.getQualifiedName()) ||
"org.apache.tools.ant.TaskAdapter".equals(clazz.getQualifiedName()) ||
"org.apache.tools.ant.UnknownElement".equals(clazz.getQualifiedName())) {
return false;
}

// need to check that only runtime exceptions are thrown?
Collection methods = clazz.getMethods(true);
Iterator iter = methods.iterator();

while (iter.hasNext()) {
XMethod method = (XMethod) iter.next();

if ("execute".equals(method.getName())) {
if (method.getParameters().size() == 0) {
if (method.getReturnType().getType().getName().equals("void")) {
return true;
}
}
}
}

return false;
}

protected void startProcess() throws XDocletException
{
XJavaDoc xjd = new XJavaDoc();
xjd.setUseNodeParser(false);
xjd.getSourceClasses();

super.startProcess();
}

/**
* Returns true if the class is an Ant task. This causes the task to be processed by the XDoclet template task.
*
* @param clazz
* @return
* @exception XDocletException
*/
protected boolean matchesGenerationRules(XClass clazz) throws XDocletException
{
boolean match = isAntTask(clazz);

return match;
}
}

+ 0
- 144
proposal/xdocs/src/org/apache/ant/xdoclet/IndexGen.java View File

@@ -1,144 +0,0 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/

package org.apache.ant.xdoclet;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.TreeMap;
import java.util.Arrays;
import java.util.Iterator;

/**
* Quick and dirty index.html generator for proposal/xdocs
*
*/
public class IndexGen extends Task {
private File rootDir;

public void setRootDir(File rootDir) {
this.rootDir = rootDir;
}

public void execute() throws BuildException {
TreeMap data = new TreeMap();

String[] categories = rootDir.list();

if (categories == null) {
throw new BuildException("Root directory \"" + rootDir.getPath() + "\" does not exist!", getLocation());
}

StringBuffer sb = new StringBuffer();
sb.append("<html><head><title>xdocs index</title></head>");
sb.append("<body>");

int catCount = 0;
int taskCount = 0;

// grab all categories and tasks
for (int i=0; i < categories.length; i++) {
String category = categories[i];
File catDir = new File(rootDir, category);

if (!catDir.isDirectory()) {
continue;
}

String[] tasks = catDir.list();
Arrays.sort(tasks);

data.put(category, tasks);
}

Iterator iter = data.keySet().iterator();
while (iter.hasNext()) {
catCount++;
String category = (String) iter.next();

sb.append("<h2>" + category + "</h2>");

sb.append("<ul>");

String[] tasks = (String[]) data.get(category);

for (int j=0; j < tasks.length; j++) {
taskCount++;
String task = tasks[j];
sb.append("<li>");
sb.append("<a href=\"" + category + "/" + task + "\">" + task + "</a>");
sb.append("</li>");
}

sb.append("</ul>");
}

sb.append("</body></html>");

FileWriter fw = null;
try {
fw = new FileWriter(new File(rootDir,"index.html"));
fw.write(sb.toString());
fw.close();
} catch (IOException e) {
throw new BuildException(e);
}

log("Index generated: " + catCount + " categories and " + taskCount + " tasks");
}
}

+ 0
- 39
proposal/xdocs/src/org/apache/ant/xdoclet/TaskDefPropertiesSubTask.java View File

@@ -1,39 +0,0 @@
/*
* Copyright 2003, 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.ant.xdoclet;

import xdoclet.TemplateSubTask;

/**
* Generates Ant taskdef properties files, suitable for bulk defining tasks with Ant's &lt;taskdef&gt; task.
*
* @created January 5, 2003
* @ant.element display-name="taskdefproperties" name="taskdefproperties"
* parent="org.apache.ant.xdoclet.AntDocletTask"
* @ant.task ignore="true"
*/
public class TaskDefPropertiesSubTask extends AntSubTask
{
protected static String DEFAULT_TEMPLATE_FILE = "resources/taskdef_properties.xdt";

public TaskDefPropertiesSubTask()
{
setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
setDestinationFile("taskdef.properties");
}
}

+ 0
- 60
proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java View File

@@ -1,60 +0,0 @@
/*
* Copyright 2003, 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.ant.xdoclet;

import java.io.File;

import xdoclet.XDocletException;
import xjavadoc.XClass;

/**
* Generates Ant task descriptors.
*
* @created January 1, 2003
* @ant.element display-name="taskdescriptor" name="taskdescriptor"
* parent="xdoclet.modules.apache.ant.org.apache.ant.xdoclet.AntDocletTask"
* @ant.task ignore="true"
* @xdoclet.merge-file file="{0}.xml" relates-to="{0}.xml" description="Used for code examples. An example merge file
* may be found in Ant's proposal/xdocs/src directory."
*/
public class TaskDescriptorSubTask extends AntSubTask
{
protected static String DEFAULT_TEMPLATE_FILE = "resources/task_xml.xdt";

public TaskDescriptorSubTask()
{
setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
setDestinationFile("{0}.xml");
}

/**
* Custom file naming. Use the task name for the file name rather than the default class name.
*
* @param clazz
* @return
* @exception XDocletException
*/
protected String getGeneratedFileName(XClass clazz) throws XDocletException
{
String dir = TaskTagsHandler.getCategoryName(clazz);
String taskName = TaskTagsHandler.getTaskName(clazz);

return new File(dir, taskName + ".xml").toString();
}

}

+ 0
- 855
proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java View File

@@ -1,855 +0,0 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/

package org.apache.ant.xdoclet;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.apache.tools.ant.IntrospectionHelper;
import org.apache.tools.ant.types.EnumeratedAttribute;
import xjavadoc.XClass;
import xjavadoc.XMethod;
import xjavadoc.XParameter;
import xjavadoc.XTag;
import xdoclet.XDocletException;
import xdoclet.XDocletTagSupport;
import xdoclet.tagshandler.AbstractProgramElementTagsHandler;
import xdoclet.tagshandler.MethodTagsHandler;

/**
* Custom tag handler for XDoclet templates for Ant-specific processing.
*
* @created January 1, 2003
* @xdoclet.taghandler namespace="Ant"
* @todo clean up logic so that all setters are gathered first (even superclass) and sorted along wih
* them
* @todo need to create better logic for finding proper setters
* @todo add ifIsAntTask, among other convenience tags
*/
public class TaskTagsHandler extends XDocletTagSupport
{

/**
* Default category for tasks without a category attribute.
*/
public final static String DEFAULT_CATEGORY = "other";

/**
* Default requirement group for attributes without group.
*/
public final static String DEFAULT_GROUP = "optional";

/**
* Requirement group description for optional attributes.
*/
public final static String DESC_OPTIONAL = "optional";

/**
* Requirement group description for required attributes.
*/
public final static String DESC_REQUIRED = "required";

private static Map attributeDisplayMap = new HashMap();
private static Map elementDisplayMap = new HashMap();

private static String[] fluffPrefixes = {"set a", "set the", "sets a", "sets the"};

static {
attributeDisplayMap.put("java.lang.String", "String");
attributeDisplayMap.put("boolean", "boolean");
attributeDisplayMap.put("org.apache.tools.ant.types.Path", "Path");
attributeDisplayMap.put("org.apache.tools.ant.types.Reference", "Reference");
attributeDisplayMap.put("java.io.File", "File");
attributeDisplayMap.put("java.util.Date", "Date");
attributeDisplayMap.put("java.net.URL", "URL");
attributeDisplayMap.put("java.lang.Long", "long");
attributeDisplayMap.put("java.lang.Integer", "int");
attributeDisplayMap.put("java.lang.Float", "float");
attributeDisplayMap.put("java.lang.Double", "double");

elementDisplayMap.put("org.apache.tools.ant.types.Path", "Path");
elementDisplayMap.put("org.apache.tools.ant.types.FileSet", "Fileset");
elementDisplayMap.put("org.apache.tools.ant.taskdefs.Property", "see &lt;property&gt;");
elementDisplayMap.put("org.apache.tools.ant.types.Mapper", "Mapper");
elementDisplayMap.put("org.apache.tools.ant.types.PatternSet", "Patternset");
elementDisplayMap.put("org.apache.tools.ant.types.FileList", "Filelist");
elementDisplayMap.put("org.apache.tools.ant.types.FilterChain", "FilterChain");
elementDisplayMap.put("org.apache.tools.ant.types.FilterSet", "Filterset");
elementDisplayMap.put("org.apache.tools.ant.types.ZipFileSet", "ZipFileset");
elementDisplayMap.put("org.apache.tools.ant.types.DirSet", "Dirset");
elementDisplayMap.put("org.apache.tools.ant.types.XMLCatalog", "XMLCatalog");
}

/**
* Provides the Ant task name. Order of rules:
*
* @param clazz
* @return Lowercased classname with "Task" suffix removed
*/
public final static String getTaskName(XClass clazz)
{
String tagValue = clazz.getDoc().getTagAttributeValue("ant.task", "name");

if (tagValue == null) {
// use classname, but strip "Task" suffix if there
tagValue = clazz.getName();

if (tagValue.endsWith("Task")) {
tagValue = tagValue.substring(0, tagValue.indexOf("Task"));
}

tagValue = tagValue.toLowerCase();
}
return tagValue;
}

/**
* Provides the Ant category name as the Value of the category attribute.
*
* @param clazz
* @return
*/
public final static String getCategoryName(XClass clazz)
{
String tagValue = clazz.getDoc().getTagAttributeValue("ant.task", "category");

if (tagValue != null) {
tagValue = tagValue.toLowerCase();
}
else {
tagValue = DEFAULT_CATEGORY;
}
return tagValue;
}

/**
* Iterates over all Ant tasks
*
* @param template
* @param attributes
* @exception XDocletException
*/
public void forAllTasks(String template, Properties attributes) throws XDocletException
{
Collection classes = AbstractProgramElementTagsHandler.getAllClasses();
XClass cur_class = null;

Iterator iter = classes.iterator();

while (iter.hasNext()) {
cur_class = (XClass) iter.next();
setCurrentClass(cur_class);

if (AntSubTask.isAntTask(cur_class)) {
generate(template);
}
}
}

/**
* Iterates over all Ant attributes.
*
* @param template XDoclet template
* @param attributes Tag parameters
* @exception XDocletException Oops!
*/
public void forAllAttributesInGroup(String template, Properties attributes) throws XDocletException
{
// throw exception if not an Ant task

XClass cur_class = getCurrentClass();

XMethod[] methods = getAttributeMethods(cur_class);

String group = attributes.getProperty("group", DEFAULT_GROUP);

for (int i = 0; i < methods.length; i++) {
String value = methods[i].getDoc().getTagAttributeValue("ant.attribute", "group");

if ((value != null && value.equals(group)) || (value == null && group.equals(DEFAULT_GROUP))) {
setCurrentMethod(methods[i]);
generate(template);
}
}
}

/**
* Determines if there's at least one Ant attribute.
*
* @param template XDoclet template
* @param attributes Tag parameters
* @exception XDocletException Oops!
*/
public void ifHasAttributes(String template, Properties attributes) throws XDocletException
{
// throw exception if not an Ant task

XClass cur_class = getCurrentClass();

XMethod[] methods = getAttributeMethods(cur_class);

if (methods.length > 0) {
generate(template);
}
}

/**
* Iterates over all Ant nested element methods (addXXX, addConfiguredXXX, addXXX)
*
* @param template XDoclet template
* @param attributes Tag parameters
* @exception XDocletException Oops!
*/
public void forAllElements(String template, Properties attributes) throws XDocletException
{
// throw exception if not an Ant task

XClass cur_class = getCurrentClass();

XMethod[] methods = getElementMethods(cur_class);

for (int i = 0; i < methods.length; i++) {
setCurrentMethod(methods[i]);
generate(template);
}
}

/**
* Iterates over all ant.attribute.group tags.
*
* @param template XDoclet template
* @param attributes Tag parameters
* @throws XDocletException Oops!
*/
public void forAllAttributeGroups(String template, Properties attributes) throws XDocletException
{
Collection tags = getCurrentClass().getDoc().getTags("ant.attribute.group");

for (Iterator t = tags.iterator(); t.hasNext(); ) {
setCurrentClassTag((XTag) t.next());

generate(template);
}
}

/**
* Provides the name of a requirement group.
*
* @return The description of the group, or 'optional' if not is defined
* @throws XDocletException
*/
public String attributeGroupName() throws XDocletException
{
XTag tag = getCurrentClassTag();
String name = tag.getAttributeValue("name");

return name != null ? name : DEFAULT_GROUP;
}

/**
* Provides the description for a requirement group.
*
* @return The description of the group, or 'Optional' if not is defined
* @throws XDocletException
*/
public String attributeGroupDesc() throws XDocletException
{
XTag tag = getCurrentClassTag();
String desc = tag.getAttributeValue("description");

return desc != null ? desc : DESC_OPTIONAL;
}

/**
* Provides the element name for the current method
*
* @return
* @exception XDocletException
*/
public String elementName() throws XDocletException
{
String methodName = getCurrentMethod().getName();
String elementName = "<not a valid element>";

if (methodName.startsWith("addConfigured")) {
elementName = methodName.substring(13, methodName.length());
}
else if (methodName.startsWith("add")) {
elementName = methodName.substring(3, methodName.length());
}
else if (methodName.startsWith("create")) {
elementName = methodName.substring(6, methodName.length());
}
return elementName.toLowerCase();
}

public String displayAttributeType() throws XDocletException
{
Collection parameters = getCurrentMethod().getParameters();
XParameter param = (XParameter) parameters.iterator().next();

String methodType = param.getType().getQualifiedName();
String display = (String) attributeDisplayMap.get(methodType);

if (display == null) {

// System.out.println("type = " + methodType);

Class clazz = getAttributeClass(methodType);

if (clazz == null) {
return methodType;
}

Object instance = null;

try {
instance = clazz.newInstance();
}
catch (InstantiationException e) {
}
catch (IllegalAccessException e) {
}

if (instance != null && instance instanceof EnumeratedAttribute) {
EnumeratedAttribute enum1 = (EnumeratedAttribute) instance;
String[] values = enum1.getValues();

display = "";
for (int i = 0; i < values.length; i++) {
display += "&quot;" + values[i] + "&quot;";
if (i != (values.length - 1)) {
display += ", ";
}
}
return display;
}

display = "";
}
return display;
}

public String displayElementType() throws XDocletException
{
String elementType = elementType();
String display = (String) elementDisplayMap.get(elementType);

if (display == null) {
display = "";
}
return display;
}

/**
* Provides the element type for the current method
*
* @return
* @exception XDocletException
*/
public String elementType() throws XDocletException
{
XClass clazz = elementClassDoc();

if (clazz == null) {
throw new XDocletException("Method is not an Ant element!");
}
return clazz.getQualifiedName();
}

/**
* Provides the Ant task name.
*
* @return
* @exception XDocletException
* @see #getTaskName(xjavadoc.XClass)
*/
public String taskName() throws XDocletException
{
return getTaskName(getCurrentClass());
}

public String propertyName()
{
return MethodTagsHandler.getPropertyNameFor(getCurrentMethod()).toLowerCase();
}

public String shortMethodDescription() throws XDocletException
{
String desc = getCurrentMethod().getDoc().getFirstSentence();

if (desc == null || desc.length() == 0) {
desc = "no description";
}

desc = desc.trim();

String descLower = desc.toLowerCase();

for (int i = 0; i < fluffPrefixes.length; i++) {
String prefix = fluffPrefixes[i].toLowerCase() + " ";

if (descLower.startsWith(prefix)) {
desc = desc.substring(prefix.length());
break;
}
}

desc = desc.substring(0, 1).toUpperCase() + desc.substring(1);

if (!desc.endsWith(".")) {
desc += ".";
}

return desc;
}

/**
* Provides the Ant category name.
*
* @return
* @exception XDocletException
* @see #getCategoryName(xjavadoc.XClass)
*/
public String categoryName() throws XDocletException
{
return getCategoryName(getCurrentClass());
}

/**
* Provides the requirment group for the current method
*
* @return The group listed in the source, or 'optional' of none is listed
* @throws XDocletException oops
*/
public String attributeGroup() throws XDocletException
{
String value = getCurrentMethod().getDoc().getTagAttributeValue("ant.attribute", "group");

return value != null ? value : DEFAULT_GROUP;
}

private Class getAttributeClass(String type) throws XDocletException
{
// System.out.println("type = " + type);

Class clazz = null;

try {
clazz = Class.forName(type);
}
catch (ClassNotFoundException e) {
int lastDotPosition = type.lastIndexOf('.');

if (lastDotPosition < 0) {
// probably a primitive
return null;
}
type = type.substring(0, lastDotPosition) + "$" + type.substring(lastDotPosition + 1);
try {
clazz = Class.forName(type);
}
catch (ClassNotFoundException e1) {
throw new XDocletException(e1.getMessage());
}
}
return clazz;
}


/**
* @param cur_class
* @return
* @exception XDocletException
* @todo refactor to cache methods per class, and save some time
*/
private XMethod[] getAttributeMethods(XClass cur_class) throws XDocletException
{
// Use Ant's own introspection mechanism to gather the
// attributes this class supports
IntrospectionHelper is = null;

try {
is = IntrospectionHelper.getHelper(Class.forName(cur_class.getQualifiedName()));
}
catch (ClassNotFoundException e) {
throw new XDocletException(e, e.getMessage());
}

// Regroup the attributes, since IntrospectionHelper
// doesn't give us the whole data structure directly
Enumeration enum2 = is.getAttributes();
Properties attributeTypeMap = new Properties();

while (enum2.hasMoreElements()) {
String name = (String) enum2.nextElement();
Class type = is.getAttributeType(name);

attributeTypeMap.setProperty(name, type.getName());
// System.out.println(name + " = " + type.getName());
}

// We need to return XMethod[] from this method
// so get all methods from the current class
XMethod[] allMethods = getMethods(cur_class);

// System.out.println("allMethods = " + allMethods.length);

// And now filter the methods based
// on what IntrospectionHelper says
List attributeMethods = new ArrayList();

for (int i = 0; i < allMethods.length; i++) {
XMethod method = allMethods[i];
String methodName = method.getName();

// System.out.println("methodName = " + methodName);

if (!methodName.startsWith("set")) {
continue;
}

String attributeName = methodName.substring(3).toLowerCase();

// System.out.println("attributeName = " + attributeName);

if ((method.getParameters().size() != 1) || (!method.isPublic())) {
continue;
}

Iterator it = method.getParameters().iterator();
String attributeType = ((XParameter) it.next()).getType().getQualifiedName();

// System.out.println("attributeType = " + attributeType);

String mapAttribute = attributeTypeMap.getProperty(attributeName);

if (mapAttribute == null) {
continue;
}

// inner classes are noted with $ in our map, but not
// n the parameter type name.
if (!attributeType.equals(mapAttribute.replace('$', '.'))) {
continue;
}

// System.out.println(methodName + " : " + attributeName + " : " + attributeType);

attributeMethods.add(method);
}

return (XMethod[]) attributeMethods.toArray(new XMethod[attributeMethods.size()]);
}

/**
* @param cur_class
* @return
* @exception XDocletException
* @todo add checks for number parameters and appropriate return value check for proper
* exception too? method prefixes: add, create, addConfigured (but not addText)
* @todo add DynamicConfigurator (this should be noted in the template, not dealt with here)
*/
private XMethod[] getElementMethods(XClass cur_class) throws XDocletException
{
// Use Ant's own introspection mechanism to gather the
// elements this class supports
IntrospectionHelper is = null;

try {
is = IntrospectionHelper.getHelper(Class.forName(cur_class.getQualifiedName()));
}
catch (ClassNotFoundException e) {
throw new XDocletException(e.getMessage());
}

// Regroup the elements, since IntrospectionHelper
// doesn't give us the whole data structure directly
Enumeration enum3 = is.getNestedElements();
Properties elementTypeMap = new Properties();

while (enum3.hasMoreElements()) {
String name = (String) enum3.nextElement();
Class type = is.getElementType(name);

elementTypeMap.setProperty(name, type.getName());
// System.out.println(name + " = " + type.getName());
}

// We need to return MethodDoc[] from this method
// so get all methods from the current class
XMethod[] allMethods = getMethods(cur_class);

// And now filter the MethodDoc's based
// on what IntrospectionHelper says
List elementMethods = new ArrayList();

for (int i = 0; i < allMethods.length; i++) {
XMethod method = allMethods[i];
String methodName = method.getName();

// Object create(), void add(Object), void addConfigured(Object)
String elementName = null;

// true if addXXX or addConfiguredXXX
boolean adder = false;

if (methodName.startsWith("create")) {
elementName = methodName.substring(6).toLowerCase();
}

if (methodName.startsWith("add")) {
int length = 3;

if (methodName.startsWith("addConfigured")) {
length = 13;
}

elementName = methodName.substring(length).toLowerCase();
adder = true;
}

if (elementName == null) {
continue;
}

// System.out.println("elementName = " + elementName);

String elementType = null;

if (adder) {
if (method.getParameters().size() != 1) {
continue;
}
Iterator it = method.getParameters().iterator();
elementType = ((XParameter) it.next()).getType().getQualifiedName();
}
else {
elementType = method.getReturnType().getType().getQualifiedName();
}

if (!method.isPublic()) {
continue;
}

String mapElementType = elementTypeMap.getProperty(elementName);

// System.out.println("elementType = " + elementType + " mapElementType = " + mapElementType);
if (mapElementType == null) {
continue;
}

// inner classes are noted with $ in our map, but not
// the parameter type name.
if (!elementType.equals(mapElementType.replace('$', '.'))) {
continue;
}

elementMethods.add(method);
}

return (XMethod[]) elementMethods.toArray(new XMethod[elementMethods.size()]);
}

/**
* This is a slightly refactored (thank you IntelliJ) version of some cut-and-paste from XDoclet code. It sorts all
* methods together rather than in batches of superclasses like XDoclet stuff does.
*
* @param cur_class
* @return
*/
private XMethod[] getMethods(XClass cur_class)
{
Map already = new HashMap();

List methods = new ArrayList();

while (cur_class != null) {
// hardcoded to stop when it hits Task, nothing there
// or above that needs to be processed
if (cur_class.getQualifiedName().equals("org.apache.tools.ant.Task") ||
cur_class.getQualifiedName().equals("org.apache.tools.ant.taskdefs.MatchingTask")) {
break;
}

Collection curMethods = cur_class.getMethods();

Iterator iter = curMethods.iterator();

while (iter.hasNext()) {
XMethod method = (XMethod) iter.next();

if (isDeprecated(method)) {
continue;
}
if (shouldIgnore(method)) {
continue;
}

String methodName = method.getName();

// System.out.println("method = " + method + ":" + methodName);

if (method.getContainingClass() == cur_class) {
if (already.containsKey(methodName) == false) {
already.put(methodName, method);
methods.add(method);
}
}
}

cur_class = cur_class.getSuperclass();
}

return sortMethods(methods);
}

private boolean isDeprecated(XMethod method)
{
Collection tags = method.getDoc().getTags();
Iterator iter = tags.iterator();

while (iter.hasNext()) {
XTag tag = (XTag) iter.next();

if (tag.getName().equals("@deprecated")) {
return true;
}
}
return false;
}

/**
* Provides the element type for the current method. If the return type is null, the first parameter is used.
*
* @return
*/
private XClass elementClassDoc()
{
XClass clazz = null;
String methodName = getCurrentMethod().getName();

if (methodName.startsWith("addConfigured") ||
methodName.startsWith("add") ||
methodName.startsWith("create")) {
clazz = getCurrentMethod().getReturnType().getType();
if ("void".equals(clazz.getName())) {
Collection params = getCurrentMethod().getParameters();

if (params.size() == 1) {
Iterator it = params.iterator();
clazz = ((XParameter)it.next()).getType();
}
}
}
// System.out.println(methodName + ": clazz = " + clazz.getQualifiedName());
return clazz;
}

/**
* For now, lump attributes and elements together since we won't have those tags on the same method.
*
* @param method
* @return True if the method should be ignored.
*/
private boolean shouldIgnore(XMethod method)
{
String value = method.getDoc().getTagAttributeValue("ant.attribute", "ignore");

if ("true".equals(value)) {
return true;
}

value = method.getDoc().getTagAttributeValue("ant.element", "ignore");
if ("true".equals(value)) {
return true;
}
return false;
}

private XMethod[] sortMethods(List methods)
{
//sort methods
Collections.sort(methods,
new Comparator()
{
public int compare(Object o1, Object o2)
{
XMethod m1 = (XMethod) o1;
XMethod m2 = (XMethod) o2;

return m1.getName().compareTo(m2.getName());
}


public boolean equals(Object obj)
{
//dumb
return obj == this;
}
});

return (XMethod[]) methods.toArray(new XMethod[methods.size()]);
}
}


+ 0
- 92
proposal/xdocs/src/org/apache/ant/xdoclet/resources/task_xml.xdt View File

@@ -1,92 +0,0 @@
<task name="<XDtAnt:taskName/>" category="<XDtAnt:categoryName/>"
classname="<XDtClass:fullClassName/>"
<XDtClass:ifHasClassTag tagName="deprecated">deprecated="true"</XDtClass:ifHasClassTag>
<XDtType:ifIsOfType type="org.apache.tools.ant.taskdefs.MatchingTask">matchingTask="true"</XDtType:ifIsOfType>>

<XDtMerge:merge file="{0}.xml" generateMergedFile="false">
<!-- no merge file present -->
</XDtMerge:merge>

<short-description><![CDATA[<XDtClass:firstSentenceDescription/>]]></short-description>
<long-description>
<![CDATA[<XDtClass:classComment no-comment-signs="true"/>]]>
</long-description>

<structure>

<attribute-groups>

<attribute-group name="required"
description="Required">
<XDtAnt:forAllAttributesInGroup group="required">
<attribute name="<XDtAnt:propertyName/>"
type="<XDtParameter:forAllMethodParams><XDtParameter:methodParamType/></XDtParameter:forAllMethodParams>"
<XDtMethod:ifHasMethodTag tagName="deprecated">deprecated="true"</XDtMethod:ifHasMethodTag>
briefType="<XDtAnt:displayAttributeType/>">
<short-description><![CDATA[<XDtAnt:shortMethodDescription/>]]></short-description>
<description><![CDATA[<XDtMethod:methodComment no-comment-signs="true"/>]]></description>
</attribute>
</XDtAnt:forAllAttributesInGroup>
</attribute-group>

<XDtAnt:forAllAttributeGroups>
<attribute-group name="<XDtAnt:attributeGroupName/>"
description="<XDtAnt:attributeGroupDesc/>">
<XDtAnt:forAllAttributesInGroup group="<XDtAnt:attributeGroupName/>">
<attribute name="<XDtAnt:propertyName/>"
type="<XDtParameter:forAllMethodParams><XDtParameter:methodParamType/></XDtParameter:forAllMethodParams>"
<XDtMethod:ifHasMethodTag tagName="deprecated">deprecated="true"</XDtMethod:ifHasMethodTag>
briefType="<XDtAnt:displayAttributeType/>">
<short-description><![CDATA[<XDtAnt:shortMethodDescription/>]]></short-description>
<description><![CDATA[<XDtMethod:methodComment no-comment-signs="true"/>]]></description>
</attribute>
</XDtAnt:forAllAttributesInGroup>
</attribute-group>
</XDtAnt:forAllAttributeGroups>

<attribute-group name="optional"
description="Optional">
<XDtAnt:forAllAttributesInGroup group="optional">
<attribute name="<XDtAnt:propertyName/>"
type="<XDtParameter:forAllMethodParams><XDtParameter:methodParamType/></XDtParameter:forAllMethodParams>"
<XDtMethod:ifHasMethodTag tagName="deprecated">deprecated="true"</XDtMethod:ifHasMethodTag>
briefType="<XDtAnt:displayAttributeType/>">
<short-description><![CDATA[<XDtAnt:shortMethodDescription/>]]></short-description>
<description><![CDATA[<XDtMethod:methodComment no-comment-signs="true"/>]]></description>
</attribute>
</XDtAnt:forAllAttributesInGroup>
</attribute-group>

</attribute-groups>

<elements>

<XDtAnt:forAllElements>
<element name="<XDtAnt:elementName/>" type="<XDtAnt:elementType/>"
<XDtMethod:ifHasMethodTag tagName="deprecated">deprecated="true"</XDtMethod:ifHasMethodTag>
briefType="<XDtAnt:displayElementType/>"
<XDtClass:pushClass value="<XDtAnt:elementType/>">
<XDtClass:ifIsClassAbstract>abstract="true"</XDtClass:ifIsClassAbstract>>
</XDtClass:pushClass>
<short-description><![CDATA[<XDtAnt:shortMethodDescription/>]]></short-description>
<description>
<![CDATA[<XDtMethod:methodComment no-comment-signs="true"/>]]>
</description>
</element>
</XDtAnt:forAllElements>

</elements>

<XDtMethod:setCurrentMethod name="addText" parameters="java.lang.String">
<body <XDtMethod:ifHasMethodTag tagName="deprecated">deprecated="true"</XDtMethod:ifHasMethodTag>>
<description><![CDATA[
<XDtMethod:methodComment no-comment-signs="true"/>
]]></description>
</body>
</XDtMethod:setCurrentMethod>

</structure>

</task>



+ 0
- 2
proposal/xdocs/src/org/apache/ant/xdoclet/resources/taskdef_properties.xdt View File

@@ -1,2 +0,0 @@
<XDtAnt:forAllTasks><XDtAnt:taskName/>=<XDtClass:fullClassName/>
</XDtAnt:forAllTasks>

+ 0
- 54
proposal/xdocs/src/org/apache/tools/ant/taskdefs/ConditionTask.xml View File

@@ -1,54 +0,0 @@
<!-- Condition task -->
<external>
<description>

<p>Sets a property if a certain condition holds true - this is a
generalization of <a href="available.html">Available</a> and <a
href="uptodate.html">Uptodate</a>.</p>
<p>If the condition holds true, the property value is set to true by
default; otherwise, the property is not set. You can set the value to
something other than the default by specifying the <code>value</code>
attribute.</p>
<p>Conditions are specified as <a href="#nested">nested elements</a>,
you must specify exactly one condition.</p>

</description>

<section anchor="examples" name="Examples">

<pre>
&lt;condition property=&quot;javamail.complete&quot;&gt;
&lt;and&gt;
&lt;available classname=&quot;javax.activation.DataHandler&quot; /&gt;
&lt;available classname=&quot;javax.mail.Transport&quot; /&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>javamail.complete</code> if both the
JavaBeans Activation Framework and JavaMail are available in the
classpath.</p>

<pre>
&lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
&lt;and&gt;
&lt;os family=&quot;mac&quot; />
&lt;not&gt;
&lt;os family=&quot;unix&quot; />
&lt;/not&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>isMacOsButNotMacOsX</code> if the current
operating system is MacOS, but not MacOS X - which Ant considers to be
in the Unix family as well.</p>

<pre>
&lt;condition property=&quot;isSunOSonSparc&quot;&gt;
&lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot; />
&lt;/condition&gt;
</pre>
<p>sets the property <code>isSunOSonSparc</code> if the current
operating system is SunOS and if it is running on a sparc architecture.</p>

</section>
</external>

+ 0
- 195
proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javac.xml View File

@@ -1,195 +0,0 @@
<!-- javac task -->
<external>
<description>

<p>Compiles a Java source tree.</p>

<p>The source and destination directory will be recursively scanned for Java
source files to compile. Only Java files that have no corresponding class file
or where the class file is older than the java file will be compiled.</p>

<p>Note: Ant uses only the names of the source and class files to find
the classes that need a rebuild. It will not scan the source and therefor
will have no knowledge about nested classes, classes that are named different
from the source file and so on.</p>

<p>The directory structure of the source tree should follow the package
hierarchy.</p>

<p>It is possible to refine the set of files that are being compiled/copied.
This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
the files you want to have excluded. This is also done with patterns. And
finally with the <i>defaultexcludes</i> attribute, you can specify whether you
want to use default exclusions or not. See the section on <a
href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
inclusion/exclusion of files works, and how to write patterns.</p>

<p>It is possible to use different compilers. This can be selected with the
&quot;build.compiler&quot; property or the compiler attribute. Here are the choices:-</p>
<ul>
<li>classic (the standard compiler of JDK 1.1/1.2) - javac1.1 and
javac1.2 can be used as aliases</li>
<li>modern (the standard compiler of JDK 1.3/1.4) - javac1.3 and
javac1.4 can be used as aliases</li>
<li>jikes (the <a
href="http://oss.software.ibm.com/developerworks/opensource/jikes/project" target="_top">Jikes</a>
compiler)</li>
<li>jvc (the Command-Line Compiler from Microsoft's SDK for Java /
Visual J++) - microsoft can be used as an alias</li>
<li>kjc (the <a href="http://www.dms.at/kopi/" target="_top">kopi</a>
compiler)</li>
<li>gcj (the gcj compiler from gcc)</li>
<li>sj (Symantec java compiler) - symantec can be used as an alias</li>
<li>extJavac (run either modern or classic in a JVM of its own)</li>
</ul>
<p>For JDK 1.1/1.2, classic is the default. For JDK 1.3/1.4, modern is the default.
If you wish to use a different compiler interface than those
supplied, write a class that implements the CompilerAdapter interface
(package org.apache.tools.ant.taskdefs.compilers). Supply the full
classname in the &quot;build.compiler&quot; property.</p>

<p>The fork attribute overrides the build.compiler setting and expects
a JDK1.1 or higher to be set in java.home.</p>

<p>This task will drop all entries that point to non-existent
files/directories from the CLASSPATH it passes to the compiler.</p>

<p><strong>Windows Note:</strong>When the modern compiler is used
in unforked mode on Windows, it locks up the files present in the
classpath of the &lt;javac&gt; task, and does not release them. The side
effect of this is that you will not be able to delete or move
those files later on in the build. The workaround is to fork when
invoking the compiler.</p>

</description>

<section anchor="examples" name="Examples">
<pre> &lt;javac srcdir=&quot;${src}&quot;
destdir=&quot;${build}&quot;
classpath=&quot;xyz.jar&quot;
debug=&quot;on&quot;
/&gt;</pre>
<p>compiles all <code>.java</code> files under the <code>${src}</code>
directory, and stores
the <code>.class</code> files in the <code>${build}</code> directory.
The classpath used contains <code>xyz.jar</code>, and debug information is on.</p>

<pre> &lt;javac srcdir=&quot;${src}&quot;
destdir=&quot;${build}&quot;
fork=&quot;true&quot;
/&gt;</pre>
<p>compiles all <code>.java</code> files under the <code>${src}</code>
directory, and stores the <code>.class</code> files in the
<code>${build}</code> directory. This will fork off the javac
compiler using the default javac executable.</p>

<pre> &lt;javac srcdir=&quot;${src}&quot;
destdir=&quot;${build}&quot;
fork=&quot;java$$javac.exe&quot;
/&gt;</pre>
<p>compiles all <code>.java</code> files under the <code>${src}</code>
directory, and stores the <code>.class</code> files in the
<code>${build}</code> directory. This will fork off the javac
compiler using the executable named <code>java$javac.exe</code>. Note
that the <code>$</code> sign needs to be escaped by a second one.</p>

<pre> &lt;javac srcdir=&quot;${src}&quot;
destdir=&quot;${build}&quot;
includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
excludes=&quot;mypackage/p1/testpackage/**&quot;
classpath=&quot;xyz.jar&quot;
debug=&quot;on&quot;
/&gt;</pre>
<p>compiles <code>.java</code> files under the <code>${src}</code>
directory, and stores the
<code>.class</code> files in the <code>${build}</code> directory.
The classpath used contains <code>xyz.jar</code>, and debug information is on.
Only files under <code>mypackage/p1</code> and <code>mypackage/p2</code> are
used. Files in the <code>mypackage/p1/testpackage</code> directory are excluded
from compilation.</p>

<pre> &lt;javac srcdir=&quot;${src}:${src2}&quot;
destdir=&quot;${build}&quot;
includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
excludes=&quot;mypackage/p1/testpackage/**&quot;
classpath=&quot;xyz.jar&quot;
debug=&quot;on&quot;
/&gt;</pre>

<p>is the same as the previous example, with the addition of a second
source path, defined by
the property <code>src2</code>. This can also be represented using nested
<code>&lt;src&gt;</code> elements as follows:</p>

<pre> &lt;javac destdir=&quot;${build}&quot;
classpath=&quot;xyz.jar&quot;
debug=&quot;on&quot;&gt;
&lt;src path=&quot;${src}&quot;/&gt;
&lt;src path=&quot;${src2}&quot;/&gt;
&lt;include name=&quot;mypackage/p1/**&quot;/&gt;
&lt;include name=&quot;mypackage/p2/**&quot;/&gt;
&lt;exclude name=&quot;mypackage/p1/testpackage/**&quot;/&gt;
&lt;/javac&gt;</pre>

<p><b>Note:</b> If you are using Ant on Windows and a new DOS window pops up
for every use of an external compiler, this may be a problem of the JDK you are using.
This problem may occur with all JDKs &lt; 1.2.</p>

<p><b>Note:</b> If you wish to compile only source-files located in some packages below a
common root you should not include these packages in the srcdir-attribute. Use include/exclude-attributes
or elements to filter for these packages. If you include part of your package-structure inside the srcdir-attribute
(or nested src-elements) Ant will start to recompile your sources every time you call it.</p>

</section>

<section anchor="jikes" name="Jikes Notes">

<p>Jikes supports some extra options, which can be set be defining
properties prior to invoking the task. The ant developers are aware that
this is ugly and inflexible -expect a better solution in the future. All
the options are boolean, and must be set to &quot;true&quot; or &quot;yes&quot; to be
interpreted as anything other than false; by default
build.compiler.warnings is &quot;true&quot; while all others are &quot;false&quot;</p>

<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top">
build.compiler.emacs
</td>
<td valign="top">
Enable emacs compatible error messages
</td>
</tr>
<tr>
<td valign="top">
build.compiler.warnings<br />
<b>This property has been deprecated, use the nowarn attribute
instead</b>
</td>
<td valign="top">
don't disable warning messages
</td>
</tr>
<tr>
<td valign="top">
build.compiler.pedantic
</td>
<td valign="top">
enable pedantic warnings
</td>
</tr>
<tr>
<td valign="top">
build.compiler.fulldepend
</td>
<td valign="top">
enable full dependency checking,<br />
&quot;+F&quot; in the jikes manual.
</td>
</tr>
</table>

</section>
</external>

+ 0
- 59
proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javadoc.xml View File

@@ -1,59 +0,0 @@
<!-- javadoc task -->
<external>
<description>

<p>Generates code documentation using the javadoc tool.</p>

<p>The source directory will be recursively scanned for Java source files to process
but only those matching the inclusion rules, and not matching the exclusions rules
will be passed to the javadoc tool. This
allows wildcards to be used to choose between package names, reducing verbosity
and management costs over time. This task, however, has no notion of
&quot;changed&quot; files, unlike the <a href="javac.html">javac</a> task. This means
all packages will be processed each time this task is run. In general, however,
this task is used much less frequently.</p>

<p>This task works seamlessly between different javadoc versions (1.1 and 1.2),
with the obvious restriction that the 1.2 attributes will be ignored if run in a
1.1 VM.</p>

<p>NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the
same VM as ant without breaking functionality. For this reason, this task
always forks the VM. This overhead is not significant since javadoc is normally a heavy
application and will be called infrequently.</p>

<p>NOTE: the packagelist attribute allows you to specify the list of packages to
document outside of the Ant file. It's a much better practice to include everything
inside the build.xml file. This option was added in order to make it easier to
migrate from regular makefiles, where you would use this option of javadoc.
The packages listed in packagelist are not checked, so the task performs even
if some packages are missing or broken. Use this option if you wish to convert from
an existing makefile. Once things are running you should then switch to the regular
notation. </p>

<p><i><b>DEPRECATION:</b> the javadoc2 task simply points to the javadoc task and it's
there for back compatibility reasons. Since this task will be removed in future
versions, you are strongly encouraged to use <a href="javadoc.html">javadoc</a>
instead.</i></p>
</description>

<section anchor="examples" name="Example">
<pre> &lt;javadoc packagenames=&quot;com.dummy.test.*&quot;
sourcepath=&quot;src&quot;
excludepackagenames=&quot;com.dummy.test.doc-files.*&quot;
defaultexcludes=&quot;yes&quot;
destdir=&quot;docs/api&quot;
author=&quot;true&quot;
version=&quot;true&quot;
use=&quot;true&quot;
windowtitle=&quot;Test API&quot;&gt;
&lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
&lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
&lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot; /&gt;
&lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
&lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
&lt;link offline=&quot;true&quot; href=&quot;http://java.sun.com/products/jdk/1.2/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
&lt;link href=&quot;http://developer.java.sun.com/developer/products/xml/docs/api/&quot;/&gt;
&lt;/javadoc&gt;</pre>
</section>
</external>

+ 0
- 65
proposal/xdocs/src/org/apache/tools/ant/taskdefs/Property.xml View File

@@ -1,65 +0,0 @@
<!-- property task -->
<external>
<description>

<p>Sets a property (by name and value), or set of properties (from file or resource) in the project.</p>

<p>Properties are case sensitive.</p>

<p>Properties are immutable: whoever sets a property first freezes it for the rest of the build; they are most definately not variable.</p>

<p>There are five ways to set properties:
<ul>
<li>By supplying both the name and value attribute.</li>
<li>By supplying both the name and refid attribute.</li>
<li>By setting the file attribute with the filename of the property file to load. This property file has the format as defined by the file used in the class java.util.Properties.</li>
<li>By setting the resource attribute with the resource name of the property file to load. This property file has the format as defined by the file used in the class java.util.Properties.</li>
<li>By setting the environment attribute with a prefix to use. Properties will be defined for every environment variable by prefixing the supplied name and a period to the name of the variable.</li>
</ul>
</p>
<p>Although combinations of these ways are possible, only one should be used at a time. Problems might occur with the order in which properties are set, for instance.</p>

<p>The value part of the properties being set, might contain references to other properties. These references are resolved at the time these properties are set. This also holds for properties loaded from a property file.</p>

<p>A list of predefined properties can be found here.</p>

</description>

<section anchor="examples" name="Examples">
<source><![CDATA[
<property name="foo.dist" value="dist"/>
]]></source>
<p>sets the property <code>foo.dist</code> to the value &quot;dist&quot;.</p>
<source><![CDATA[
<property file="foo.properties"/>
]]></source>
<p>reads a set of properties from a file called &quot;foo.properties&quot;.</p>
<source><![CDATA[
<property resource="foo.properties"/>
]]></source>
<p>reads a set of properties from a resource called &quot;foo.properties&quot;.</p>
<p>Note that you can reference a global properties file for all of your Ant
builds using the following:</p>
<source><![CDATA[
<property file="${user.home}/.ant-global.properties"/>
]]></source>
<p>since the &quot;user.home&quot; property is defined by the Java virtual machine
to be your home directory. Where the &quot;user.home&quot; property resolves to in
the file system depends on the operating system version and the JVM implementation.
On Unix based systems, this will map to the user's home directory. On modern Windows
variants, this will most likely resolve to the user's directory in the &quot;Documents
and Settings&quot; folder. Older windows variants such as Windows 98/ME are less
predictable, as are other operating system/JVM combinations.</p>

<source><![CDATA[
<property environment="env">
<echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}">
<echo message="ANT_HOME is set to = ${env.ANT_HOME}">
]]></source>
<p>reads the system environment variables and stores them in properties, prefixed with &quot;env&quot;.
Note that this only works on <em>select</em> operating systems.
Two of the values are shown being echoed.
</p>

</section>
</external>

+ 0
- 129
proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml View File

@@ -1,129 +0,0 @@
<external>
<description>
<p>
Calls a given target for all defined sub-builds.
This is an extension
of ant for bulk project execution.

<strong>This task must no be used outside of a
<code>target</code> if it invokes the same build file it is
part of.</strong>
</p>
<subsection name="Use with directories">
<p>
subant can be used with directory sets to execute a build from different directories.
2 different options are offered :
</p>
<ul>
<li>
to run the same build file <code>/somepath/otherpath/mybuild.xml</code>
with different base directories, use the genericantfile attribute
</li>
<li>if you want to run <code>directory1/mybuild.xml</code>, <code>directory2/mybuild.xml</code>, <code>....</code>,
use the antfile attribute. The subant task does not set the base directory for you in this case, because you can specify it in each build file.
</li>
</ul>
</subsection>
</description>
<section anchor="examples" name="Examples">
<pre>
&lt;project name="subant" default="subant1"&gt;
&lt;property name="build.dir" value="subant.build"/&gt;
&lt;target name="subant1"&gt;
&lt;subant target=""&gt;
&lt;property name="build.dir" value="subant1.build"/&gt;
&lt;property name="not.overloaded" value="not.overloaded"/&gt;
&lt;fileset dir="." includes="*/build.xml"/&gt;
&lt;/subant&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
<p>
this snippet build file will run ant in each subdirectory of the project directory,
where a file called build.xml can be found.
The property build.dir will have the value subant1.build in the ant projects called by subant.
</p>
<pre>
&lt;subant target=""&gt;
&lt;propertyset&gt;
&lt;propertyref prefix="toplevel"/&gt;
&lt;mapper type="glob" from="foo*" to="bar*"/&gt;
&lt;/propertyset&gt;
&lt;fileset dir="." includes="*/build.xml"/&gt;
&lt;/subant&gt;
</pre>
<p>
this snippet build file will run ant in each subdirectory of the project directory,
where a file called build.xml can be found.
All properties whose name starts with &quot;foo&quot; are passed, their names are changed to start with &quot;bar&quot; instead
</p>
<pre>
&lt;subant target="compile" genericantfile="/opt/project/build1.xml"&gt;
&lt;dirset dir="." includes="projects*"/&gt;
&lt;/subant&gt;
</pre>
<p>
assuming the subdirs of the project dir are called projects1, projects2, projects3
this snippet will execute the compile target of /opt/project/build1.xml,
setting the basedir to projects1, projects2, projects3
</p>
<p>Now a little more complex - but useful - scenario. Assume that we have
a directory structure like this:</p>
<pre>
root
| common.xml
| build.xml
|
+-- modules
+-- modA
| +-- src
+-- modB
+-- src

<u><b>common.xml:</b></u><br/>
&lt;project&gt;
&lt;property name="src.dir" value="src"/&gt;
&lt;property name="build.dir" value="build"/&gt;
&lt;property name="classes.dir" value="${build.dir}/classes"/&gt;

&lt;target name="compile"&gt;
&lt;mkdir dir="${classes.dir}"/&gt;
&lt;javac srcdir="${src.dir}" destdir="${classes.dir}"/&gt;
&lt;/target&gt;

&lt;!-- more targets --&gt;
&lt;/project&gt;

<u><b>build.xml:</b></u><br/>
&lt;project&gt;

&lt;macrodef name="iterate"&gt;
&lt;attribute name="target"/&gt;
&lt;sequential&gt;
&lt;subant target="@{target}"&gt;
&lt;fileset dir="modules" includes="*/build.xml"/&gt;
&lt;/subant&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;


&lt;target name="compile"&gt;
&lt;iterate target="compile"/&gt;
&lt;/target&gt;

&lt;!-- more targets --&gt;
&lt;/project&gt;

<u><b>modules/modA/build.xml:</b></u><br/>
&lt;project name="modA"&gt;
&lt;import file="../../common.xml"/&gt;
&lt;/project&gt;
</pre>

<p>This results in very small buildfiles in the modules, maintainable
buildfile (common.xml) and a clear project structure. Additionally
the root buildfile is capable to run the whole build over all
modules.
</p>
</section>
</external>

+ 0
- 111
proposal/xdocs/src/org/apache/tools/ant/taskdefs/Tar.xml View File

@@ -1,111 +0,0 @@
<!-- tar task -->
<external>
<description>
<p>Creates a tar archive.</p>

<p>The <i>basedir</i> attribute is the reference directory from where to tar.</p>

<p>This task is a <a href="../dirtasks.html#directorybasedtasks">directory based task</a>
and, as such, forms an implicit <a href="../CoreTypes/fileset.html">Fileset</a>. This
defines which files, relative to the <i>basedir</i>, will be included in the
archive. The tar task supports all the attributes of Fileset to refine the
set of files to be included in the implicit fileset.</p>

<p>In addition to the implicit fileset, the tar task supports nested filesets. These
filesets are extended to allow control over the access mode, username and groupname
to be applied to the tar entries. This is useful, for example, when preparing archives for
Unix systems where some files need to have execute permission.</p>

<p>Early versions of tar did not support path lengths greater than 100
characters. Modern versions of tar do so, but in incompatible ways.
The behaviour of the tar task when it encounters such paths is
controlled by the <i>longfile</i> attribute.
If the longfile attribute is set to <code>fail</code>, any long paths will
cause the tar task to fail. If the longfile attribute is set to
<code>truncate</code>, any long paths will be truncated to the 100 character
maximum length prior to adding to the archive. If the value of the longfile
attribute is set to <code>omit</code> then files containing long paths will be
omitted from the archive. Either option ensures that the archive can be
untarred by any compliant version of tar. If the loss of path or file
information is not acceptable, and it rarely is, longfile may be set to the
value <code>gnu</code>. The tar task will then produce a GNU tar file which
can have arbitrary length paths. Note however, that the resulting archive will
only be able to be untarred with GNU tar. The default for the longfile
attribute is <code>warn</code> which behaves just like the gnu option except
that it produces a warning for each file path encountered that does not match
the limit.</p>

<p>Note that this task does not perform compression. You might want to use the
<a href="gzip.html">GZip</a> task to prepare a .tar.gz package.</p>
</description>

<section anchor="examples" name="Examples">
<pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot; basedir=&quot;htdocs/manual&quot;/&gt;
&lt;gzip zipfile=&quot;${dist}/manual.tar.gz&quot; src=&quot;${dist}/manual.tar&quot;/&gt;</pre>
<p>tars all files in the <code>htdocs/manual</code> directory into a file called <code>manual.tar</code>
in the <code>${dist}</code> directory, then applies the gzip task to compress
it.</p>
<pre> &lt;tar destfile=&quot;${dist}/manual.tar&quot;
basedir=&quot;htdocs/manual&quot;
excludes=&quot;mydocs/**, **/todo.html&quot;
/&gt;</pre>
<p>tars all files in the <code>htdocs/manual</code> directory into a file called <code>manual.tar</code>
in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
or files with the name <code>todo.html</code> are excluded.</p>

<pre>
&lt;tar destfile=&quot;${basedir}/docs.tar&quot;&gt;
&lt;tarfileset dir=&quot;${dir.src}/docs&quot;
fullpath=&quot;/usr/doc/ant/README&quot;
preserveLeadingSlashes=&quot;true&quot;&gt;
&lt;include name=&quot;readme.txt&quot;/&gt;
&lt;/tarfileset&gt;
&lt;tarfileset dir=&quot;${dir.src}/docs&quot;
prefix=&quot;/usr/doc/ant&quot;
preserveLeadingSlashes=&quot;true&quot;&gt;
&lt;include name=&quot;*.html&quot;/&gt;
&lt;/tarfileset&gt;
&lt;/tar&gt;</pre>

<p>
Writes the file <code>docs/readme.txt</code> as
<code>/usr/doc/ant/README</code> into the archive. All
<code>*.html</code> files in the <code>docs</code> directory are
prefixed by <code>/usr/doc/ant</code>, so for example
<code>docs/index.html</code> is written as
<code>/usr/doc/ant/index.html</code> to the archive.
</p>


<pre>&lt;tar longfile=&quot;gnu&quot;
destfile=&quot;${dist.base}/${dist.name}-src.tar&quot; &gt;
&lt;tarfileset dir=&quot;${dist.name}/..&quot; mode=&quot;755&quot; username=&quot;ant&quot; group=&quot;ant&quot;&gt;
&lt;include name=&quot;${dist.name}/bootstrap.sh&quot;/&gt;
&lt;include name=&quot;${dist.name}/build.sh&quot;/&gt;
&lt;/tarfileset&gt;
&lt;tarfileset dir=&quot;${dist.name}/..&quot; username=&quot;ant&quot; group=&quot;ant&quot;&gt;
&lt;include name=&quot;${dist.name}/**&quot;/&gt;
&lt;exclude name=&quot;${dist.name}/bootstrap.sh&quot;/&gt;
&lt;exclude name=&quot;${dist.name}/build.sh&quot;/&gt;
&lt;/tarfileset&gt;
&lt;/tar&gt; </pre>

<p>This example shows building a tar which uses the GNU extensions for long paths and
where some files need to be marked as executable (mode 755)
and the rest are use the default mode (read-write by owner). The first
fileset selects just the executable files. The second fileset must exclude
the executable files and include all others. </p>

<p><strong>Note: </strong> The tar task does not ensure that a file is only selected
by one fileset. If the same file is selected by more than one fileset, it will be included in the
tar file twice, with the same path.</p>

<p><strong>Note:</strong> The patterns in the include and exclude
elements are considered to be relative to the corresponding dir
attribute as with all other filesets. In the example above,
<code>${dist.name}</code> is not an absolute path, but a simple name
of a directory, so <code>${dist.name}</code> is a valid path relative
to <code>${dist.name}/..</code>.</p>

</section>
</external>

+ 0
- 67
proposal/xdocs/src/org/apache/tools/ant/taskdefs/Test.java View File

@@ -1,67 +0,0 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.taskdefs;

import org.apache.tools.ant.Task;

/**
* @ant:task name="test"
*/
public class Test {
private String value;
public void setValue (String value) {
this.value = value;
}
}

+ 0
- 49
proposal/xdocs/templates/datatype_xdoc.template View File

@@ -1,49 +0,0 @@
<XDtTagDef:tagDef namespace="AntDatatype" handler="org.apache.tools.ant.xdoclet.DatatypeTagsHandler"/>
<XDtTagDef:tagDef namespace="AntTask" handler="org.apache.tools.ant.xdoclet.TaskTagsHandler"/>
<datatype name="<XDtAntDatatype:typeName/>"
classname="<XDtClass:fullClassName/>">
<short-description><![CDATA[<XDtClass:firstSentenceDescription/>]]></short-description>
<long-description>
<![CDATA[<XDtClass:classComment no-comment-signs="true"/>]]>
</long-description>

<structure>

<attributes>
<XDtAntTask:forAllAttributes>
<attribute name="<XDtMethod:propertyName/>" type="<XDtParameter:forAllMethodParams><XDtParameter:methodParamType/></XDtParameter:forAllMethodParams>">
<description><![CDATA[
<XDtMethod:methodComment no-comment-signs="true"/>
]]></description>
</attribute>
</XDtAntTask:forAllAttributes>
</attributes>

<elements>
<XDtAntTask:forAllElements>
<element name="<XDtAntTask:elementName/>" type="<XDtAntTask:elementType/>">
<description>
<![CDATA[<XDtMethod:methodComment no-comment-signs="true"/>]]>
</description>
<XDtClass:pushClass value="<XDtAntTask:elementType/>">
<XDtAntTask:ifHasAttributes>
<attributes>
<XDtAntTask:forAllAttributes>
<attribute name="<XDtMethod:propertyName/>" type="<XDtParameter:forAllMethodParams><XDtParameter:methodParamType/></XDtParameter:forAllMethodParams>">
<description><![CDATA[
<XDtMethod:methodComment no-comment-signs="true"/>
]]></description>
</attribute>
</XDtAntTask:forAllAttributes>
</attributes>
</XDtAntTask:ifHasAttributes>
</XDtClass:pushClass>
</element>

</XDtAntTask:forAllElements>
</elements>

</structure>
</datatype>



+ 0
- 3
proposal/xdocs/templates/type_defaults_properties.template View File

@@ -1,3 +0,0 @@
<XDtTagDef:tagDef namespace="Ant" handler="org.apache.tools.ant.xdoclet.DatatypeTagsHandler"/>
<XDtAnt:forAllDatatypes><XDtAnt:typeName/>=<XDtClass:fullClassName/>
</XDtAnt:forAllDatatypes>

Loading…
Cancel
Save