diff --git a/proposal/xdocs/build.xml b/proposal/xdocs/build.xml deleted file mode 100644 index 77d286b2c..000000000 --- a/proposal/xdocs/build.xml +++ /dev/null @@ -1,567 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - wsdl.found=${wsdl.found} - - - - - - - - csc.found=${csc.found} - - - - - - - dotnetapps.found=${dotnetapps.found} - - - - - - - - - - - - - - - - - - - - - - - xdoclet.classpath=${xdoclet.classpath} - xdoclet.extra.classpath=${xdoclet.extra.classpath} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proposal/xdocs/dvsl/README.txt b/proposal/xdocs/dvsl/README.txt deleted file mode 100644 index e86af1e00..000000000 --- a/proposal/xdocs/dvsl/README.txt +++ /dev/null @@ -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 - diff --git a/proposal/xdocs/dvsl/build.xml b/proposal/xdocs/dvsl/build.xml deleted file mode 100644 index 203abc3af..000000000 --- a/proposal/xdocs/dvsl/build.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proposal/xdocs/dvsl/lib/dom4j-1.2-jp.jar b/proposal/xdocs/dvsl/lib/dom4j-1.2-jp.jar deleted file mode 100644 index cbd4a12de..000000000 Binary files a/proposal/xdocs/dvsl/lib/dom4j-1.2-jp.jar and /dev/null differ diff --git a/proposal/xdocs/dvsl/lib/dom4j-README.txt b/proposal/xdocs/dvsl/lib/dom4j-README.txt deleted file mode 100644 index 07c61ae53..000000000 --- a/proposal/xdocs/dvsl/lib/dom4j-README.txt +++ /dev/null @@ -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 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; - } - - - diff --git a/proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar b/proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar deleted file mode 100644 index 259402099..000000000 Binary files a/proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar and /dev/null differ diff --git a/proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar b/proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar deleted file mode 100644 index 2fcc8af7b..000000000 Binary files a/proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar and /dev/null differ diff --git a/proposal/xdocs/dvsl/task.dvsl b/proposal/xdocs/dvsl/task.dvsl deleted file mode 100644 index 966853b9d..000000000 --- a/proposal/xdocs/dvsl/task.dvsl +++ /dev/null @@ -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 - - - - - $title - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- $title -#* *##if( $summary ) -
$summary -#* *##end -
-#* *##if( $project.logo ) - #set( $alt = $project.logo ) - #set( $home = $project.attribute("href") ) - #set( $src = $project.logo.attribute( "href" ) ) - - - $alt - -#* *##end -
-
-#* *##if ($node.name().equals("task")) -#* Use description from merged XML if available, else javadoc comment *# -#* *##if ($node.external.description) - -#* *#$context.applyTemplates("external/description") -#* *##else - -#* *#$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 -
-
-
-
- Copyright © 2000-2005, Apache Software Foundation -
-
- - - -#end - -#* - Macro to format a table heading cell -*# -#macro( th $text ) - - $text - -#end - -#* - Macro to format a table body cell -*# -#macro( td $text ) - - $text - -#end - -#* - Macro to format a table body cell that spans multiple rows -*# -#macro( tdmr $text $rows ) - - $text - -#end - - -#* - Macro to format a section banner -*# -#macro( section $anchor $name ) - - - - $name - -#end - -#* - Macro to format a subsection banner -*# -#macro( subsection $anchor $name ) - - - - $name - -#end - - -#* - Process javadoc long description section -*# -#match( "long-description" ) - - - - -#* *##section("description" "Description") - - - -
 
- $node.value().trim() -
- -#end - -#* - Process javadoc short description section -*# -#match( "short-description" ) - -#end - -#* - Process javadoc attribute/description section -*# -#match( "attribute/description" ) - -#end - -#* - Process javadoc element/description section -*# -#match( "element/description" ) - -#end - - -#* - Process external desciption -*# -#match( "external/description" ) - - - - -#* *##section("description" "Description") - - - -
 
-#* *#$context.applyTemplates("*") -
- -#end - -#* - Process top level attributes -*# -#match( "structure/attribute-groups" ) - - - -#* *##section("attributes" "Parameters") - - -
 
- - -#* *##th("Attribute") -#* *##th("Description") -#* *##th("Type") -#* *##th("Requirement") - -#* *#$context.applyTemplates("*") -
-
- -#end - -#* - Process attribute group -*# -#match( "structure/attribute-groups/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" ) - - -#* *##td($attrib.name) -#* *##td($node.description) -#* *##td($attrib.briefType) -#if ($inGroup) -#* *##tdmr($attributeGroup $numGroups) -#set ($inGroup = false) -#end - -#end - -#* - Process all elements -*# -#match( "elements" ) - - - - -#* *##section("elements" "Parameters as nested elements") - - - -
 
-#* *#$context.applyTemplates("*") -
- -#end - -#* - Process a single element -*# -#match( "element" ) - - - - - -
 
- - $attrib.name ($attrib.type) -
- $node.description.toString().trim() -#* *#$context.applyTemplates("*") -
- -#end - -#* - Process attributes within elements -*# -#match( "element/attributes" ) - - - - - - -
 
- - -#* *##th("Attribute") -#* *##th("Description") -#* *##th("Type") - -#* *#$context.applyTemplates("*") -
-
- -#end - - -#* - * Process a menu for the navigation bar - *# -#match( "menu" ) - -

- $attrib.name -

- - -#end - - -#* - * Process a menu item for the navigation bar - *# -#match( "item" ) -#if( $attrib.href.endsWith("$outputfilename") && !$attrib.href.startsWith("http")) - $attrib.name -#else -#if( $attrib.href.startsWith("http") ) - $attrib.name - #else - $attrib.name - #end -#end -#end - -#* - * process a documentation section - *# -#match( "section" ) - - - - - - - -
 
- - #if ( $attrib.anchor ) - #set( $anchor = $attrib.anchor ) - #else - #set( $anchor = $attrib.name ) - #end - - $attrib.name -
- $context.applyTemplates("*") -
-#end - -#match( "subsection" ) - - - - - -
- - #if ( $attrib.anchor ) - #set( $anchor = $attrib.anchor ) - #else - #set( $anchor = $attrib.name ) - #end - - $attrib.name -
- $context.applyTemplates("*") -
-#end - -#* - * process a the requirement groups - *# -#match( "requirement-group" ) - #if ($regGroup == $attrib.name) -#* *#$attrib.description - #end -#end - -#match( "source" ) -
- - - - - - - - - - - - - - - - -
- - - - - -
- - -
$toolbox.htmlescape.getText( $node.value() )
-
- -
- - - - - -
-
-#end - - -#match("table") - -$context.applyTemplates("*") -
-#end - -#match("tr") - -$context.applyTemplates("*") - -#end - -#match( "td" ) - - - $node.copy( $node.children() ) - - -#end - -#match( "th" ) - - - $node.copy( $node.children()) - - -#end - -#match("*") -$node.copy() -#end - diff --git a/proposal/xdocs/dvsl/toolbox.props b/proposal/xdocs/dvsl/toolbox.props deleted file mode 100644 index 70da66936..000000000 --- a/proposal/xdocs/dvsl/toolbox.props +++ /dev/null @@ -1,4 +0,0 @@ -toolbox.contextname = toolbox -toolbox.tool.htmlescape = org.apache.velocity.anakia.Escape - - diff --git a/proposal/xdocs/lib/LICENSE.xdoclet.txt b/proposal/xdocs/lib/LICENSE.xdoclet.txt deleted file mode 100644 index 575814f72..000000000 --- a/proposal/xdocs/lib/LICENSE.xdoclet.txt +++ /dev/null @@ -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 - diff --git a/proposal/xdocs/lib/commons-collections-2.0.jar b/proposal/xdocs/lib/commons-collections-2.0.jar deleted file mode 100644 index 4f4f97bab..000000000 Binary files a/proposal/xdocs/lib/commons-collections-2.0.jar and /dev/null differ diff --git a/proposal/xdocs/lib/commons-logging.jar b/proposal/xdocs/lib/commons-logging.jar deleted file mode 100644 index aca1e4132..000000000 Binary files a/proposal/xdocs/lib/commons-logging.jar and /dev/null differ diff --git a/proposal/xdocs/lib/xdoclet-1.2.jar b/proposal/xdocs/lib/xdoclet-1.2.jar deleted file mode 100644 index 80a713cbb..000000000 Binary files a/proposal/xdocs/lib/xdoclet-1.2.jar and /dev/null differ diff --git a/proposal/xdocs/lib/xdoclet-ejb-module-1.2.jar b/proposal/xdocs/lib/xdoclet-ejb-module-1.2.jar deleted file mode 100644 index 0c0d008e6..000000000 Binary files a/proposal/xdocs/lib/xdoclet-ejb-module-1.2.jar and /dev/null differ diff --git a/proposal/xdocs/lib/xdoclet-web-module-1.2.jar b/proposal/xdocs/lib/xdoclet-web-module-1.2.jar deleted file mode 100644 index d56f83603..000000000 Binary files a/proposal/xdocs/lib/xdoclet-web-module-1.2.jar and /dev/null differ diff --git a/proposal/xdocs/lib/xdoclet-xdoclet-module-1.2.jar b/proposal/xdocs/lib/xdoclet-xdoclet-module-1.2.jar deleted file mode 100644 index e4288ee1d..000000000 Binary files a/proposal/xdocs/lib/xdoclet-xdoclet-module-1.2.jar and /dev/null differ diff --git a/proposal/xdocs/lib/xjavadoc-1.0.2.jar b/proposal/xdocs/lib/xjavadoc-1.0.2.jar deleted file mode 100644 index 560294fd7..000000000 Binary files a/proposal/xdocs/lib/xjavadoc-1.0.2.jar and /dev/null differ diff --git a/proposal/xdocs/log4j.properties b/proposal/xdocs/log4j.properties deleted file mode 100644 index 11c631347..000000000 --- a/proposal/xdocs/log4j.properties +++ /dev/null @@ -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 diff --git a/proposal/xdocs/metadata/xdoclet.xml b/proposal/xdocs/metadata/xdoclet.xml deleted file mode 100644 index ccf9389b3..000000000 --- a/proposal/xdocs/metadata/xdoclet.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/AntDocletTask.java b/proposal/xdocs/src/org/apache/ant/xdoclet/AntDocletTask.java deleted file mode 100644 index c90d8a471..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/AntDocletTask.java +++ /dev/null @@ -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 - * . - */ - -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"); - } -} diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java b/proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java deleted file mode 100644 index af87e6d81..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java +++ /dev/null @@ -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 - * . - */ -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; - } -} diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/IndexGen.java b/proposal/xdocs/src/org/apache/ant/xdoclet/IndexGen.java deleted file mode 100644 index e9baf0030..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/IndexGen.java +++ /dev/null @@ -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 - * . - */ - -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("xdocs index"); - sb.append(""); - - 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("

" + category + "

"); - - sb.append("
    "); - - String[] tasks = (String[]) data.get(category); - - for (int j=0; j < tasks.length; j++) { - taskCount++; - String task = tasks[j]; - sb.append("
  • "); - sb.append("" + task + ""); - sb.append("
  • "); - } - - sb.append("
"); - } - - sb.append(""); - - 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"); - } -} diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDefPropertiesSubTask.java b/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDefPropertiesSubTask.java deleted file mode 100644 index a32bf079a..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDefPropertiesSubTask.java +++ /dev/null @@ -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 <taskdef> 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"); - } -} diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java b/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java deleted file mode 100644 index 8d9a6f84a..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java +++ /dev/null @@ -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(); - } - -} diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java b/proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java deleted file mode 100644 index adbff6ff0..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java +++ /dev/null @@ -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 - * . - */ - -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 <property>"); - 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 = ""; - - 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 += """ + values[i] + """; - 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()]); - } -} - diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/resources/task_xml.xdt b/proposal/xdocs/src/org/apache/ant/xdoclet/resources/task_xml.xdt deleted file mode 100644 index ec4564a19..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/resources/task_xml.xdt +++ /dev/null @@ -1,92 +0,0 @@ -deprecated="true" - matchingTask="true"> - - - - - - ]]> - - ]]> - - - - - - - - - deprecated="true" - briefType=""> - ]]> - ]]> - - - - - - - - deprecated="true" - briefType=""> - ]]> - ]]> - - - - - - - - deprecated="true" - briefType=""> - ]]> - ]]> - - - - - - - - - - deprecated="true" - briefType="" - - abstract="true"> - - ]]> - - ]]> - - - - - - - - deprecated="true"> - - ]]> - - - - - - - - diff --git a/proposal/xdocs/src/org/apache/ant/xdoclet/resources/taskdef_properties.xdt b/proposal/xdocs/src/org/apache/ant/xdoclet/resources/taskdef_properties.xdt deleted file mode 100644 index 09d21c4d1..000000000 --- a/proposal/xdocs/src/org/apache/ant/xdoclet/resources/taskdef_properties.xdt +++ /dev/null @@ -1,2 +0,0 @@ -= - diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/ConditionTask.xml b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/ConditionTask.xml deleted file mode 100644 index 60b112bad..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/ConditionTask.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - -

Sets a property if a certain condition holds true - this is a -generalization of Available and Uptodate.

-

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 value -attribute.

-

Conditions are specified as nested elements, -you must specify exactly one condition.

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

sets the property javamail.complete if both the -JavaBeans Activation Framework and JavaMail are available in the -classpath.

- -
-  <condition property="isMacOsButNotMacOsX">
-    <and>
-      <os family="mac" />
-      <not>
-        <os family="unix" />
-      </not>
-    </and>
-  </condition>
-
-

sets the property isMacOsButNotMacOsX if the current -operating system is MacOS, but not MacOS X - which Ant considers to be -in the Unix family as well.

- -
-  <condition property="isSunOSonSparc">
-    <os name="SunOS" arch="sparc" />
-  </condition>
-
-

sets the property isSunOSonSparc if the current -operating system is SunOS and if it is running on a sparc architecture.

- -
-
diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javac.xml b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javac.xml deleted file mode 100644 index c2b314e07..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javac.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - -

Compiles a Java source tree.

- -

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.

- -

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.

- -

The directory structure of the source tree should follow the package -hierarchy.

- -

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

- -

It is possible to use different compilers. This can be selected with the -"build.compiler" property or the compiler attribute. Here are the choices:-

-
    -
  • classic (the standard compiler of JDK 1.1/1.2) - javac1.1 and - javac1.2 can be used as aliases
  • -
  • modern (the standard compiler of JDK 1.3/1.4) - javac1.3 and - javac1.4 can be used as aliases
  • -
  • jikes (the Jikes - compiler)
  • -
  • jvc (the Command-Line Compiler from Microsoft's SDK for Java / - Visual J++) - microsoft can be used as an alias
  • -
  • kjc (the kopi - compiler)
  • -
  • gcj (the gcj compiler from gcc)
  • -
  • sj (Symantec java compiler) - symantec can be used as an alias
  • -
  • extJavac (run either modern or classic in a JVM of its own)
  • -
-

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 "build.compiler" property.

- -

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

- -

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

- -

Windows Note:When the modern compiler is used -in unforked mode on Windows, it locks up the files present in the -classpath of the <javac> 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.

- -
- -
-
  <javac srcdir="${src}"
-         destdir="${build}"
-         classpath="xyz.jar"
-         debug="on"
-  />
-

compiles all .java files under the ${src} -directory, and stores -the .class files in the ${build} directory. -The classpath used contains xyz.jar, and debug information is on.

- -
  <javac srcdir="${src}"
-         destdir="${build}"
-         fork="true"
-  />
-

compiles all .java files under the ${src} -directory, and stores the .class files in the -${build} directory. This will fork off the javac -compiler using the default javac executable.

- -
  <javac srcdir="${src}"
-         destdir="${build}"
-         fork="java$$javac.exe"
-  />
-

compiles all .java files under the ${src} -directory, and stores the .class files in the -${build} directory. This will fork off the javac -compiler using the executable named java$javac.exe. Note -that the $ sign needs to be escaped by a second one.

- -
  <javac srcdir="${src}"
-         destdir="${build}"
-         includes="mypackage/p1/**,mypackage/p2/**"
-         excludes="mypackage/p1/testpackage/**"
-         classpath="xyz.jar"
-         debug="on"
-  />
-

compiles .java files under the ${src} -directory, and stores the -.class files in the ${build} directory. -The classpath used contains xyz.jar, and debug information is on. -Only files under mypackage/p1 and mypackage/p2 are -used. Files in the mypackage/p1/testpackage directory are excluded -from compilation.

- -
  <javac srcdir="${src}:${src2}"
-         destdir="${build}"
-         includes="mypackage/p1/**,mypackage/p2/**"
-         excludes="mypackage/p1/testpackage/**"
-         classpath="xyz.jar"
-         debug="on"
-  />
- -

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

- -
  <javac destdir="${build}"
-         classpath="xyz.jar"
-         debug="on">
-    <src path="${src}"/>
-    <src path="${src2}"/>
-    <include name="mypackage/p1/**"/>
-    <include name="mypackage/p2/**"/>
-    <exclude name="mypackage/p1/testpackage/**"/>
-  </javac>
- -

Note: 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 < 1.2.

- -

Note: 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.

- -
- -
- -

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 "true" or "yes" to be -interpreted as anything other than false; by default -build.compiler.warnings is "true" while all others are "false"

- - - - - - - - - - - - - - - - - - -
- build.compiler.emacs - - Enable emacs compatible error messages -
- build.compiler.warnings
- This property has been deprecated, use the nowarn attribute - instead -
- don't disable warning messages -
- build.compiler.pedantic - - enable pedantic warnings -
- build.compiler.fulldepend - - enable full dependency checking,
- "+F" in the jikes manual. -
- -
-
diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javadoc.xml b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javadoc.xml deleted file mode 100644 index 509ec7fc5..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Javadoc.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - -

Generates code documentation using the javadoc tool.

- -

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 -"changed" files, unlike the javac task. This means -all packages will be processed each time this task is run. In general, however, -this task is used much less frequently.

- -

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.

- -

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.

- -

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.

- -

DEPRECATION: 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 javadoc -instead.

-
- -
-
  <javadoc packagenames="com.dummy.test.*"
-           sourcepath="src"
-           excludepackagenames="com.dummy.test.doc-files.*"
-           defaultexcludes="yes"
-           destdir="docs/api"
-           author="true"
-           version="true"
-           use="true"
-           windowtitle="Test API">
-    <doctitle><![CDATA[<h1>Test</h1>]]></doctitle>
-    <bottom><![CDATA[<i>Copyright &#169; 2000 Dummy Corp. All Rights Reserved.</i>]]></bottom>
-    <tag name="todo" scope="all" description="To do:" />
-    <group title="Group 1 Packages" packages="com.dummy.test.a*"/>
-    <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
-    <link offline="true" href="http://java.sun.com/products/jdk/1.2/docs/api/" packagelistLoc="C:\tmp"/>
-    <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
-  </javadoc>
-
-
diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Property.xml b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Property.xml deleted file mode 100644 index 29e2f2dca..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Property.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - -

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

- -

Properties are case sensitive.

- -

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

- -

There are five ways to set properties: -

    -
  • By supplying both the name and value attribute.
  • -
  • By supplying both the name and refid attribute.
  • -
  • 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.
  • -
  • 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.
  • -
  • 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.
  • -
-

-

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.

- -

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.

- -

A list of predefined properties can be found here.

- -
- -
- - ]]> -

sets the property foo.dist to the value "dist".

- - ]]> -

reads a set of properties from a file called "foo.properties".

- - ]]> -

reads a set of properties from a resource called "foo.properties".

-

Note that you can reference a global properties file for all of your Ant -builds using the following:

- - ]]> -

since the "user.home" property is defined by the Java virtual machine -to be your home directory. Where the "user.home" 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 "Documents -and Settings" folder. Older windows variants such as Windows 98/ME are less -predictable, as are other operating system/JVM combinations.

- - - - -]]> -

reads the system environment variables and stores them in properties, prefixed with "env". -Note that this only works on select operating systems. -Two of the values are shown being echoed. -

- -
-
diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml deleted file mode 100644 index 981eaf818..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml +++ /dev/null @@ -1,129 +0,0 @@ - - -

- Calls a given target for all defined sub-builds. - This is an extension - of ant for bulk project execution. - - This task must no be used outside of a - target if it invokes the same build file it is - part of. -

- -

- subant can be used with directory sets to execute a build from different directories. - 2 different options are offered : -

-
    -
  • - to run the same build file /somepath/otherpath/mybuild.xml - with different base directories, use the genericantfile attribute -
  • -
  • if you want to run directory1/mybuild.xml, directory2/mybuild.xml, ...., - 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. -
  • -
-
-
-
-
-        <project name="subant" default="subant1">
-        <property name="build.dir" value="subant.build"/>
-        <target name="subant1">
-            <subant target="">
-              <property name="build.dir" value="subant1.build"/>
-              <property name="not.overloaded" value="not.overloaded"/>
-              <fileset dir="." includes="*/build.xml"/>
-            </subant>
-        </target>
-        </project>
-        
-

- 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. -

-
-          <subant target="">
-             <propertyset>
-                  <propertyref prefix="toplevel"/>
-                  <mapper type="glob" from="foo*" to="bar*"/>
-             </propertyset>
-             <fileset dir="." includes="*/build.xml"/>
-          </subant>
-        
-

- 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 "foo" are passed, their names are changed to start with "bar" instead -

-
-          <subant target="compile" genericantfile="/opt/project/build1.xml">
-             <dirset dir="." includes="projects*"/>
-          </subant>
-        
-

- 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 -

-

Now a little more complex - but useful - scenario. Assume that we have - a directory structure like this:

-
-        root
-          |  common.xml
-          |  build.xml
-          |
-          +-- modules
-                +-- modA
-                |     +-- src
-                +-- modB
-                      +-- src
-
-        common.xml:
- <project> - <property name="src.dir" value="src"/> - <property name="build.dir" value="build"/> - <property name="classes.dir" value="${build.dir}/classes"/> - - <target name="compile"> - <mkdir dir="${classes.dir}"/> - <javac srcdir="${src.dir}" destdir="${classes.dir}"/> - </target> - - <!-- more targets --> - </project> - - build.xml:
- <project> - - <macrodef name="iterate"> - <attribute name="target"/> - <sequential> - <subant target="@{target}"> - <fileset dir="modules" includes="*/build.xml"/> - </subant> - </sequential> - </macrodef> - - - <target name="compile"> - <iterate target="compile"/> - </target> - - <!-- more targets --> - </project> - - modules/modA/build.xml:
- <project name="modA"> - <import file="../../common.xml"/> - </project> -
- -

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. -

-
-
\ No newline at end of file diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Tar.xml b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Tar.xml deleted file mode 100644 index 856537a2e..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Tar.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - -

Creates a tar archive.

- -

The basedir attribute is the reference directory from where to tar.

- -

This task is a directory based task -and, as such, forms an implicit Fileset. This -defines which files, relative to the basedir, 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.

- -

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.

- -

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 longfile attribute. -If the longfile attribute is set to fail, any long paths will -cause the tar task to fail. If the longfile attribute is set to -truncate, 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 omit 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 gnu. 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 warn which behaves just like the gnu option except -that it produces a warning for each file path encountered that does not match -the limit.

- -

Note that this task does not perform compression. You might want to use the -GZip task to prepare a .tar.gz package.

-
- -
-
  <tar tarfile="${dist}/manual.tar" basedir="htdocs/manual"/>
-  <gzip zipfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>
-

tars all files in the htdocs/manual directory into a file called manual.tar -in the ${dist} directory, then applies the gzip task to compress -it.

-
  <tar destfile="${dist}/manual.tar"
-       basedir="htdocs/manual"
-       excludes="mydocs/**, **/todo.html"
-  />
-

tars all files in the htdocs/manual directory into a file called manual.tar -in the ${dist} directory. Files in the directory mydocs, -or files with the name todo.html are excluded.

- -
-<tar destfile="${basedir}/docs.tar">
-  <tarfileset dir="${dir.src}/docs"
-              fullpath="/usr/doc/ant/README"
-              preserveLeadingSlashes="true">
-    <include name="readme.txt"/>
-  </tarfileset>
-  <tarfileset dir="${dir.src}/docs"
-              prefix="/usr/doc/ant"
-              preserveLeadingSlashes="true">
-    <include name="*.html"/>
-  </tarfileset>
-</tar>
- -

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

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

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.

- -

Note: 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.

- -

Note: 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, -${dist.name} is not an absolute path, but a simple name -of a directory, so ${dist.name} is a valid path relative -to ${dist.name}/...

- -
-
diff --git a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Test.java b/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Test.java deleted file mode 100644 index 2430a8038..000000000 --- a/proposal/xdocs/src/org/apache/tools/ant/taskdefs/Test.java +++ /dev/null @@ -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 - * . - */ -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; - } -} diff --git a/proposal/xdocs/templates/datatype_xdoc.template b/proposal/xdocs/templates/datatype_xdoc.template deleted file mode 100644 index 748d544de..000000000 --- a/proposal/xdocs/templates/datatype_xdoc.template +++ /dev/null @@ -1,49 +0,0 @@ - - - - ]]> - - ]]> - - - - - - - - - ]]> - - - - - - - - - ]]> - - - - - - - - ]]> - - - - - - - - - - - - - - diff --git a/proposal/xdocs/templates/type_defaults_properties.template b/proposal/xdocs/templates/type_defaults_properties.template deleted file mode 100644 index 3e1cf72ef..000000000 --- a/proposal/xdocs/templates/type_defaults_properties.template +++ /dev/null @@ -1,3 +0,0 @@ - -= -