From b9421dc80af485591a9c50cc8921f912e0def11e Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 23 Oct 2015 10:05:40 -0700 Subject: Removing sources to replace with download links instead. Change-Id: Ie28789a725051aec0d1b04dd291b7690a7898668 Signed-off-by: Ashlee Young --- .../ant/apache-ant-1.9.6/manual/Types/antlib.html | 266 --- .../apache-ant-1.9.6/manual/Types/assertions.html | 208 --- .../manual/Types/classfileset.html | 119 -- .../manual/Types/custom-programming.html | 415 ----- .../apache-ant-1.9.6/manual/Types/description.html | 46 - .../ant/apache-ant-1.9.6/manual/Types/dirset.html | 154 -- .../apache-ant-1.9.6/manual/Types/extension.html | 114 -- .../manual/Types/extensionset.html | 83 - .../apache-ant-1.9.6/manual/Types/filelist.html | 120 -- .../ant/apache-ant-1.9.6/manual/Types/fileset.html | 186 --- .../apache-ant-1.9.6/manual/Types/filterchain.html | 1739 -------------------- .../apache-ant-1.9.6/manual/Types/filterset.html | 200 --- .../ant/apache-ant-1.9.6/manual/Types/mapper.html | 972 ----------- .../manual/Types/multirootfileset.html | 173 -- .../apache-ant-1.9.6/manual/Types/namespace.html | 224 --- .../apache-ant-1.9.6/manual/Types/patternset.html | 192 --- .../apache-ant-1.9.6/manual/Types/permissions.html | 164 -- .../apache-ant-1.9.6/manual/Types/propertyset.html | 143 -- .../apache-ant-1.9.6/manual/Types/redirector.html | 193 --- .../ant/apache-ant-1.9.6/manual/Types/regexp.html | 116 -- .../apache-ant-1.9.6/manual/Types/resources.html | 1380 ---------------- .../manual/Types/selectors-program.html | 244 --- .../apache-ant-1.9.6/manual/Types/selectors.html | 1566 ------------------ .../apache-ant-1.9.6/manual/Types/tarfileset.html | 182 -- .../apache-ant-1.9.6/manual/Types/xmlcatalog.html | 306 ---- .../apache-ant-1.9.6/manual/Types/zipfileset.html | 148 -- 26 files changed, 9653 deletions(-) delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/antlib.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/assertions.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/classfileset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/custom-programming.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/description.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/dirset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/extension.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/extensionset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/filelist.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/fileset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/filterchain.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/filterset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/mapper.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/multirootfileset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/namespace.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/patternset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/permissions.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/propertyset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/redirector.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/regexp.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/resources.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/selectors-program.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/selectors.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/tarfileset.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/xmlcatalog.html delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Types/zipfileset.html (limited to 'framework/src/ant/apache-ant-1.9.6/manual/Types') diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/antlib.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/antlib.html deleted file mode 100644 index 925320ae..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/antlib.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - AntLib - - - -

Antlib

- - -

Description

-

- An antlib file is an xml file with a root element of "antlib". - Antlib's elements are Apache Ant definition tasks - like - Taskdef - or any Ant task that extends - org.apache.tools.ant.taskdefs.AntlibDefinition. -

-

- The current set of declarations bundled with Ant that do this are: -

-
    -
  1. Typedef -
  2. -
  3. Taskdef -
  4. -
  5. Macrodef -
  6. -
  7. Presetdef -
  8. -
  9. Scriptdef -
  10. -
-

- A group of tasks and types may be defined together in an antlib - file. For example the file sample.xml contains the following: -

-
-
-<?xml version="1.0"?>
-<antlib>
-   <typedef name="if" classname="org.acme.ant.If"/>
-   <typedef name="scriptpathmapper"
-            classname="org.acme.ant.ScriptPathMapper"
-            onerror="ignore"/>
-   <macrodef name="print">
-      <attribute name="file"/>
-      <sequential>
-         <concat taskname="print">
-            <fileset dir="." includes="@{file}"/>
-         </concat>
-      </sequential>
-   </macrodef>
-</antlib>
-      
-
-

- It defines two types or tasks, if and scriptpathmapper. - This antlib file may be used in a build script as follows: -

-
-
-<typedef file="sample.xml"/>
-      
-
-

- The other attributes of <typedef> may be used as well. - For example, assuming that the sample.xml is in a jar - file sample.jar also containing the classes, the - following build fragment will define the if and scriptpathmapper - tasks/types and place them in the namespace uri samples:/acme.org. -

-
-
-<typedef resource="org/acme/ant/sample.xml"
-         uri="samples:/acme.org"/>
-      
-
-

- The definitions may then be used as follows: -

-
-
-<sample:if valuetrue="${props}" xmlns:sample="samples:/acme.org">
-   <sample:scriptpathmapper language="beanshell">
-      some bean shell
-   </sample:scriptpathmapper>
-</sample:if>
-      
-
- - -

Antlib namespace

-

- The name space URIs with the pattern antlib:java package - are given special treatment. -

-

- When Ant encounters a element with a namespace URI with this pattern, it - will check to see if there is a resource of the name antlib.xml in - the package directory in the default classpath. -

-

- For example, assuming that the file antcontrib.jar has been placed - in the directory ${ant.home}/lib and it contains the resource - net/sf/antcontrib/antlib.xml which has all antcontrib's definitions - defined, the following build file will automatically load the antcontrib - definitions at location HERE: -

-
-
-<project default="deletetest" xmlns:antcontrib="antlib:net.sf.antcontrib">
-   <macrodef name="showdir">
-      <attribute name="dir"/>
-      <sequential>
-         <antcontrib:shellscript shell="bash">  <!-- HERE -->
-            ls -Rl @{dir}
-         </antcontrib:shellscript>
-      </sequential>
-   </macrodef>
-
-   <target name="deletetest">
-      <delete dir="a" quiet="yes"/>
-      <mkdir dir="a/b"/>
-      <touch file="a/a.txt"/>
-      <touch file="a/b/b.txt"/>
-      <delete>
-         <fileset dir="a"/>
-      </delete>
-      <showdir dir="a"/>
-   </target>
-</project>
-      
-
-

- The requirement that the resource is in the default classpath - may be removed in future versions of Ant.

-

- - -

Load antlib from inside of the buildfile

-

- If you want to separate the antlib from your local Ant installation, e.g. because you - want to hold that jar in your projects SCM system, you have to specify a classpath, so - that Ant could find that jar. The best solution is loading the antlib with <taskdef>. -

-
-
-<project xmlns:antcontrib="antlib:net.sf.antcontrib">
-   <taskdef uri="antlib:net.sf.antcontrib"
-            resource="net/sf/antcontrib/antlib.xml"
-            classpath="path/to/ant-contrib.jar"/>
-   
-   <target name="iterate">
-      <antcontrib:for param="file">
-         <fileset dir="."/>
-         <sequential>
-            <echo message="- @{file}"/>
-         </sequential>
-      </antcontrib:for>
-   </target>
-</project>
-      
-
- - - - -

Current namespace

-

- Definitions defined in antlibs may be used in antlibs. However - the namespace that definitions are placed in are dependent on - the <typedef> that uses the antlib. To deal with this - problem, the definitions are placed in the namespace URI ant:current - for the duration of the antlib execution. - For example the following antlib defines the task <if>, the - type <isallowed> and a macro - <ifallowed> that makes use of the task and type: -

-
-
-<antlib xmlns:current="ant:current">
-   <taskdef name="if" classname="org.acme.ant.If"/>
-   <typedef name="isallowed" classname="org.acme.ant.Isallowed"/>
-   <macrodef name="ifallowed">
-      <attribute name="action"/>
-      <element name="do"/>
-      <sequential>
-         <current:if>
-            <current:isallowed test="@{action}"/>
-            <current:then>
-               <do/>
-            </current:then>
-         </current:if>
-      </sequential>
-   </macrodef>
-</antlib>
-      
-
- - -

Other examples and comments

-

- Antlibs may make use of other antlibs. -

-

- As the names defined in the antlib are in the namespace uri as - specified by the calling <typedef> or by automatic element - resolution, one may reuse names from core ant types and tasks, - provided the caller uses a namespace uri. For example, the - following antlib may be used to define defaults for various - tasks: -

-
-
-<antlib xmlns:antcontrib="antlib:net.sf.antcontrib">
-   <presetdef name="javac">
-      <javac deprecation="${deprecation}"
-             debug="${debug}"/>
-   </presetdef>
-   <presetdef name="delete">
-      <delete quiet="yes"/>
-   </presetdef>
-   <presetdef name="shellscript">
-      <antcontrib:shellscript shell="bash"/>
-   </presetdef>
-</antlib>
-      
-
-

- This may be used as follows: -

-
-
-<project xmlns:local="localpresets">
-   <typedef file="localpresets.xml" uri="localpresets"/>
-   <local:shellscript>
-      echo "hello world"
-   </local:shellscript>
-</project>
-      
-
- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/assertions.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/assertions.html deleted file mode 100644 index e168969f..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/assertions.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - -Assertions type - - - - -

Assertions

-

-The assertions type enables or disables the Java 1.4 assertions feature, -on a whole Java program, or components of a program. It can be used -in <java> and -<junit> to add extra validation to code. - -

-Assertions are covered in the -Java SE documentation, -and the -Java Language Specification. - -

-The key points to note are that a java.lang.AssertionError -is thrown when an assertion fails, and that the facility is only available -on Java 1.4 and later. To enable assertions one must set source="1.4" -(or later) in <javac> when the source is being compiled, and -that the code must contain assert statements to be tested. The -result of such an action is code that neither compiles or runs on earlier -versions of Java. For this reason Apache Ant itself currently contains no assertions. -

- -When assertions are enabled (or disabled) in a task through nested -assertions elements, the class loader or command line is modified with the -appropriate options. This means that the JVM executed must be a Java 1.4 -or later JVM, even if there are no assertions in the code. Attempting to -enable assertions on earlier VMs will result in an "Unrecognized option" -error and the JVM will not start. - -

-

Attributes

-

- - -

- - - - - - - - - - - -
AttributeDescriptionRequired
enableSystemAssertionsFlag to turn system assertions on or off.No; default is "unspecified"
-

-When system assertions have been neither enabled nor disabled, then -the JVM is not given any assertion information - the default action of the - current JVMs is to disable system assertions. -

-Note also that there is no apparent documentation for what parts of the -JRE come with useful assertions. - -

Nested elements

- -

enable

-

-Enable assertions in portions of code. -If neither a package nor class is specified, assertions are turned on in all (user) code. -

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classThe name of a class on which to enable assertions.No
package - The name of a package in which to enable assertions on all classes. (Includes subpackages.) - Use "..." for the anonymous package. - No
- -

disable

-

-Disable assertions in portions of code. - -

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classThe name of a class on which to disable assertions.No
package - The name of a package in which to disable assertions on all classes. (Includes subpackages.) - Use "..." for the anonymous package. - No
-

- -Because assertions are disabled by default, it only makes sense to disable -assertions where they have been enabled in a parent package. - - -

Examples

- -
Example: enable assertions in all user classes
- -All classes not in the JRE (i.e. all non-system classes) will have assertions turned on. -
-<assertions>
-  <enable/>
-</assertions>
-
- -
Example: enable a single class
- -Enable assertions in a class called Test -
-<assertions>
-  <enable class="Test"/>
-</assertions>
-
- -
Example: enable a package
- -Enable assertions in the org.apache package -and all packages starting with the org.apache. prefix -
-<assertions>
-  <enable package="org.apache"/>
-</assertions>
-
- -
Example: System assertions
- -Example: enable system assertions and assertions in all org.apache packages except -for Ant (but including org.apache.tools.ant.Main) -
-<assertions enableSystemAssertions="true">
-  <enable package="org.apache"/>
-  <disable package="org.apache.tools.ant"/>
-  <enable class="org.apache.tools.ant.Main"/>
-</assertions>
-
- -
Example: disabled and anonymous package assertions
- -Disable system assertions; enable those in the anonymous package -
-<assertions enableSystemAssertions="false">
-  <enable package="..."/>
-</assertions>
-
- - -
Example: referenced assertions
- -This type is a datatype, so you can declare assertions and use them later - -
-<assertions id="project.assertions">
-  <enable package="org.apache.test"/>
-</assertions>
-
-<assertions refid="project.assertions"/>
-
- - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/classfileset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/classfileset.html deleted file mode 100644 index 6145d979..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/classfileset.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - -ClassFileSet Type - - - -

ClassFileSet

-

A classfileset is a specialized type of fileset which, given a set of -"root" classes, will include all of the class files upon which the -root classes depend. This is typically used to create a jar with all of the -required classes for a particular application. -

-

-classfilesets are typically used by reference. They are declared with an -"id" value and this is then used as a reference where a normal fileset -is expected. -

-

-This type requires the BCEL library. -

- - -

Attributes

-

The class fileset support the following attributes in addition -to those supported by the -standard fileset: -

- - - - - - - - - - - - -
AttributeDescriptionRequired
rootclassA single root class nameNo
- -

Nested Elements

- -

Root

-

-When more than one root class is required, multiple nested <root> elements -may be used -

- - - - - - - - - - - -
AttributeDescriptionRequired
classnameThe fully qualified name of the root classYes
- -

RootFileSet

-

-A root fileset is used to add a set of root classes from a fileset. In this case the entries in -the fileset are expected to be Java class files. The name of the Java class is determined by the -relative location of the classfile in the fileset. So, the file -org/apache/tools/ant/Project.class corresponds to the Java class -org.apache.tools.ant.Project.

- -

Examples

-
-<classfileset id="reqdClasses" dir="${classes.dir}">
-  <root classname="org.apache.tools.ant.Project"/>
-</classfileset>
-
- -

This example creates a fileset containing all the class files upon which the -org.apache.tools.ant.Project class depends. This fileset could -then be used to create a jar. -

- -
-<jar destfile="minimal.jar">
-  <fileset refid="reqdClasses"/>
-</jar>
-
- -
-<classfileset id="reqdClasses" dir="${classes.dir}">
-  <rootfileset dir="${classes.dir}" includes="org/apache/tools/ant/Project*.class"/>
-</classfileset>
-
- -

This example constructs the classfileset using all the class with names starting with Project -in the org.apache.tools.ant package

- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/custom-programming.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/custom-programming.html deleted file mode 100644 index 96bade33..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/custom-programming.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - - -Custom Components - - -

Custom Components

-

Overview

-

- Custom components are conditions, selectors, filters and other - objects that are defined outside Apache Ant core. -

-

- In Ant 1.6 custom conditions, selectors and filters has - been overhauled. -

-

- It is now possible to define custom conditions, selectors and filters - that behave like Ant Core components. - This is achieved by allowing datatypes defined in build scripts - to be used as custom components if the class of the datatype - is compatible, or has been adapted by an adapter class. -

-

- The old methods of defining custom components are still supported. -

-

Definition and use

-

- A custom component is a normal Java class that implements a particular - interface or extends a particular class, or has been adapted to the - interface or class. -

-

- It is exactly like writing a - custom task. - One defines attributes and nested elements by writing setter - methods and add methods. -

-

- After the class has been written, it is added to the ant system - by using <typedef>. -

-

Custom Conditions

-

- Custom conditions are datatypes that implement - org.apache.tools.ant.taskdefs.condition.Condition. - For example a custom condition that returns true if a - string is all upper case could be written as: -

-
-
-package com.mydomain;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.condition.Condition;
-
-public class AllUpperCaseCondition implements Condition {
-    private String value;
-
-    // The setter for the "value" attribute
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    // This method evaluates the condition
-    public boolean eval() {
-        if (value == null) {
-            throw new BuildException("value attribute is not set");
-        }
-        return value.toUpperCase().equals(value);
-   }
-}
-      
-
- -

- Adding the condition to the system is achieved as follows: -

-
-
-<typedef
-    name="alluppercase"
-    classname="com.mydomain.AllUpperCaseCondition"
-    classpath="${mydomain.classes}"/>
-      
-
-

- This condition can now be used wherever a Core Ant condition - is used. -

-
-
-<condition property="allupper">
-   <alluppercase value="THIS IS ALL UPPER CASE"/>
-</condition>
-      
-
-

Custom Selectors

-

- Custom selectors are datatypes that implement - org.apache.tools.ant.types.selectors.FileSelector. -

-

There is only one method required. - public boolean isSelected(File basedir, String filename, - File file). - It returns true - or false depending on whether the given file should be - selected or not. -

-

- An example of a custom selection that selects filenames ending - in ".java" would be: -

-
-
-package com.mydomain;
-import java.io.File;
-import org.apache.tools.ant.types.selectors.FileSelector;
-public class JavaSelector implements FileSelector {
-    public boolean isSelected(File b, String filename, File f) {
-       return filename.toLowerCase().endsWith(".java");
-    }
-}
-      
-
-

- Adding the selector to the system is achieved as follows: -

-
-
-<typedef
-    name="javaselector"
-    classname="com.mydomain.JavaSelector"
-    classpath="${mydomain.classes}"/>
-      
-
-

- This selector can now be used wherever a Core Ant selector - is used, for example: -

-
-
-<copy todir="to">
-   <fileset dir="src">
-      <javaselector/>
-   </fileset>
-</copy>
-      
-
- -

- One may use - org.apache.tools.ant.types.selectors.BaseSelector, - a convenience class that provides reasonable default - behaviour. - It has some predefined behaviours you can take advantage - of. Any time you encounter a problem when setting attributes or - adding tags, you can call setError(String errmsg) and the class - will know that there is a problem. Then, at the top of your - isSelected() method call validate() and - a BuildException will be thrown with the contents of your error - message. The validate() method also gives you a - last chance to check your settings for consistency because it - calls verifySettings(). Override this method and - call setError() within it if you detect any - problems in how your selector is set up. -

-

- To write custom selector containers one should extend - org.apache.tools.ant.types.selectors.BaseSelectorContainer. - Implement the - public boolean isSelected(File baseDir, String filename, File file) - method to do the right thing. Chances are you'll want to iterate - over the selectors under you, so use - selectorElements() to get an iterator that will do - that. -

-

- For example to create a selector container that will select files - if a certain number of contained selectors select, one could write - a selector as follows: -

-
-
-public class MatchNumberSelectors extends BaseSelectorContainer {
-    private int number = -1;
-    public void setNumber(int number) {
-        this.number = number;
-    }
-    public void verifySettings() {
-        if (number < 0) {
-           throw new BuildException("Number attribute should be set");
-        }
-    }
-    public boolean isSelected(File baseDir, String filename, File file) {
-        validate();
-        int numberSelected = 0;
-        for (Enumeration e = selectorElements(); e.hasNextElement();) {
-            FileSelector s = (FileSelector) e.nextElement();
-            if (s.isSelected(baseDir, filename, file)) {
-                numberSelected++;
-            }
-        }
-        return numberSelected == number;
-    }
-}
-      
-
-

- To define and use this selector one could do: -

-
-
-<typedef name="numberselected"
-         classname="com.mydomain.MatchNumberSelectors"/>
-...
-<fileset dir="${src.path}">
-   <numberselected number="2">
-      <contains text="script" casesensitive="no"/>
-      <size value="4" units="Ki" when="more"/>
-      <javaselector/>
-   </numberselected>
-</fileset>
-      
-
-

- The custom selector -

-

- The custom selector was the pre ant 1.6 way of defining custom selectors. - This method is still supported for backward compatibility. -

-

You can write your own selectors and use them within the selector - containers by specifying them within the <custom> tag.

- -

To create a new Custom Selector, you have to create a class that - implements - org.apache.tools.ant.types.selectors.ExtendFileSelector. - The easiest way to do that is through the convenience base class - org.apache.tools.ant.types.selectors.BaseExtendSelector, - which provides all of the methods for supporting - <param> tags. First, override the - isSelected() method, and optionally the - verifySettings() method. If your custom - selector requires parameters to be set, you can also override - the setParameters() method and interpret the - parameters that are passed in any way you like. Several of the - core selectors demonstrate how to do that because they can - also be used as custom selectors.

- - -

Once that is written, you include it in your build file by using - the <custom> tag. -

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classnameThe name of your class that implements - org.apache.tools.ant.types.selectors.FileSelector. - Yes
classpathThe classpath to use in order to load the - custom selector class. If neither this classpath nor the - classpathref are specified, the class will be - loaded from the classpath that Ant uses. - No
classpathrefA reference to a classpath previously - defined. If neither this reference nor the - classpath above are specified, the class will be - loaded from the classpath that Ant uses. - No
- -

Here is how you use <custom> to - use your class as a selector: -

- -
-<fileset dir="${mydir}" includes="**/*">
-    <custom classname="com.mydomain.MySelector">
-        <param name="myattribute" value="myvalue"/>
-    </custom>
-</fileset>
-      
- - -

The core selectors that can also be used as custom selectors - are

- - - -

Here is the example from the Depth Selector section rewritten - to use the selector through <custom>.

- -
-<fileset dir="${doc.path}" includes="**/*">
-    <custom classname="org.apache.tools.ant.types.selectors.DepthSelector">
-        <param name="max" value="1"/>
-    </custom>
-</fileset>
-      
- -

Selects all files in the base directory and one directory below - that.

- -

Custom Filter Readers

-

- Custom filter readers selectors are datatypes that implement - org.apache.tools.ant.types.filters.ChainableReader. -

-

There is only one method required. - Reader chain(Reader reader). - This returns a reader that filters input from the specified - reader. -

-

- For example a filterreader that removes every second character - could be: -

-
-
-public class RemoveOddCharacters implements ChainableReader {
-   public Reader chain(Reader reader) {
-      return new BaseFilterReader(reader) {
-          int count = 0;
-          public int read() throws IOException {
-              while (true) {
-                int c = in.read();
-                if (c == -1) {
-                    return c;
-                }
-                count++;
-                if ((count % 2) == 1) {
-                    return c;
-                }
-              }
-          }
-      }
-   }
-}
-      
-
-

- For line oriented filters it may be easier to extend - ChainableFilterReader an inner class of - org.apache.tools.ant.filters.TokenFilter. -

-

- For example a filter that appends the line number could be -

-
-
-public class AddLineNumber extends ChainableReaderFilter {
-   private void lineNumber = 0;
-   public String filter(String string) {
-      lineNumber++;
-      return "" + lineNumber + "\t" + string;
-   }
-}
-      
-
- - -
- - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/description.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/description.html deleted file mode 100644 index 85942be0..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/description.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - -Apache Ant User Manual - - - - -

Description

-

Description

-

Allows for a description of the project to be specified that -will be included in the output of the ant ‑projecthelp -command.

- -

Parameters

-

(none)

-

Examples

-
  
-<description>
-This buildfile is used to build the Foo subproject within 
-the large, complex Bar project.
-</description>
-
- - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/dirset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/dirset.html deleted file mode 100644 index 0434e9c2..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/dirset.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - -DirSet Type - - - - -

DirSet

-

A DirSet is a group of directories. These directories can be found in a -directory tree starting in a base directory and are matched by -patterns taken from a number of PatternSets -and Selectors. -

-

PatternSets can be specified as nested -<patternset> elements. In addition, DirSet holds -an implicit PatternSet and supports the nested -<include>, <includesfile>, -<exclude> and <excludesfile> -elements of <patternset> directly, as well as -<patternset>'s attributes.

-

Selectors are available as nested elements within the DirSet. -If any of the selectors within the DirSet do not select the directory, it -is not considered part of the DirSet. This makes a DirSet -equivalent to an <and> selector container.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
dirThe root of the directory tree of this DirSet.Yes
includesA comma- or space-separated list of patterns of directories that - must be included; all directories are included when omitted.No
includesfileThe name of a file; each line of this file is - taken to be an include pattern. - Note: if the file is empty and there are no other - patterns defined for the fileset, all directories will be included. - No
excludesA comma- or space-separated list of patterns of directories that - must be excluded; no directories are excluded when omitted.No
excludesfileThe name of a file; each line of this file is - taken to be an exclude pattern.No
casesensitiveSpecifies whether case-sensitivity should be applied - (true|yes|on or - false|no|off).No; defaults to true.
followsymlinksShall symbolic links be followed? Defaults to - true. See fileset's documentation.No
erroronmissingdir - Specify what happens if the base directory does not exist. - If true a build error will happen, if false, the dirset - will be ignored/empty. - Defaults to true. - Since Apache Ant 1.7.1 (default is true for backward compatibility - reasons.) - No
- -

Examples

- -
-<dirset dir="${build.dir}">
-  <include name="apps/**/classes"/>
-  <exclude name="apps/**/*Test*"/>
-</dirset>
-
-

Groups all directories named classes found under the -apps subdirectory of ${build.dir}, except those -that have the text Test in their name.

- -
-<dirset dir="${build.dir}">
-  <patternset id="non.test.classes">
-    <include name="apps/**/classes"/>
-    <exclude name="apps/**/*Test*"/>
-  </patternset>
-</dirset>
-
-

Groups the same directories as the above example, but also establishes -a PatternSet that can be referenced in other -<dirset> elements, rooted at a different directory.

- -
-<dirset dir="${debug_build.dir}">
-  <patternset refid="non.test.classes"/>
-</dirset>
-
-

Groups all directories in directory ${debug_build.dir}, -using the same patterns as the above example.

- -
-<dirset id="dirset" dir="${workingdir}">
-   <present targetdir="${workingdir}">
-        <mapper type="glob" from="*" to="*/${markerfile}" />
-   </present>
-</dirset>
-
-

Selects all directories somewhere under ${workingdir} -which contain a ${markerfile}.

- - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/extension.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/extension.html deleted file mode 100644 index b05c0a65..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/extension.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - -Extension Type - - - -

Extension

-

Utility type that represents either an available "Optional Package" - (formerly known as "Standard Extension") as described in the manifest - of a JAR file, or the requirement for such an optional package.

-

Note that this type -works with extensions as defined by the "Optional Package" specification. - For more information about optional packages, see the document -Optional Package Versioning in the documentation bundle for your -Java2 Standard Edition package, in file -guide/extensions/versioning.html or the online - -Package Versioning documentation.

- -

Attributes

-

The extension type supports the following attributes: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
extensionNameThe name of extensionyes
specificationVersionThe version of extension specification (Must be in - dewey decimal aka dotted decimal notation. 3.2.4)no
specificationVendorThe specification vendorno
implementationVersionThe version of extension implementation (Must be in - dewey decimal aka dotted decimal notation. 3.2.4)no
implementationVendorThe implementation vendorno
implementationVendorIdThe implementation vendor IDno
implementationURLThe url from which to retrieve extension.no
- -

Examples

-
-<extension id="e1"
-    extensionName="MyExtensions"
-    specificationVersion="1.0"
-    specificationVendor="Peter Donald"
-    implementationVendorID="vv"
-    implementationVendor="Apache"
-    implementationVersion="2.0"
-    implementationURL="http://somewhere.com/myExt.jar"/>
-
- -

Fully specific extension object.

- -
-<extension id="e1"
-    extensionName="MyExtensions"
-    specificationVersion="1.0"
-    specificationVendor="Peter Donald"/>
-
- -

Extension object that just species the specification details.

- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/extensionset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/extensionset.html deleted file mode 100644 index f38c1ed1..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/extensionset.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -ExtensionSet Type - - - -

ExtensionSet

-

Utility type that represents a set of Extensions.

-

Note that this type -works with extensions as defined by the "Optional Package" specification. - For more information about optional packages, see the document -Optional Package Versioning in the documentation bundle for your -Java2 Standard Edition package, in file -guide/extensions/versioning.html or online at - -Package Versioning documentation.

- -

Nested Elements

- -

extension

-

Extension object to add to set.

- -

fileset

-

FileSets all files contained - contained within set that are jars and implement an extension are added - to extension set.

- -

LibFileSet

-

All files contained contained within set that are jars and implement - an extension are added to extension set. However the extension information - may be modified by attributes of libfileset

- -

Examples

-
-<extension id="e1"
-    extensionName="MyExtensions"
-    specificationVersion="1.0"
-    specificationVendor="Peter Donald"
-    implementationVendorID="vv"
-    implementationVendor="Apache"
-    implementationVersion="2.0"
-    implementationURL="http://somewhere.com/myExt.jar"/>
-
-<libfileset id="lfs"
-               includeUrl="true"
-               includeImpl="false"
-               dir="tools/lib">
-  <include name="*.jar"/>
-</libfileset>
-
-<extensionSet id="exts">
-  <libfileset dir="lib">
-    <include name="*.jar"/>
-  </libfileset>
-  <libfileset refid="lfs"/>
-  <extension refid="e1"/>
-</extensionSet>
-
-
- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/filelist.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/filelist.html deleted file mode 100644 index 57c981d3..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/filelist.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - -FileList Type - - - - -

FileList

- -

FileLists are explicitly named lists of files. Whereas FileSets -act as filters, returning only those files that exist in the file -system and match specified patterns, FileLists are useful for -specifying files that may or may not exist. Multiple files are -specified as a list of files, relative to the specified directory, -with no support for wildcard expansion (filenames with wildcards will be -included in the list unchanged). -FileLists can appear inside tasks that support this feature or as stand-alone -types. -

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
dirThe base directory of this FileList.Yes
filesThe list of file names. This is a list of - file name separated by whitespace, or by commas. - Yes, unless there is a nested file element
-

Nested Element: file

-

- This represents a file name. The nested element allows filenames containing - white space and commas. -

-

Since Apache Ant 1.6.2

- - - - - - - - - - - -
AttributeDescriptionRequired
nameThe name of the file.Yes
-

Examples

-
-<filelist 
-    id="docfiles" 
-    dir="${doc.src}"
-    files="foo.xml,bar.xml"/> 
-
- -

The files ${doc.src}/foo.xml and -${doc.src}/bar.xml. Note that these files may not (yet) -actually exist. -

- -
-<filelist 
-    id="docfiles" 
-    dir="${doc.src}"
-    files="foo.xml
-           bar.xml"/> 
-
- -

Same files as the example above.

- -
-<filelist refid="docfiles"/> 
-
- -

Same files as the example above.

- -
-<filelist 
-    id="docfiles" 
-    dir="${doc.src}">
-    <file name="foo.xml"/>
-    <file name="bar.xml"/>
-</filelist>
-
- -

Same files as the example above.

- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/fileset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/fileset.html deleted file mode 100644 index 9a7c7d71..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/fileset.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - -FileSet Type - - - - -

FileSet

-

A FileSet is a group of files. These files can be found in a -directory tree starting in a base directory and are matched by -patterns taken from a number of PatternSets and -Selectors. -

PatternSets can be specified as nested -<patternset> elements. In addition, FileSet holds -an implicit PatternSet and supports the nested -<include>, <includesfile>, -<exclude> and <excludesfile> -elements of PatternSet directly, as well as PatternSet's -attributes.

-

Selectors are available as nested elements within the FileSet. -If any of the selectors within the FileSet do not select the file, the -file is not considered part of the FileSet. This makes a FileSet -equivalent to an <and> selector container.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
dirthe root of the directory tree of this FileSet.Either dir or file must be specified
fileshortcut for specifying a single-file fileset
defaultexcludesindicates whether default excludes should be used or not - (yes | no); default excludes are used when omitted.No
includescomma- or space-separated list of patterns of files that must be - included; all files are included when omitted.No
includesfilethe name of a file; each line of this file is - taken to be an include pattern.
- Note: if the file is empty and there are no other - patterns defined for the fileset, all files will be included. -
No
excludescomma- or space-separated list of patterns of files that must be - excluded; no files (except default excludes) are excluded when omitted.No
excludesfilethe name of a file; each line of this file is - taken to be an exclude pattern.No
casesensitiveMust the include and exclude patterns be treated in a case sensitive way? - Defaults to true.No
followsymlinksShall symbolic links be followed? Defaults to - true. See the note below.No
erroronmissingdir - Specify what happens if the base directory does not exist. - If true a build error will happen, if false, the fileset - will be ignored/empty. - Defaults to true. - Since Apache Ant 1.7.1 (default is true for backward compatibility - reasons.) - No
- -

Note: All files/directories for which -the canonical path is different from its path are considered symbolic -links. On Unix systems this usually means the file really is a -symbolic link but it may lead to false results on other -platforms.

- -

Examples

-
-<fileset dir="${server.src}" casesensitive="yes">
-  <include name="**/*.java"/>
-  <exclude name="**/*Test*"/>
-</fileset>
-
-

Groups all files in directory ${server.src} that are Java -source files and don't have the text Test in their -name.

- -
-<fileset dir="${server.src}" casesensitive="yes">
-  <patternset id="non.test.sources">
-    <include name="**/*.java"/>
-    <exclude name="**/*Test*"/>
-  </patternset>
-</fileset>
-
-

Groups the same files as the above example, but also establishes -a PatternSet that can be referenced in other -<fileset> elements, rooted at a different directory.

- -
-<fileset dir="${client.src}" >
-  <patternset refid="non.test.sources"/>
-</fileset>
-
-

Groups all files in directory ${client.src}, using the -same patterns as the above example.

- -
-<fileset dir="${server.src}" casesensitive="yes">
-  <filename name="**/*.java"/>
-  <filename name="**/*Test*" negate="true"/>
-</fileset>
-
-

Groups the same files as the top example, but using the -<filename> selector.

- -
-<fileset dir="${server.src}" casesensitive="yes">
-  <filename name="**/*.java"/>
-  <not>
-    <filename name="**/*Test*"/>
-  </not>
-</fileset>
-
-

Groups the same files as the previous example using a combination of the -<filename> selector and the <not> -selector container.

- -
-<fileset dir="src" includes="main/" />
-
-

Selects all files in src/main (e.g. src/main/Foo.java or -src/main/application/Bar.java).

- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/filterchain.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/filterchain.html deleted file mode 100644 index 4de10ea3..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/filterchain.html +++ /dev/null @@ -1,1739 +0,0 @@ - - - - - - -FilterChains and FilterReaders - - - - -

FilterChains and FilterReaders

-Consider the flexibility of Unix pipes. If you wanted, -for example, to copy just those lines that contained the -string blee from the first 10 lines of a text file 'foo' -(you wouldn't want to filter a binary file) -to a file 'bar', you would do something like:

- -cat foo|head -n10|grep blee > bar -

-Apache Ant was not flexible enough. There was no way for the -<copy> task to do something similar. If you wanted -the <copy> task to get the first 10 lines, you would have -had to create special attributes:

- -<copy file="foo" tofile="bar" head="10" contains="blee"/> -

-The obvious problem thus surfaced: Ant tasks would not be able -to accommodate such data transformation attributes as they would -be endless. The task would also not know in which order these -attributes were to be interpreted. That is, must the task execute the -contains attribute first and then the head attribute or vice-versa? -What Ant tasks needed was a mechanism to allow pluggable filter (data -transformer) chains. Ant would provide a few filters for which there -have been repeated requests. Users with special filtering needs -would be able to easily write their own and plug them in.

- -The solution was to refactor data transformation oriented -tasks to support FilterChains. A FilterChain is a group of -ordered FilterReaders. Users can define their own FilterReaders -by just extending the java.io.FilterReader class. Such custom -FilterReaders can be easily plugged in as nested elements of -<filterchain> by using <filterreader> elements. -

-Example: -

-<copy file="${src.file}" tofile="${dest.file}">
-  <filterchain>
-    <filterreader classname="your.extension.of.java.io.FilterReader">
-      <param name="foo" value="bar"/>
-    </filterreader>
-    <filterreader classname="another.extension.of.java.io.FilterReader">
-      <classpath>
-        <pathelement path="${classpath}"/>
-      </classpath>
-      <param name="blah" value="blee"/>
-      <param type="abra" value="cadabra"/>
-    </filterreader>
-  </filterchain>
-</copy>
-
- -Ant provides some built-in filter readers. These filter readers -can also be declared using a syntax similar to the above syntax. -However, they can be declared using some simpler syntax also.

-Example: -

-<loadfile srcfile="${src.file}" property="src.file.head">
-  <filterchain>
-    <headfilter lines="15"/>
-  </filterchain>
-</loadfile>
-
-is equivalent to: -
-<loadfile srcfile="${src.file}" property="src.file.head">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
-      <param name="lines" value="15"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -The following built-in tasks support nested <filterchain> elements.
-Concat,
-Copy,
-LoadFile,
-LoadProperties,
-LoadResource,
-Move

- -A FilterChain is formed by defining zero or more of the following -nested elements.
-FilterReader
-ClassConstants
-EscapeUnicode
-ExpandProperties
-HeadFilter
-LineContains
-LineContainsRegExp
-PrefixLines
-ReplaceTokens
-StripJavaComments
-StripLineBreaks
-StripLineComments
-SuffixLines
-TabsToSpaces
-TailFilter
-DeleteCharacters
-ConcatFilter
-TokenFilter
-FixCRLF
-SortFilter
- -

FilterReader

- -The filterreader element is the generic way to -define a filter. User defined filter elements are -defined in the build file using this. Please note that -built in filter readers can also be defined using this -syntax. - -A FilterReader element must be supplied with a class name as -an attribute value. The class resolved by this name must -extend java.io.FilterReader. If the custom filter reader -needs to be parameterized, it must implement -org.apache.tools.type.Parameterizable. - - - - - - - - - - - - -
AttributeDescriptionRequired
classnameThe class name of the filter reader.Yes
- -

-

Nested Elements:

-<filterreader> supports <classpath> and <param> -as nested elements. Each <param> element may take in the following -attributes - name, type and value. -

-The following FilterReaders are supplied with the default -distribution. - -

ClassConstants

-

- This filters basic constants defined in a Java Class, - and outputs them in lines composed of the format name=value. - This filter uses the bcel library to understand the Java Class file. - See Library Dependencies. -

-

- Important: - This filter is different from most of the other filters. - Most of the filters operate on a sequence of characters. - This filter operates on the sequence of bytes that makes up - a class. However the bytes arrive to the filter as a sequence - of characters. This means that one must be careful on the - choice of character encoding to use. Most encoding lose information - on conversion from an arbitrary sequence of bytes to characters - and back again to bytes. In particular the usual default - character encodings (CP152 and UTF-8) do. - For this reason, since Ant 1.7, the character - encoding ISO-8859-1 is used to convert from characters back to - bytes, so one has to use this encoding for reading the java - class file. -

Example:

- -This loads the basic constants defined in a Java class as Ant properties. - -
-<loadproperties srcfile="foo.class" encoding="ISO-8859-1">
-  <filterchain>
-    <classconstants/>
-  </filterchain>
-</loadproperties>
-
- -This loads the constants from a Java class file as Ant properties, -prepending the names with a prefix. - -
-<loadproperties srcfile="build/classes/org/acme/bar.class"
-                encoding="ISO-8859-1">
-  <filterchain>
-    <classconstants/>
-    <prefixlines prefix="ini."/>
-  </filterchain>
-</loadproperties>
-
-

EscapeUnicode

-

-This filter converts its input by changing all non US-ASCII characters -into their equivalent unicode escape backslash u plus 4 digits.

- -

since Ant 1.6

- -

Example:

- -This loads the basic constants defined in a Java class as Ant properties. -
-<loadproperties srcfile="non_ascii_property.properties">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.EscapeUnicode"/>
-  </filterchain>
-</loadproperties>
-
- -Convenience method: -
-<loadproperties srcfile="non_ascii_property.properties">
-  <filterchain>
-    <escapeunicode/>
-  </filterchain>
-</loadproperties>
-
- -

ExpandProperties

-

-If the data contains data that represents Ant -properties (of the form ${...}), that is substituted -with the property's actual value. -

-

Example:

- -This results in the property modifiedmessage holding the value -"All these moments will be lost in time, like teardrops in the rain" -
-<echo
-  message="All these moments will be lost in time, like teardrops in the ${weather}"
-  file="loadfile1.tmp"
-  />
-<property name="weather" value="rain"/>
-<loadfile property="modifiedmessage" srcFile="loadfile1.tmp">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.ExpandProperties"/>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<echo
-  message="All these moments will be lost in time, like teardrops in the ${weather}"
-  file="loadfile1.tmp"
-  />
-<property name="weather" value="rain"/>
-<loadfile property="modifiedmessage" srcFile="loadfile1.tmp">
-  <filterchain>
-    <expandproperties/>
-  </filterchain>
-</loadfile>
-
- -

As of Ant 1.8.3, a nested - PropertySet can be specified: - -

-<property name="weather" value="rain"/>
-<loadfile property="modifiedmessage" srcFile="loadfile1.tmp">
-  <filterchain>
-    <expandproperties>
-      <propertyset>
-        <propertyref name="weather" />
-      </propertyset>
-    </expandproperties>
-  </filterchain>
-</loadfile>
-
- -

HeadFilter

- -This filter reads the first few lines from the data supplied to it. - - - - - - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
linesNumber of lines to be read. - Defaults to "10"
A negative value means that all lines are - passed (useful with skip)
No
skipNumber of lines to be skipped (from the beginning). - Defaults to "0"No
-

-

Example:

- -This stores the first 15 lines of the supplied data in the property src.file.head -
-<loadfile srcfile="${src.file}" property="src.file.head">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
-      <param name="lines" value="15"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<loadfile srcfile="${src.file}" property="src.file.head">
-  <filterchain>
-    <headfilter lines="15"/>
-  </filterchain>
-</loadfile>
-
- -This stores the first 15 lines, skipping the first 2 lines, of the supplied data -in the property src.file.head. (Means: lines 3-17) -
-<loadfile srcfile="${src.file}" property="src.file.head">
-  <filterchain>
-    <headfilter lines="15" skip="2"/>
-  </filterchain>
-</loadfile>
-
- -See the testcases for more examples (src\etc\testcases\filters\head-tail.xml in the -source distribution). - -

LineContains

- -This filter includes only those lines that contain all the user-specified -strings. - - - - - - - - - - - - - - - - - -
Parameter TypeParameter ValueRequired
containsSubstring to be searched for.Yes
negateWhether to select - non-matching lines only. Since Ant 1.7No
-

-

Example:

- -This will include only those lines that contain foo and -bar. -
-<filterreader classname="org.apache.tools.ant.filters.LineContains">
-  <param type="contains" value="foo"/>
-  <param type="contains" value="bar"/>
-</filterreader>
-
- -Convenience method: -
-<linecontains>
-  <contains value="foo"/>
-  <contains value="bar"/>
-</linecontains>
-
- -Negation: -
-<filterreader classname="org.apache.tools.ant.filters.LineContains">
-  <param type="negate" value="true"/>
-  <param type="contains" value="foo"/>
-  <param type="contains" value="bar"/>
-</filterreader>
-
-or -
-<linecontains negate="true">
-  <contains value="foo"/>
-  <contains value="bar"/>
-</linecontains>
-
- -

LineContainsRegExp

- -Filter which includes only those lines that contain the user-specified -regular expression matching strings. - - - - - - - - - - - - - - - - - - - - - - -
Parameter TypeParameter ValueRequired
regexpRegular expression to be searched for.Yes
negateWhether to select - non-matching lines only. Since Ant 1.7No
casesensitivePerform a case sensitive - match. Default is true. Since Ant 1.8.2No
- -See Regexp Type for the description of the nested element regexp and of -the choice of regular expression implementation. -

Example:

- -This will fetch all those lines that contain the pattern foo -
-<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
-  <param type="regexp" value="foo*"/>
-</filterreader>
-
- -Convenience method: -
-<linecontainsregexp>
-  <regexp pattern="foo*"/>
-</linecontainsregexp>
-
- -Negation: -
-<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
-  <param type="negate" value="true"/>
-  <param type="regexp" value="foo*"/>
-</filterreader>
-
-or -
-<linecontainsregexp negate="true">
-  <regexp pattern="foo*"/>
-</linecontainsregexp>
-
- -

PrefixLines

- -Attaches a prefix to every line. - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
prefixPrefix to be attached to lines.Yes
-

-

Example:

- -This will attach the prefix Foo to all lines. -
-<filterreader classname="org.apache.tools.ant.filters.PrefixLines">
-  <param name="prefix" value="Foo"/>
-</filterreader>
-
- -Convenience method: -
-<prefixlines prefix="Foo"/>
-
- -

SuffixLines

- -Attaches a suffix to every line. - -

since Ant 1.8.0

- - - - - - - - - - - - -
Parameter NameParameter ValueRequired
suffixSuffix to be attached to lines.Yes
-

-

Example:

- -This will attach the suffix Foo to all lines. -
-<filterreader classname="org.apache.tools.ant.filters.SuffixLines">
-  <param name="suffix" value="Foo"/>
-</filterreader>
-
- -Convenience method: -
-<suffixlines suffix="Foo"/>
-
- -

ReplaceTokens

- -This filter reader replaces all strings that are -sandwiched between begintoken and endtoken with -user defined values. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter TypeParameter NameParameter ValueRequired
tokencharbegintokenString marking the - beginning of a token. Defaults to @No
tokencharendtokenString marking the - end of a token. Defaults to @No
User defined String.tokenUser defined search String.Yes
Not applicable.propertiesfileProperties file to take tokens from.No
Not applicable.propertiesResourceProperties resource to take tokens from. - Note this only works is you use the - "convenience" <replacetokens> syntax. - since Ant 1.8.0No
User defined String.valueReplace-value for the tokenNo
-

- -

Example:

- -This replaces occurrences of the string @DATE@ in the data -with today's date and stores it in the property ${src.file.replaced}. -
-<tstamp/>
-<!-- just for explaining the use of the properties -->
-<property name="src.file" value="orders.csv"/>
-<property name="src.file.replaced" value="orders.replaced"/>
-
-<!-- do the loading and filtering -->
-<loadfile srcfile="${src.file}" property="${src.file.replaced}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
-      <param type="token" name="DATE" value="${TODAY}"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
-<!-- just for explaining the use of the properties -->
-<echo message="${orders.replaced}"/>
-
- -Convenience method: -
-<tstamp/>
-<loadfile srcfile="${src.file}" property="${src.file.replaced}">
-  <filterchain>
-    <replacetokens>
-      <token key="DATE" value="${TODAY}"/>
-    </replacetokens>
-  </filterchain>
-</loadfile>
-
- -This replaces occurrences of the string {{DATE}} in the data -with today's date and stores it in the property ${src.file.replaced}. -
-<loadfile srcfile="${src.file}" property="${src.file.replaced}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
-      <param type="tokenchar" name="begintoken" value="{{"/>
-      <param type="tokenchar" name="endtoken" value="}}"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<tstamp/>
-<loadfile srcfile="${src.file}" property="${src.file.replaced}">
-  <filterchain>
-    <replacetokens begintoken="{{" endtoken="}}">
-      <token key="DATE" value="${TODAY}"/>
-    </replacetokens>
-  </filterchain>
-</loadfile>
-
- -This will treat each properties file entry in sample.properties as a token/key pair : -
-<loadfile srcfile="${src.file}" property="${src.file.replaced}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
-      <param type="propertiesfile" value="sample.properties"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -This reads the properties from an Ant resource referenced by its id: -
-<string id="embedded-properties">
-foo=bar
-baz=xyzzy
-</string>
-<loadfile srcfile="${src.file}" property="${src.file.replaced}">
-  <filterchain>
-    <replacetokens propertiesResource="${ant.refid:embedded-properties}"/>
-  </filterchain>
-</loadfile>
-
- -

StripJavaComments

- -This filter reader strips away comments from the data, -using Java syntax guidelines. This filter does not -take in any parameters. -

-

Example:

- -
-<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}">
-  <filterchain>
-    <stripjavacomments/>
-  </filterchain>
-</loadfile>
-
- -

StripLineBreaks

- -This filter reader strips away specific characters -from the data supplied to it. - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
linebreaksCharacters that are to - be stripped out. Defaults to "\r\n"No
-

-

Examples:

- -This strips the '\r' and '\n' characters. -
-<loadfile srcfile="${src.file}" property="${src.file.contents}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<loadfile srcfile="${src.file}" property="${src.file.contents}">
-  <filterchain>
-    <striplinebreaks/>
-  </filterchain>
-</loadfile>
-
- -This treats the '(' and ')' characters as line break characters and -strips them. -
-<loadfile srcfile="${src.file}" property="${src.file.contents}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks">
-      <param name="linebreaks" value="()"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -

StripLineComments

- -This filter removes all those lines that begin with strings -that represent comments as specified by the user. - - - - - - - - - - - - -
Parameter TypeParameter ValueRequired
commentStrings that identify a line as a comment - when they appear at the start of the line.Yes
-

-

Examples:

- -This removes all lines that begin with #, --, REM, rem and // -
-<filterreader classname="org.apache.tools.ant.filters.StripLineComments">
-  <param type="comment" value="#"/>
-  <param type="comment" value="--"/>
-  <param type="comment" value="REM "/>
-  <param type="comment" value="rem "/>
-  <param type="comment" value="//"/>
-</filterreader>
-
- -Convenience method: -
-<striplinecomments>
-  <comment value="#"/>
-  <comment value="--"/>
-  <comment value="REM "/>
-  <comment value="rem "/>
-  <comment value="//"/>
-</striplinecomments>
-
- -

TabsToSpaces

- -This filter replaces tabs with spaces - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
tablengthDefaults to "8"No
-

-

Examples:

- -This replaces tabs in ${src.file} with spaces. -
-<loadfile srcfile="${src.file}" property="${src.file.notab}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.TabsToSpaces"/>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<loadfile srcfile="${src.file}" property="${src.file.notab}">
-  <filterchain>
-    <tabstospaces/>
-  </filterchain>
-</loadfile>
-
- -

TailFilter

- -This filter reads the last few lines from the data supplied to it. - - - - - - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
linesNumber of lines to be read. - Defaults to "10"
A negative value means that all lines are - passed (useful with skip)
No
skipNumber of lines to be skipped (from the end). - Defaults to "0" No
-

- -

Background:

-With HeadFilter and TailFilter you can extract each part of a text file you want. -This graphic shows the dependencies: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Content Filter
Line 1     - - - - - - - - - - - - - - - - - - - - - -
 
<filterchain>
-    <headfilter lines="2"/>
-</filterchain>
 
<filterchain>
-    <tailfilter lines="-1" skip="2"/>
-</filterchain>
 
<filterchain>
-    <headfilter lines="-1" skip="2"/>
-</filterchain>
 
<filterchain>
-    <headfilter lines="-1" skip="2"/>
-    <tailfilter lines="-1" skip="2"/>
-</filterchain>
 
<filterchain>
-    <tailfilter lines="2"/>
-</filterchain>
-
Line 2
Line 3  
Line 4
Line 5  
Lines ...
Line 95
Line 96  
Line 97
Line 98  
Line 99
- - - -

Examples:

- -This stores the last 15 lines of the supplied data in the property ${src.file.tail} -
-<loadfile srcfile="${src.file}" property="${src.file.tail}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.TailFilter">
-      <param name="lines" value="15"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<loadfile srcfile="${src.file}" property="${src.file.tail}">
-  <filterchain>
-    <tailfilter lines="15"/>
-  </filterchain>
-</loadfile>
-
- - -This stores the last 5 lines of the first 15 lines of the supplied -data in the property ${src.file.mid} -
-<loadfile srcfile="${src.file}" property="${src.file.mid}">
-  <filterchain>
-    <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
-      <param name="lines" value="15"/>
-    </filterreader>
-    <filterreader classname="org.apache.tools.ant.filters.TailFilter">
-      <param name="lines" value="5"/>
-    </filterreader>
-  </filterchain>
-</loadfile>
-
- -Convenience method: -
-<loadfile srcfile="${src.file}" property="${src.file.mid}">
-  <filterchain>
-    <headfilter lines="15"/>
-    <tailfilter lines="5"/>
-  </filterchain>
-</loadfile>
-
- - -This stores the last 10 lines, skipping the last 2 lines, of the supplied data -in the property src.file.head. (Means: if supplied data contains 60 lines, -lines 49-58 are extracted) -
-<loadfile srcfile="${src.file}" property="src.file.head">
-  <filterchain>
-    <tailfilter lines="10" skip="2"/>
-  </filterchain>
-</loadfile>
-
- -

DeleteCharacters

- -

This filter deletes specified characters.

-

since Ant 1.6

-

This filter is only available in the convenience form.

- - - - - - - - - - - - -
Parameter NameParameter ValueRequired
chars - The characters to delete. This attribute is - backslash enabled. - Yes
-

-

Examples:

- -Delete tabs and returns from the data. -
-<deletecharacters chars="\t\r"/>
-
- -

ConcatFilter

-

This filter prepends or appends the content file to the filtered files.

-

since Ant 1.6

- - - - - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
prepend - The name of the file which content should be prepended to the file. - No
append - The name of the file which content should be appended to the file. - No
-

- -

Examples:

- -Do nothing: -
-<filterchain>
-    <concatfilter/>
-</filterchain>
-
- -Adds a license text before each java source: -
-<filterchain>
-    <concatfilter prepend="apache-license-java.txt"/>
-</filterchain>
-
- - - -

TokenFilter

-This filter tokenizes the inputstream into strings and passes these -strings to filters of strings. Unlike the other filterreaders, this does -not support params, only convenience methods are implemented. -The tokenizer and the string filters are defined by nested elements. -

since Ant 1.6

-

-Only one tokenizer element may be used, the LineTokenizer is the -default if none are specified. A tokenizer -splits the input into token strings and trailing delimiter strings. -

-There may be zero or more string filters. A string filter processes -a token and either returns a string or a null. -It the string is not null it is passed to the next filter. This -proceeds until all the filters are called. -If a string is returned after all the filters, the string is -outputs with its associated token delimiter -(if one is present). -The trailing delimiter may be overridden by the delimOutput -attribute. -

-backslash interpretation -A number of attributes (including delimOutput) interpret -backslash escapes. The following are understood: \n, \r, \f, \t -and \\. - - - - - - - - - - - - - -
AttributeDescriptionRequired
delimOutput - This overrides the tokendelimiter - returned by the tokenizer if it is not empty. This - attribute is backslash enabled. -No
-

- - The following tokenizers are provided by the default distribution. -

- LineTokenizer
- FileTokenizer
- StringTokenizer
-

- - The following string filters are provided by the default distribution. -

- ReplaceString
- ContainsString
- ReplaceRegex
- ContainsRegex
- Trim
- IgnoreBlank
- DeleteCharacters
- UniqFilter
-

- - The following string filters are provided by the optional distribution. -

- ScriptFilter
-

- -Some of the filters may be used directly within a filter chain. In this -case a tokenfilter is created implicitly. An extra attribute "byline" -is added to the filter to specify whether to use a linetokenizer -(byline="true") or a filetokenizer (byline="false"). The default -is "true". -

- -

LineTokenizer

-This tokenizer splits the input into lines. -The tokenizer delimits lines -by "\r", "\n" or "\r\n". -This is the default tokenizer. - - - - - - - - - - - -
AttributeDescriptionRequired
includeDelims - Include the line endings in the token. - Default is false. - No
-

Examples:

- -Convert input current line endings to unix style line endings. -
-<tokenfilter delimoutput="\n"/>
-
- - -Remove blank lines. -
-<tokenfilter>
-    <ignoreblank/>
-</tokenfilter>
-
-
- -

FileTokenizer

-This tokenizer treats all the input as a token. So be -careful not to use this on very large input. -

Examples:

- -Replace the first occurrence of package with //package. -
-<tokenfilter>
-      <filetokenizer/>
-      <replaceregex pattern="([\n\r]+[ \t]*|^[ \t]*)package"
-                    flags="s"
-                    replace="\1//package"/>
-</tokenfilter>
-
- -

StringTokenizer

-This tokenizer is based on java.util.StringTokenizer. -It splits up the input into strings separated by white space, or -by a specified list of delimiting characters. -If the stream starts with delimiter characters, the first -token will be the empty string (unless the delimsaretokens -attribute is used). - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
delimsThe delimiter characters. White space - is used if this is not set. (White space is defined - in this case by java.lang.Character.isWhitespace()). - No
delimsaretokensIf this is true, - each delimiter character is returned as a token. - Default is false. - No
suppressdelims - If this is true, delimiters are not returned. - Default is false. - No
includeDelims - Include the delimiters in the token. - Default is false. - No
- -

Examples:

- -Surround each non space token with a "[]". - -
-<tokenfilter>
-    <stringtokenizer/>
-    <replaceregex pattern="(.+)" replace="[\1]"/>
-</tokenfilter>
-
-
- -

ReplaceString

-This is a simple filter to replace strings. -This filter may be used directly within a filterchain. - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
fromThe string that must be replaced.Yes
toThe new value for the replaced string. When omitted - an empty string is used. - No
- -

Examples:

- -Replace "sun" with "moon". - -
-<tokenfilter>
-    <replacestring from="sun" to="moon"/>
-</tokenfilter>
-
- -

ContainsString

-This is a simple filter to filter tokens that contains -a specified string. - - - - - - - - - - - - -
AttributeDescriptionRequired
containsThe string that the token must contain.Yes
- -

Examples:

- -Include only lines that contain "foo"; - -
-<tokenfilter>
-    <containsstring contains="foo"/>
-</tokenfilter>
-
-
- -

ReplaceRegex

-This string filter replaces regular expressions. -This filter may be used directly within a filterchain. -

- See Regexp Type -concerning the choice of the implementation. -

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
patternThe regular expression pattern to match in - the token.Yes
replaceThe substitution pattern to replace the matched - regular expression. When omitted an empty string is used.No
flagsSee -ReplaceRegexp -for an explanation of regex flags.No
-

Examples:

- -Replace all occurrences of "hello" with "world", ignoring case. - -
-<tokenfilter>
-    <replaceregex pattern="hello" replace="world" flags="gi"/>
-</tokenfilter>
-
-
- -

ContainsRegex

-This filters strings that match regular expressions. -The filter may optionally replace the matched regular expression. -This filter may be used directly within a filterchain. -

-See -Regexp Type -concerning the choice of regular expression implementation. -

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
patternThe regular expression pattern to match in - the token.Yes
replaceThe substitution pattern to replace the matched - regular expression. When omitted the original token is returned. - No
flagsSee -ReplaceRegexp -for an explanation of regex flags.No
- -

Examples:

- -Filter lines that contain "hello" or "world", ignoring case. - -
-<tokenfilter>
-    <containsregex pattern="(hello|world)" flags="i"/>
-</tokenfilter>
-
-
- -This example replaces lines like "SUITE(TestSuite, bits);" with -"void register_bits();" and removes other lines. - -
-<tokenfilter>
-    <containsregex
-        pattern="^ *SUITE\(.*,\s*(.*)\s*\).*"
-        replace="void register_\1();"/>
-</tokenfilter>
-
- -

Trim

-This filter trims whitespace from the start and end of -tokens. -This filter may be used directly within a filterchain. -

IgnoreBlank

-This filter removes empty tokens. -This filter may be used directly within a filterchain. -

DeleteCharacters

-This filter deletes specified characters from tokens. - - - - - - - - - - - - -
AttributeDescriptionRequired
charsThe characters to delete. This attribute - is backslash enabled.Yes
- -

Examples:

- -Delete tabs from lines, trim the lines and removes empty lines. - -
-<tokenfilter>
-    <deletecharacters chars="\t"/>
-    <trim/>
-    <ignoreblank/>
-</tokenfilter>
-
-
- -

UniqFilter

- -

Suppresses all tokens that match their ancestor token. It is most - useful if combined with a sort filter.

- -

This filter may be used directly within a filterchain.

- -

Example:

- -This suppresses duplicate lines. -
-<tokenfilter>
-  <uniqfilter/>
-</tokenfilter>
-
- -

ScriptFilter

-This is an optional filter that executes a script in a -Apache BSF - or - JSR 223 -supported language.

-See the Script task for -an explanation of scripts and dependencies. -

-

-The script is provided with an object self that has -getToken() and setToken(String) methods. -The getToken() method returns the current token. The setToken(String) -method replaces the current token. -

- -This filter may be used directly within a filterchain.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
language The programming language the script is written in. -Must be a supported Apache BSF or JSR 223 languageYes
manager - The script engine manager to use. - See the script task - for using this attribute. - No - default is "auto"
srcThe location of the script as a file, if not inline - No
setbeanswhether to have all properties, references and targets as - global variables in the script. since Ant 1.8.0No, default is "true".
classpath - The classpath to pass into the script. - No
classpathrefThe classpath to use, given as a - reference to a path defined elsewhere. - No
-

- This filter can take a nested <classpath> element. - See the script task - on how to use this element. -

-

Examples:

- -Convert to uppercase: -
-<tokenfilter>
-    <scriptfilter language="javascript">
-        self.setToken(self.getToken().toUpperCase());
-    </scriptfilter>
-</tokenfilter>
-
- -Remove lines containing the string "bad" while -copying text files: -
-
-<copy todir="dist">
-  <fileset dir="src" includes="**/*.txt"/>
-  <filterchain>
-    <scriptfilter language="beanshell">
-        if (self.getToken().indexOf("bad") != -1) {
-            self.setToken(null);
-        }
-    </scriptfilter>
-  </filterchain>
-</copy>
-    
-
- -

Custom tokenizers and string filters

- -Custom string filters and tokenizers may be plugged in by -extending the interfaces org.apache.tools.ant.filters.TokenFilter.Filter -and org.apache.tools.ant.util.Tokenizer respectly. - -They are defined the build file using <typedef/>. For -example a string filter that capitalizes words may be declared as: -
-package my.customant;
-import org.apache.tools.ant.filters.TokenFilter;
-
-public class Capitalize
-    implements TokenFilter.Filter
-{
-    public String filter(String token) {
-        if (token.length() == 0)
-            return token;
-        return token.substring(0, 1).toUpperCase() +
-                token.substring(1);
-   }
-}
-
- -This may be used as follows: -
-  <typedef name="capitalize" classname="my.customant.Capitalize"
-           classpath="my.customant.path"/>
-  <copy file="input" tofile="output">
-    <filterchain>
-      <tokenfilter>
-        <stringtokenizer/>
-        <capitalize/>
-      </tokenfilter>
-    </filterchain>
-  </copy>
-
- - -

SortFilter

-

since Ant 1.8.0

- -

The sort filter reads all lines and sorts them. The sort order can - be reversed and it is possible to specify a custom implementation of - the java.util.Comparator interface to get even more - control.

- - - - - - - - - - - - - - - - - -
Parameter NameParameter ValueRequired
reversewhether to reverse the sort order, - defaults to false. Note: this parameter is ignored if - the comparator parameter is present as well.No
comparatorClass name of a class that - implements java.util.Comparator for Strings. This - class will be used to determine the sort order of lines.No
- -

This filter is also available using the - name sortfilter. The reverse parameter - becomes an attribute, comparator can be specified by - using a nested element.

- -

Examples:

- -
-  <copy todir="build">
-      <fileset dir="input" includes="*.txt"/>
-      <filterchain>
-          <sortfilter/>
-      </filterchain>
-  </copy>
-
- -

-Sort all files *.txt from src location -into build location. The lines of each file are sorted in -ascendant order comparing the lines via the -String.compareTo(Object o) method. -

- -
-  <copy todir="build">
-      <fileset dir="input" includes="*.txt"/>
-      <filterchain>
-          <sortfilter reverse="true"/>
-      </filterchain>
-  </copy>
-
- -

-Sort all files *.txt from src location into reverse -order and copy them into build location. -

- -
-  <copy todir="build">
-      <fileset dir="input" includes="*.txt"/>
-      <filterchain>
-          <filterreader classname="org.apache.tools.ant.filters.SortFilter">
-            <param name="comparator" value="org.apache.tools.ant.filters.EvenFirstCmp"/>
-          </filterreader>
-      </filterchain>
-  </copy>
-
- -

-Sort all files *.txt from src location using as -sorting criterium EvenFirstCmp class, that sorts the file -lines putting even lines first then odd lines for example. The modified files -are copied into build location. The EvenFirstCmp, -has to an instanciable class via Class.newInstance(), -therefore in case of inner class has to be static. It also has to -implement java.util.Comparator interface, for example: -

- -
-        package org.apache.tools.ant.filters;
-        ...(omitted)
-          public final class EvenFirstCmp implements <b>Comparator</b> {
-            public int compare(Object o1, Object o2) {
-            ...(omitted)
-            }
-          }
-
- -

The example above is equivalent to:

- -
-  <componentdef name="evenfirst"
-                classname="org.apache.tools.ant.filters.EvenFirstCmp"/>
-  <copy todir="build">
-      <fileset dir="input" includes="*.txt"/>
-      <filterchain>
-          <sortfilter>
-              <evenfirst/>
-          </sortfilter>
-      </filterchain>
-  </copy>
-
- - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/filterset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/filterset.html deleted file mode 100644 index 8b0dfe18..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/filterset.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - -FilterSet Type - - - -

FilterSet

- -

FilterSets are groups of filters. Filters can be defined as token-value -pairs -or be read in from a file. FilterSets can appear inside tasks that support this -feature or at the same level as <target> - i.e., as -children of -<project>.

- -

FilterSets support the id and refid -attributes. You can define a FilterSet with an id -attribute and then refer to that definition from another FilterSet -with a refid attribute. It is also possible to nest -filtersets into filtersets to get a set union of the contained -filters.

- -

In addition, FilterSets can specify -begintoken and/or -endtoken attributes to define what to match.

-

Filtersets are used for doing -replacements in tasks such as <copy>, etc.

- -

Filters can also by specified by one or more nested propertysets, the - contents of which are applied when the filterset is created.

- -

If you specify multiple values for the same token, the last one - defined within a filterset will be used.

- -

-Note: When a filterset is used in an operation, the files are -processed in text mode and the filters applied line by line. This means that -the copy operations will typically corrupt binary files. When applying filters -you should ensure that the set of files being filtered are all text files. -

- -

Filterset

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionDefaultRequired
begintokenThe string marking the beginning of a token (eg., - @DATE@).@No
endtokenThe string marking the end of a token (eg., - @DATE@).@No
filtersfileSpecify a single filtersfile.noneNo
recurseIndicates whether the replacement text of tokens - should be searched for more tokens. Since Ant 1.6.3trueNo
onmissingfiltersfileIndicate behavior when a nonexistent filtersfile - is specified. One of "fail", "warn", "ignore". Since Ant 1.7"fail"No
- -

Filter

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
tokenThe token to replace (eg., @DATE@)Yes
valueThe value to replace it with - (eg., Thursday, April 26, 2001).Yes
- -

Filtersfile

- - - - - - - - - - - -
AttributeDescriptionRequired
fileA properties file of - name-value pairs from which to load the tokens.Yes
- -

Examples

- -

You are copying the version.txt file to the dist -directory from the build directory -but wish to replace the token @DATE@ with today's date.

-
-<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt">
-  <filterset>
-    <filter token="DATE" value="${TODAY}"/>
-  </filterset>
-</copy>
-
- -

You are copying the version.txt file to the dist -directory from the build directory -but wish to replace the token %DATE* with today's date.

-
-<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt">
-  <filterset begintoken="%" endtoken="*">
-    <filter token="DATE" value="${TODAY}"/>
-  </filterset>
-</copy>
-
- -

Copy all the docs but change all dates and appropriate notices as stored in a file.

-
-<copy toDir="${dist.dir}/docs">
-  <fileset dir="${build.dir}/docs">
-    <include name="**/*.html">
-  </fileset>
-  <filterset begintoken="%" endtoken="*">
-    <filtersfile file="${user.dir}/dist.properties"/>
-  </filterset>
-</copy>
-
- -

Define a FilterSet and reference it later.

-
-<filterset id="myFilterSet" begintoken="%" endtoken="*">
-  <filter token="DATE" value="${TODAY}"/>
-</filterset>
-
-<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt">
-  <filterset refid="myFilterSet"/>
-</copy>
-
- -

You are copying the version.txt file to the dist -directory from the build directory -but wish to replace the token @project.date@ with the property of the same name.

-
-<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt">
-  <filterset>
-    <propertyset>
-      <propertyref name="project.date"/>
-    </propertyset>
-  </filterset>
-</copy>
-
- diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/mapper.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/mapper.html deleted file mode 100644 index 5aff311e..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/mapper.html +++ /dev/null @@ -1,972 +0,0 @@ - - - - - - -Mapper Type - - - - -

Mapping File Names

-

Some tasks take source files and create target files. Depending on -the task, it may be quite obvious which name a target file will have -(using javac, you know there will be -.class files for your .java files) - in -other cases you may want to specify the target files, either to help -Apache Ant or to get an extra bit of functionality.

-

While source files are usually specified as filesets, you don't specify target files directly - -instead, you tell Ant how to find the target file(s) for one source file. An -instance of org.apache.tools.ant.util.FileNameMapper is -responsible for this. It constructs target file names based on rules -that can be parameterized with from and to -attributes - the exact meaning of which is implementation-dependent.

-

These instances are defined in <mapper> elements -with the following attributes:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
typespecifies one of the built-in implementations.Exactly one of these
classnamespecifies the implementation by class name.
classpaththe classpath to use when looking up - classname.No
classpathrefthe classpath to use, given as reference to a path defined elsewhere.No
fromthe from attribute for the given - implementation.Depends on implementation.
tothe to attribute for the given - implementation.Depends on implementation.
-

Note that Ant will not automatically convert / or \ characters in -the to and from attributes to the correct -directory separator of your current platform. If you need to specify -this separator, use ${file.separator} instead. - For the regexpmapper, ${file.separator} will not work, -as on windows it is the '\' character, and this is an escape character -for regular expressions, one should use the handledirsep attribute -instead. -

-

Parameters specified as nested elements

-

The classpath can be specified via a nested -<classpath>, as well - that is, -a path-like structure.

-

Since Ant 1.7.0, nested File Mappers can -be supplied via either <mapper> elements or -<typedef>'d -implementations of org.apache.tools.ant.util.FileNameMapper. -If nested File Mappers are specified by either means, the mapper will be -implicitly configured as a composite mapper. -

-
-

The built-in mapper types are:

-

All built-in mappers are case-sensitive.

-

As of Ant 1.7.0, each of the built-in mapper implementation - types is directly accessible using a specific tagname. This makes it - possible for filename mappers to support attributes in addition to - the generally available to and from.
- The <mapper type|classname="..."> usage - form remains valid for reasons of backward compatibility.

- - - - - -

identity

-

The target file name is identical to the source file name. Both -to and from will be ignored.

-Examples: -
-<mapper type="identity"/>
-<identitymapper/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java
foo/bar/B.javafoo/bar/B.java
C.propertiesC.properties
Classes/dir/dir2/A.propertiesClasses/dir/dir2/A.properties
- - - - - -

flatten

-

The target file name is identical to the source file name, with all -leading directory information stripped off. Both to and -from will be ignored.

-Examples: -
-<mapper type="flatten"/>
-<flattenmapper/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java
foo/bar/B.javaB.java
C.propertiesC.properties
Classes/dir/dir2/A.propertiesA.properties
- - - - - -

merge

-

The target file name will always be the same, as defined by -to - from will be ignored.

-
Examples:
-
-<mapper type="merge" to="archive.tar"/>
-<mergemapper to="archive.tar"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaarchive.tar
foo/bar/B.javaarchive.tar
C.propertiesarchive.tar
Classes/dir/dir2/A.propertiesarchive.tar
- - - - - -

glob

-

Both to and from are required and define patterns that may -contain at most one *. For each source file that matches -the from pattern, a target file name will be constructed -from the to pattern by substituting the * in -the to pattern with the text that matches the -* in the from pattern. Source file names -that don't match the from pattern will be ignored.

-Examples: -
-<mapper type="glob" from="*.java" to="*.java.bak"/>
-<globmapper from="*.java" to="*.java.bak"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java.bak
foo/bar/B.javafoo/bar/B.java.bak
C.propertiesignored
Classes/dir/dir2/A.propertiesignored
-
-<mapper type="glob" from="C*ies" to="Q*y"/>
-<globmapper from="C*ies" to="Q*y"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaignored
foo/bar/B.javaignored
C.propertiesQ.property
Classes/dir/dir2/A.propertiesQlasses/dir/dir2/A.property
-

- The globmapper mapper can take the following extra attributes. -

- - - - - - - - - - - - - - - -
AttributeDescriptionRequired
casesensitive - If this is false, the mapper will ignore case when matching the glob pattern. - This attribute can be true or false, the default is true. - Since Ant 1.6.3. - No
handledirsep - If this is specified, the mapper will ignore the difference between the normal - directory separator characters - \ and /. - This attribute can be true or false, the default is false. - This attribute is useful for cross-platform build files. - Since Ant 1.6.3. - No
-

- An example: -

-
-      <pathconvert property="x" targetos="unix">
-        <path path="Aj.Java"/>
-        <mapper>
-        <chainedmapper>
-          <flattenmapper/>
-          <globmapper from="a*.java" to="*.java.bak" casesensitive="no"/>
-        </chainedmapper>
-        </mapper>
-      </pathconvert>
-      <echo>x is ${x}</echo>
-    
-

- will output "x is j.java.bak". -

-

- and -

-
-      <pathconvert property="x" targetos="unix">
-        <path path="d/e/f/j.java"/>
-        <mapper>
-          <globmapper from="${basedir}\d/e\*" to="*" handledirsep="yes"/>
-        </mapper>
-      </pathconvert>
-      <echo>x is ${x}</echo>
-    
-

- will output "x is f/j.java". -

- - - - - - -

regexp

- -

Both to and from are required and define -regular expressions. If the source file name (as a whole or in part) -matches the from pattern, the target file name will be -constructed from the -to pattern, using \0 to \9 as -back-references for the full match (\0) or the matches of -the subexpressions in parentheses. The to pattern -determines the whole file name, so if you wanted to -replace the extension of a file you should not use from="\.old$" -to=".new" but rather from="(.*)\.old$" to="\1.new" -(or rather use a glob mapper in this case).

- -

Source files not matching the from pattern will be -ignored.

- -

Note that you need to escape a dollar-sign ($) with -another dollar-sign in Ant.

- -

The regexp mapper needs a supporting library and an implementation -of org.apache.tools.ant.util.regexp.RegexpMatcher that - hides the specifics of the library. Since Ant 1.8.0 Ant - requires Java 1.4 to run, so the implementation based on - the java.util.regex package will always be available. - You can still use the now retired Jakarta ORO or Jakarta Regex instead if your - provide the corresponding jar in your CLASSPATH.

- -

For information about using gnu.regexp or gnu.rex with Ant, see this -article.

- -

If you want to use one of the regular expression - libraries other than java.util.regex you need to also use - the corresponding ant-[apache-oro, apache-regexp].jar -from the Ant release you are using. -Make sure, both will be loaded from the same -classpath, that is either put them into your CLASSPATH, -ANT_HOME/lib directory or a nested -<classpath> element of the mapper - you cannot have -ant-[apache-oro, apache-regexp].jar in ANT_HOME/lib - and the library -in a nested <classpath>.

-

Ant will choose the regular-expression library based on the -following algorithm:

- - -Examples: -
-<mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/>
-<regexpmapper from="^(.*)\.java$$" to="\1.java.bak"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaA.java.bak
foo/bar/B.javafoo/bar/B.java.bak
C.propertiesignored
Classes/dir/dir2/A.propertiesignored
-
-<mapper type="regexp" from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/>
-<regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javaignored
foo/bar/B.javafoo/bar/bar-B.java
C.propertiesignored
Classes/dir/dir2/A.propertiesClasses/dir/dir2/dir2-A.properties
-
-<mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/>
-<regexpmapper from="^(.*)\.(.*)$$" to="\2.\1"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
A.javajava.A
foo/bar/B.javajava.foo/bar/B
C.propertiesproperties.C
Classes/dir/dir2/A.propertiesproperties.Classes/dir/dir2/A
-
-<mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/>
-<regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/>
-
- - - - - - - - - - - - - - - - - - - - - -
Source file nameTarget file name
ClassLoader.classClassLoader.java
java/lang/ClassLoader.classjava/lang/ClassLoader.java
java\lang\ClassLoader$1.classjava\lang\ClassLoader.java
java/lang/ClassLoader$foo$1.classjava/lang/ClassLoader.java
-

- The regexpmapper mapper can take the following extra attributes. -

- - - - - - - - - - - - - - - -
AttributeDescriptionRequired
casesensitive - If this is false, the mapper will ignore case when matching the pattern. - This attribute can be true or false, the default is true. - Since Ant 1.6.3. - No
handledirsep - If this is specified, the mapper will treat a \ character in a filename - as a / for the purposes of matching. - This attribute can be true or false, the default is false. - This attribute is useful for cross-platform build files. - Since Ant 1.6.3. - No
-

- An example: -

-
-      <pathconvert property="x" targetos="unix">
-        <path path="Aj.Java"/>
-        <chainedmapper>
-          <flattenmapper/>
-          <regexpmapper from="a(.*)\.java" to="\1.java.bak" casesensitive="no"/>
-        </chainedmapper>
-      </pathconvert>
-      <echo>x is ${x}</echo>
-    
-

- will output "x is j.java.bak". -

-

- and -

-
-    <pathconvert property="hd.prop" targetos="windows">
-      <path path="d\e/f\j.java"/>
-      <chainedmapper>
-        <regexpmapper from="${basedir}/d/e/(.*)" to="\1" handledirsep="yes"/>
-      </chainedmapper>
-    </pathconvert>
-    
-

- will set hd.prop to "f\j.java". -

- - - - - -

package

-

Sharing the same syntax as the glob mapper, -the package mapper replaces -directory separators found in the matched source pattern with dots in the target -pattern placeholder. This mapper is particularly useful in combination -with <uptodate> and <junit> output.

-

The to and from attributes are both required.

-Example: -
-<mapper type="package" from="*Test.java" to="TEST-*Test.xml"/>
-<packagemapper from="*Test.java" to="TEST-*Test.xml"/>
-
- - - - - - - - - - - - - -
Source file nameTarget file name
org/apache/tools/ant/util/PackageMapperTest.javaTEST-org.apache.tools.ant.util.PackageMapperTest.xml
org/apache/tools/ant/util/Helper.javaignored
- - - - - -

unpackage (since Ant 1.6.0)

-

This mapper is the inverse of the package mapper. - It replaces the dots in a package name with directory separators. This - is useful for matching XML formatter results against their JUnit test - test cases. The mapper shares the sample syntax - as the glob mapper. -

-

The to and from attributes are both required.

-Example: -
-<mapper type="unpackage" from="TEST-*Test.xml" to="${test.src.dir}/*Test.java">
-<unpackagemapper from="TEST-*Test.xml" to="${test.src.dir}/*Test.java">
-
- - - - - - - - - -
Source file nameTarget file name
TEST-org.acme.AcmeTest.xml${test.src.dir}/org/acme/AcmeTest.java
- - - - - -

composite (since Ant 1.7.0)

-

This mapper implementation can contain multiple nested mappers. - File mapping is performed by passing the source filename to each nested - <mapper> in turn, returning all results. - The to and from attributes are ignored.

-

Starting with Ant 1.8.0 the order of the mapped results is the - same as the order of the nested mappers; prior to Ant 1.8.0 the - order has been undefined.

-Examples: -
-<compositemapper>
-  <identitymapper/>
-  <packagemapper from="*.java" to="*"/>
-</compositemapper>
-
- - - - - - - - - - - - -
Source file nameTarget file names
foo/bar/A.javafoo/bar/A.java
foo.bar.A
-

The composite mapper has no corresponding - <mapper type> attribute. -

- - - - - -

chained (since Ant 1.7.0)

-

This mapper implementation can contain multiple nested mappers. - File mapping is performed by passing the source filename to the first - nested mapper, its results to the second, and so on. The target filenames - generated by the last nested mapper comprise the ultimate results of the - mapping operation. The to and from attributes are ignored.

-Examples: -
-<chainedmapper>
-  <flattenmapper/>
-  <globmapper from="*" to="new/path/*"/>
-  <mapper>
-    <globmapper from="*" to="*1"/>
-    <globmapper from="*" to="*2"/>
-  </mapper>
-</chainedmapper>
-
- - - - - - - - - - - - - - - - - - - -
Source file nameTarget file names
foo/bar/A.javanew/path/A.java1
new/path/A.java2
boo/far/B.javanew/path/B.java1
new/path/B.java2
-

The chained mapper has no corresponding - <mapper type> attribute. -

- - - - - -

filtermapper (since Ant 1.6.3)

-

- This mapper implementation applies a filterchain - to the source file name. -

-Examples: -
-<filtermapper>
-  <replacestring from="\" to="/"/>
-</filtermapper>
-
- - - - - - - - - - -
Source file nameTarget file names
foo\bar\A.javafoo/bar/A.java
-
-<filtermapper>
-  <scriptfilter language="beanshell">
-    self.setToken(self.getToken().toUpperCase());
-  </scriptfilter>
-</filtermapper>
-
- - - - - - - - - - -
Source file nameTarget file names
foo\bar\A.javaFOO\BAR\A.JAVA
- -

The filtermapper has no corresponding - <mapper type> attribute. -

- - - - - -

scriptmapper (since Ant 1.7)

-

-This mapper executes a script written in Apache BSF -or - JSR 223 -supported language, once per file to map.

-The script can be declared inline or in a specified file. -

-

-See the Script task for -an explanation of scripts and dependencies. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
language - Scripting language - Yes
manager - The script engine manager to use. - See the script task - for using this attribute. - No - default is "auto"
src - File containing the script - No
setbeanswhether to have all properties, references and targets as - global variables in the script. since Ant 1.8.0No, default is "true".
classpath - The classpath to pass into the script. - No
classpathrefThe classpath to use, given as a - reference to a path defined elsewhere. - No
-

- This filename mapper can take a nested <classpath> element. - See the script task - on how to use this element. -

- -

- Example: -

-
-<scriptmapper language="javascript">
-  self.addMappedName(source.toUpperCase());
-  self.addMappedName(source.toLowerCase());
-</scriptmapper>
-
- - - - - - - - - - - - - -
Source file nameTarget file names
foo\bar\A.javaFOO\BAR\A.JAVA
foo\bar\a.java
- -

-To use this mapper, the scripts need access to the source file, -and the ability to return multiple mappings. Here are the relevant beans and -their methods. The script is called once for every source file, with the -list of mapped names reset after every invocation. - - - - - - - - - - - - - - - - - - - - - - -
Script beanDescription
source: String - The file/path to map -
self - the scriptmapper itself -
self.addMappedName(String name) - Add a new mapping -
self.clear() - Reset the list of files. -
- -

The scriptmapper has no corresponding - <mapper type> attribute. -

- -

firstmatchmapper (since Ant 1.8.0)

-

- This mapper supports an arbitrary number of nested mappers and - returns the results of the first mapper that matches. This is - different from composite mapper - which collects the results of all matching children.

-Examples: -
-<firstmatchmapper>
-  <globmapper from="*.txt" to="*.bak"/>
-  <globmapper from="*A.*" to="*B.*"/>
-</firstmatchmapper>
-
- - - - - - - - - - - - - - -
Source file nameTarget file names
foo/bar/A.txtfoo/bar/A.bak
foo/bar/A.javafoo/bar/B.java
- -

The firstmatchmapper has no corresponding - <mapper type> attribute. -

- -

cutdirsmapper (since Ant 1.8.2)

- -

This mapper strips a configured number of leading directories from - the source file name.

- -Examples: -
-<cutdirsmapper dirs="1"/>
-
- - - - - - - - - - -
Source file nameTarget file names
foo/bar/A.txtbar/A.txt
- -

The cutdirsmapper has no -corresponding <mapper type> attribute.

- - - - - - - - - - - - -
AttributeDescriptionRequired
dirs - Number of directories to strip (must be a positive number). - Yes
- - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/multirootfileset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/multirootfileset.html deleted file mode 100644 index 29a4f548..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/multirootfileset.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - -MultiRootFileSet Type - - - - -

MultiRootFileSet

- -

Since Ant 1.9.4

- -

A MultiRootFileSet is a group of files or directories. These files -or directories can be found in a directory forrest starting with a set -of base directories and are matched by patterns taken from a number of -PatternSets and Selectors.

- -

MultiRootFileSet acts as a union of FileSets and DirSets -that share the same patterns and selectors.

- -

MultiRootFileSet supports all attributes and nested elements of -FileSet and DirSet except for the "dir" attribute.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
basedirsComma separated list of directories that build - the roots of the MultiRootFileSet.No
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
typeThe type of file system entities which will be - included in this set. - Acceptable values are: -
    -
  • file - regular files
  • -
  • dir - directories
  • -
  • both - regular files and directories
  • -
-
No, defaults to file
includesA comma- or space-separated list of patterns of directories that - must be included; all directories are included when omitted.No
includesfileThe name of a file; each line of this file is - taken to be an include pattern.No
excludesA comma- or space-separated list of patterns of directories that - must be excluded; no directories are excluded when omitted.No
excludesfileThe name of a file; each line of this file is - taken to be an exclude pattern.No
casesensitiveSpecifies whether case-sensitivity should be applied - (true|yes|on or - false|no|off).No; defaults to true.
followsymlinksShall symbolic links be followed? Defaults to - true. See fileset's documentation.No
erroronmissingdir - Specify what happens if one of the base directories does not exist. - If true a build error will happen, if false, the subtree - will be ignored/empty. - Defaults to true. - No
- -

Parameters specified as nested elements

- -

PatternSets can be specified as nested -<patternset> elements. In addition, MultiRootFileSet holds -an implicit PatternSet and supports the nested -<include>, <includesfile>, -<exclude> and <excludesfile> -elements of <patternset> directly, as well as -<patternset>'s attributes.

- -

Selectors are available as nested elements within the -MultiRootFileSet. If any of the selectors within the MultiRootFileSet -do not select the file or directory, it is not considered part of the -MultiRootFileSet. This makes a MultiRootFileSet equivalent to -an <and> selector container.

- -

In addition basedirs for the MultiRootFileSet can be specified as - nested basedir elements that have a - single file attribute.

- - -

Examples

- -
-<multirootfileset basedirs="${build.dir},${other.project.dir}">
-  <include name="apps/**/classes"/>
-  <exclude name="apps/**/*Test*"/>
-</multirootfileset>
-
-

Groups all files inside classes found under the -apps subdirectory of ${build.dir} or -${other.project.dir}, except those that have the text -Test in their name.

- -
-<multirootfileset>
-  <basedir file="${build.dir}"/>
-  <basedir file="${other.project.dir}"
-  <include name="apps/**/classes"/>
-  <exclude name="apps/**/*Test*"/>
-</multirootfileset>
-
-

Is equivalent to the first example but used - nested basedir elements. The nested elements and - the basedirs attribute can be used at the same time and - the will be merged.

- - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/namespace.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/namespace.html deleted file mode 100644 index 3adfa80c..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/namespace.html +++ /dev/null @@ -1,224 +0,0 @@ - - - -XmlNamespaceSupport - -

XML Namespace Support

- Apache Ant 1.6 introduces support for XML namespaces. -

History

- -

- All releases of Ant prior to Ant 1.6 do not support XML namespaces. - No support basically implies two things here: -

- -

Use of colons in element names has been discouraged in the past, - and using any attribute starting with "xml" is actually strongly - discouraged by the XML spec to reserve such names for future use. -

-

Motivation

- -

In build files using a lot of custom and third-party tasks, it is - easy to get into name conflicts. When individual types are defined, the - build file writer can do some namespacing manually (for example, using - "tomcat-deploy" instead of just "deploy"). But when defining whole - libraries of types using the <typedef> 'resource' attribute, the - build file writer has no chance to override or even prefix the names - supplied by the library.

-

Assigning Namespaces

- -

- Adding a 'prefix' attribute to <typedef> might have been enough, - but XML already has a well-known method for namespacing. Thus, instead - of adding a 'prefix' attribute, the <typedef> and <taskdef> - tasks get a 'uri' attribute, which stores the URI of the XML namespace - with which the type should be associated: -

 <typedef resource="org/example/tasks.properties" uri="http://example.org/tasks"/>
- <my:task xmlns:my="http://example.org/tasks">
-    ...
- </my:task>
-
-

As the above example demonstrates, the namespace URI needs to be - specified at least twice: one time as the value of the 'uri' attribute, - and another time to actually map the namespace to occurrences of - elements from that namespace, by using the 'xmlns' attribute. This - mapping can happen at any level in the build file: -

 <project name="test" xmlns:my="http://example.org/tasks"> 
-   <typedef resource="org/example/tasks.properties" uri="http://example.org/tasks"/>
-   <my:task>
-     ...
-   </my:task>
- </project>
-
-

- Use of a namespace prefix is of course optional. Therefore - the example could also look like this: -

 <project name="test"> 
-   <typedef resource="org/example/tasks.properties" uri="http://example.org/tasks"/>
-   <task xmlns="http://example.org/tasks">
-     ...
-   </task>
- </project>
-
-

- Here, the namespace is set as the default namespace for the <task> - element and all its descendants. -

-

Default namespace

-

- The default namespace used by Ant is "antlib:org.apache.tools.ant". -

-
-<typedef resource="org/example/tasks.properties" uri="antlib:org.apache.tools.ant"/>
-<task>
-      ....
-</task>
-    
- - - -

Namespaces and Nested Elements

- -

- Almost always in Ant 1.6, elements nested inside a namespaced - element have the same namespace as their parent. So if 'task' in the - example above allowed a nested 'config' element, the build file snippet - would look like this: -

 <typedef resource="org/example/tasks.properties" uri="http://example.org/tasks"/>
- <my:task xmlns:my="http://example.org/tasks">
-   <my:config a="foo" b="bar"/>
-   ...
- </my:task>
-
-

If the element allows or requires a lot of nested elements, the - prefix needs to be used for every nested element. Making the namespace - the default can reduce the verbosity of the script: -

 <typedef resource="org/example/tasks.properties" uri="http://example.org/tasks"/>
-          <task xmlns="http://example.org/tasks">
-          <config a="foo" b="bar"/>
-   ...
-          </task>
-        
-

- From Ant 1.6.2, elements nested inside a namespaced element may also be - in Ant's default namespace. This means that the following is now allowed: -

-

 <typedef resource="org/example/tasks.properties"
-   uri="http://example.org/tasks"/>
- <my:task xmlns:my="http://example.org/tasks">
-   <config a="foo" b="bar"/>
-   ...
- </my:task>
-
- -

Namespaces and Attributes

- -

- Attributes are only used to configure the element they belong to if: -

- -

- In Ant 1.9.1 two attribute namespaces ant:if and ant:unless were added - to allow you to insert elements conditionally. -

-

- Other attributes are simply ignored. -

-

- This means that both: -

-

-

 <my:task xmlns:my="http://example.org/tasks">
-   <my:config a="foo" b="bar"/>
-   ...
- </my:task>
-
-

- and -

-
 <my:task xmlns:my="http://example.org/tasks">
-   <my:config my:a="foo" my:b="bar"/>
-   ...
- </my:task>
-
-

- result in the parameters "a" and "b" being used as parameters to configure the nested "config" element. -

-

It also means that you can use attributes from other namespaces - to markup the build file with extra metadata, such as RDF and - XML-Schema (whether that's a good thing or not). The same is not true - for elements from unknown namespaces, which result in a error. -

-

Mixing Elements from Different Namespaces

- -

Now comes the difficult part: elements from different namespaces can - be woven together under certain circumstances. This has a lot to do - with the Ant 1.6 - add type introspection rules: - Ant types and tasks are now free to accept arbitrary named types as - nested elements, as long as the concrete type implements the interface - expected by the task/type. The most obvious example for this is the - <condition> task, which supports various nested conditions, all - of which extend the interface Condition. To integrate a - custom condition in Ant, you can now simply <typedef> the - condition, and then use it anywhere nested conditions are allowed - (assuming the containing element has a generic add(Condition) or addConfigured(Condition) method): -

 <typedef resource="org/example/conditions.properties" uri="http://example.org/conditions"/>
- <condition property="prop" xmlns="http://example.org/conditions">
-   <and>
-     <available file="bla.txt"/>
-     <my:condition a="foo"/>
-   </and>
- </condition>
-
-

- In Ant 1.6, this feature cannot be used as much as we'd all like to: a - lot of code has not yet been adapted to the new introspection rules, - and elements like Ant's built-in conditions and selectors are not - really types in 1.6. This is expected to change in Ant 1.7. -

-

Namespaces and Antlib

- -

- The new AntLib - feature is also very much integrated with the namespace support in Ant - 1.6. Basically, you can "import" Antlibs simply by using a special - scheme for the namespace URI: the antlib scheme, which expects the package name in which a special antlib.xml file is located. -

- - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/patternset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/patternset.html deleted file mode 100644 index 4ad433db..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/patternset.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - -PatternSet Type - - - - -

PatternSet

-

Patterns can be grouped to -sets and later be referenced by their id attribute. They -are defined via a patternset element, which can appear -nested into a FileSet or a directory-based -task that constitutes an implicit FileSet. In addition, -patternsets can be defined as a stand alone element at -the same level as target — i.e., as children of -project as well as as children of -target.

Patterns can be specified by nested -<include>, or <exclude> elements -or the following attributes.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescription
includescomma- or space-separated list of patterns of files that must be - included. All files are included when omitted.
includesfilethe name of a file; each line of this file is - taken to be an include pattern. You can specify more than one - include file by using a nested includesfile elements. - Note: if the file is empty and there are no other - patterns defined for the fileset, all files will be included. -
excludescomma- or space-separated list of patterns of files that must be - excluded; no files (except default excludes) are excluded when omitted.
excludesfilethe name of a file; each line of this file is - taken to be an exclude pattern. You can specify more than one - exclude file by using a nested excludesfile elements.
-

Parameters specified as nested elements

-

include and exclude

-

Each such element defines a single pattern for files to include or -exclude.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namethe pattern - to in/exclude.Yes
ifOnly use this pattern if the named property is set.No
unlessOnly use this pattern if the named property is - not set.No
-

includesfile and excludesfile

-

If you want to list the files to include or exclude external to -your build file, you should use the includesfile/excludesfile -attributes or elements. Using the attribute, you can only specify a -single file of each type, while the nested elements can be specified -more than once - the nested elements also support if/unless attributes -you can use to test the existence of a property.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namethe name of the file holding the patterns to - in/exclude.Yes
ifOnly read this file if the named property is set.No
unlessOnly read this file if the named property is - not set.No
-

patternset

-

Patternsets may be nested within one another, adding the nested -patterns to the parent patternset.

-

invert

-

A nested patternset can be inverted using the <invert> -element. Since Apache Ant 1.7.1

-

Examples

-
-<patternset id="non.test.sources">
-  <include name="**/*.java"/>
-  <exclude name="**/*Test*"/>
-</patternset>
-
-

Builds a set of patterns that matches all .java files -that do not contain the text Test in their name. This set -can be referred to via -<patternset refid="non.test.sources"/>, -by tasks that support this feature, or by FileSets.

-

Note that while the includes and -excludes attributes accept -multiple elements separated by commas or spaces, the nested -<include> and <exclude> elements expect their name -attribute to hold a single pattern.

-

The nested elements allow you to use if and unless arguments to -specify that the element should only be used if a property is set, or -that it should be used only if a property is not set.

-

For example

-
-<patternset id="sources">
-  <include name="std/**/*.java"/>
-  <include name="prof/**/*.java" if="professional"/>
-  <exclude name="**/*Test*"/>
-</patternset>
-
-

will only include the files in the sub-directory prof if the property -professional is set to some value.

-

The two sets

-
-<patternset includesfile="some-file"/>
-
-

and

-
-<patternset>
-  <includesfile name="some-file"/> 
-<patternset/>
-
-

are identical. The include patterns will be read from the file -some-file, one pattern per line.

-
-<patternset>
-  <includesfile name="some-file"/> 
-  <includesfile name="${some-other-file}" 
-                if="some-other-file"
-  /> 
-<patternset/>
-
-

will also read include patterns from the file the property -some-other-file points to, if a property of that name has -been defined.

- - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/permissions.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/permissions.html deleted file mode 100644 index f7b90b78..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/permissions.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - -Permissions type - - - - -

Permissions

-

-Permissions represents a set of security permissions granted or revoked to -a specific part code executed in the JVM where Apache Ant is running in. -The actual Permissions are specified via a set of nested permission items either -<grant>ed or <revoke>d.

-

-In the base situation a base set of permissions granted. -Extra permissions can be -granted. A granted permission can be overruled by revoking a permission. -The security manager installed by the permissions will throw an -SecurityException if -the code subject to these permissions try to use an permission that has not been -granted or that has been revoked.

-

Nested elements

-

grant

-

-Indicates a specific permission is always granted. Its attributes indicate which -permissions are granted.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classThe fully qualified name of the Permission class.Yes
nameThe name of the Permission. The actual contents depends on the - Permission class.No
actionsThe actions allowed. The actual contents depend on the - Permission class and name.No
-

-Implied permissions are granted. -

-

-Please note that some Permission classes may actually need a name and / or actions in order to function properly. The name and actions are parsed by the actual -Permission class. -

-

revoke

-

-Indicates a specific permission is revoked.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classThe fully qualified name of the Permission class.Yes
nameThe name of the Permission. The actual contents depends on the - Permission class.No
actionsThe actions allowed. The actual contents depend on the - Permission class and name.No
-

-Implied permissions are not resolved and therefore also not revoked. -

-

-The name can handle the * wildcard at the end of the name, in which case all -permissions of the specified class of which the name starts with the specified name -(excluding the *) are revoked. Note that the - wildcard often supported by the -granted properties is not supported. -If the name is left empty all names match, and are revoked. -If the actions are left empty all actions match, and are revoked. -

-

Base set

-A permissions set implicitly contains the following permissions: -
-<grant class="java.net.SocketPermission" name="localhost:1024-" actions="listen">
-<grant class="java.util.PropertyPermission" name="java.version" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vendor" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vendor.url" actions="read">
-<grant class="java.util.PropertyPermission" name="java.class.version" actions="read">
-<grant class="java.util.PropertyPermission" name="os.name" actions="read">
-<grant class="java.util.PropertyPermission" name="os.version" actions="read">
-<grant class="java.util.PropertyPermission" name="os.arch" actions="read">
-<grant class="java.util.PropertyPermission" name="file.encoding" actions="read">
-<grant class="java.util.PropertyPermission" name="file.separator" actions="read">
-<grant class="java.util.PropertyPermission" name="path.separator" actions="read">
-<grant class="java.util.PropertyPermission" name="line.separator" actions="read">
-<grant class="java.util.PropertyPermission" name="java.specification.version" actions="read">
-<grant class="java.util.PropertyPermission" name="java.specification.vendor" actions="read">
-<grant class="java.util.PropertyPermission" name="java.specification.name" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vm.specification.version" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vm.specification.vendor" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vm.specification.name" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vm.version" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vm.vendor" actions="read">
-<grant class="java.util.PropertyPermission" name="java.vm.name" actions="read">
-
-These permissions can be revoked via <revoke> elements if necessary. - -

Examples

-
-<permissions>
-  <grant class="java.security.AllPermission"/>
-  <revoke class="java.util.PropertyPermission"/>
-</permissions>
-
-

-Grants all permissions to the code except for those handling Properties. -

-
-<permissions>
-  <grant class="java.net.SocketPermission" name="foo.bar.com" action="connect"/>
-  <grant class="java.util.PropertyPermission" name="user.home" action="read,write"/>
-</permissions>
-
-

-Grants the base set of permissions with the addition of a SocketPermission to connect -to foo.bar.com and the permission to read and write the user.home system property. -

- - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/propertyset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/propertyset.html deleted file mode 100644 index 81d491e0..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/propertyset.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - -PropertySet Type - - - - -

PropertySet

-

Since Apache Ant 1.6

- -

Groups a set of properties to be used by reference in a task that -supports this.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
dynamicWhether to reevaluate the set every time the set - is used. Default is "true".No
negateWhether to negate results. If - "true", all properties not - selected by nested elements will be returned. Default is - "false". Since Ant 1.6.2 - No
-

Parameters specified as nested elements

- -

propertyref

- -

Selects properties from the current project to be included in the -set.

- - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameSelect the property with the given name.Exactly one of these.
prefixSelect the properties whose name starts with the - given string.
regexSelect the properties that match the given - regular expression. Similar to regexp type mappers, this - requires a supported regular expression library.
builtinSelects a builtin set of properties. Valid - values for this attribute are all for all Ant - properties, system for the system properties and - commandline for all properties specified on the - command line when invoking Ant (plus a number of special - internal Ant properties).
- -

propertyset

- -

A propertyset can be used as the set union of more -propertysets.

- -

For example:

- -
-<propertyset id="properties-starting-with-foo">
-  <propertyref prefix="foo"/>
-</propertyset>
-<propertyset id="properties-starting-with-bar">
-  <propertyref prefix="bar"/>
-</propertyset>
-<propertyset id="my-set">
-  <propertyset refid="properties-starting-with-foo"/>
-  <propertyset refid="properties-starting-with-bar"/>
-</propertyset>
-
- -

collects all properties whose name starts with either -"foo" or "bar" in the set named -"my-set".

- -

mapper

- -

A mapper - at maximum one mapper can be -specified. The mapper is used to change the names of the property -keys, for example: - -

-<propertyset id="properties-starting-with-foo">
-  <propertyref prefix="foo"/>
-  <mapper type="glob" from="foo*" to="bar*"/>
-</propertyset>
-
- -

collects all properties whose name starts with "foo", but -changes the names to start with "bar" instead.

- -

If supplied, the nested mapper will be applied -subsequent to any negation of matched properties.

- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/redirector.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/redirector.html deleted file mode 100644 index d0e36838..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/redirector.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - -Redirector Type - - - - -

I/O redirection

-

For many tasks, input and output can be defined in a fairly -straightforward fashion. The exec -task, used to execute an external process, stands as a very -basic example. The executed process may accept input, produce -output, or do either or both depending upon various circumstances. -Output may be classified as "output" or as "error -output." The <redirector> type provides a concrete means -of redirecting input and output featuring the use of -File Mappers to specify -source (input) and destination (output/error) files. Since Apache Ant 1.6.2 -

The <redirector> element accepts the following attributes:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
outputName of a file to which output should be written. - If the error stream is not also redirected to a file or property, - it will appear in this output.No
errorThe file to which the standard error of the - command should be redirected.No
logErrorThis attribute is used when you wish to see - error output in Ant's log and you are redirecting output to - a file/property. The error output will not be included in - the output file/property. If you redirect error with the - error or errorProperty attributes, this will - have no effect.No
appendWhether output and error files should be - appended to rather than overwritten. Defaults to - false.No
createemptyfilesWhether output and error files should be - created even when empty. Defaults to true.No
outputpropertyThe name of a property in which the output of the - command should be stored. Unless the error stream is redirected - to a separate file or stream, this property will include the - error output.No
errorpropertyThe name of a property in which the standard error - of the command should be stored.No
inputA file from which the executed command's standard input - is taken. This attribute is mutually exclusive with the - inputstring attribute.No
inputstringA string which serves as the input stream for the - executed command. This attribute is mutually exclusive with the - input attribute.No
inputencodingThe input encoding.No
outputencodingThe output encoding.No
errorencodingThe error encoding.No
alwayslogAlways send to the log in addition to - any other destination. Since Ant 1.6.3. - No, default is false
loginputstringControls the display of inputstring's value in - log messages. Set to false when sending sensitive data - (e.g. passwords) to external processes. Since Ant 1.6.3. - No, default is true
binaryOutputWhen set to true Ant will not try to split the - output into lines - which it will usually do in order to separate - error from normal output. This setting will not prevent binary - output from getting corrupted if you also specify filter chains. - Since Ant 1.9.4. - No, default is false
-

Parameters specified as nested elements

-

inputmapper

-

A single File Mapper used to redirect process -input. Multiple mapping results should concatenate all mapped files as input. -Mapping will ordinarily be performed on a task-specified sourcefile; -consult the documentation of the individual task for more details. -A nested <inputmapper> is not compatible with either of the -input or inputstring attributes.

-

outputmapper

-

A single File Mapper used to redirect process -output. Mapping will ordinarily be performed on a task-specified sourcefile; -consult the documentation of the individual task for more details. -A nested <outputmapper> is not compatible with the -output attribute.

-

errormapper

-

A single File Mapper used to redirect error -output. Mapping will ordinarily be performed on a task-specified sourcefile; -consult the documentation of the individual task for more details. -A nested <errormapper> is not compatible with the -error attribute.

-

inputfilterchain

-

A FilterChain can be -applied to the process input.

-

outputfilterchain

-

A FilterChain can be -applied to the process output.

-

errorfilterchain

-

A FilterChain can be -applied to the error output.

-

Usage

-Tasks known to support I/O redirection: - -

The expected behavior of a <redirector> is to a great degree -dependent on the supporting task. Any possible points of confusion -should be noted at the task level.

- - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/regexp.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/regexp.html deleted file mode 100644 index 0628bb9b..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/regexp.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - -Regexp Type - - - - -

Regexp

-

-Regexp represents a regular expression. -

Parameters

- - - - - - - - - - - -
AttributeDescriptionRequired
patternregular expression patternYes
- -

Examples

-
-     <regexp id="myregexp" pattern="alpha(.+)beta"/>
-
-

-Defines a regular expression for later use with id myregexp. -

-
-     <regexp refid="myregexp"/>
-
-

-Use the regular expression with id myregexp. -

-

Choice of regular expression implementation

-

-Apache Ant comes with -wrappers for -the java.util.regex package, -jakarta-regexp -and jakarta-ORO, -See installation dependencies - concerning the supporting libraries.

-

-The property ant.regexp.regexpimpl governs which regular expression implementation will be chosen. -Possible values for this property are : -

-It can also be another implementation of the interface org.apache.tools.ant.util.regexp.Regexp. -If ant.regexp.regexpimpl is not defined, Ant uses Jdk14Regexp as this is always available.

-

-There are cross-platform issues for matches related to line terminator. -For example if you use $ to anchor your regular expression on the end of a line -the results might be very different depending on both your platform and the regular -expression library you use. It is 'highly recommended' that you test your pattern on -both Unix and Windows platforms before you rely on it. -

-We used to recommend that you use Jakarta ORO but since its - development has been retired Java's built-in regex package is likely - the best choice going forward. -

-

Usage

-The following tasks and types use the Regexp type : - -

-These string filters also use the mechanism of regexp to choose a regular expression implementation : -

- - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/resources.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/resources.html deleted file mode 100644 index 58cefde1..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/resources.html +++ /dev/null @@ -1,1380 +0,0 @@ - - - - - - -Resources and Resource Collections - - - - -

Resources

-

-A file-like entity can be abstracted to the concept of a resource. -In addition to providing access to file-like attributes, a resource -implementation should, when possible, provide the means to read content -from and/or write content to the underlying entity. Although the resource -concept was introduced in Apache Ant 1.5.2, resources are available for -explicit use beginning in Ant 1.7. -

- -

The built-in resource types are:

- - - -

resource

- -

A basic resource. Other resource types derive from this basic -type; as such all its attributes are available, though in most cases -irrelevant attributes will be ignored. This and all resource -implementations are also usable as single-element -Resource Collections. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameThe name of this resourceNo
existsWhether this resource existsNo, default true
lastmodifiedThe last modification time of this resourceNo
directoryWhether this resource is directory-likeNo, default false
sizeThe size of this resourceNo
- -

file

- -

Represents a file accessible via local filesystem conventions.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
fileThe file represented by this resourceYes
basedirThe base directory of this resource. When this - attribute is set, attempts to access the name of the resource - will yield a path relative to this location.No
- -

javaresource

- -

Represents a resource loadable via a Java classloader.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameThe name of the resource.Yes
classpaththe classpath to use when looking up a resource.No
classpathrefthe classpath to use when looking up a resource, - given as reference - to a <path> defined elsewhere..No
loaderRefthe name of the loader that is - used to load the resource, constructed from the specified classpath.No
parentFirstWhether to consult the parent classloader first - - the parent classloader most likely is the system classloader - - when using a nested classpath. Defaults - to true.
- Since Ant 1.8.0
No
- -

The classpath can also be specified as nested classpath element, -where <classpath> is a path-like structure.

- - -

javaconstant

-

Loads the value of a java constant. As a specialisation of -javaresource all of its attributes and nested elements are -supported. A constant must be specified as public static otherwise it could not be loaded.

- - - - - - - - - - - - -
AttributeDescriptionRequired
nameThe name of the resource. Must be specified as full qualified - field name. - Yes
-
Examples
-This loads the value of the constant VERSION of the org.acme.Main class -into the version-property. The classpath for finding that class is provided via -nested classpath element. -
<loadresource property="version">
-   <javaconstant name="org.acme.Main.VERSION">
-     <classpath>
-       <pathelement location="${acme.lib.dir}"/>
-     </classpath>
-   </javaconstant>
- </loadresource>
-
- -Create a new file c:/temp/org.apache.tools.ant.Main.DEFAULT_BUILD_FILENAME with the content -of that constant (build.xml). -
<copy todir="c:/temp">
-  <javaconstant name="org.apache.tools.ant.Main.DEFAULT_BUILD_FILENAME"/>
-</copy>
- - -

zipentry

- -

Represents an entry in a ZIP archive. The archive can be specified -using the archive attribute or a nested single-element resource -collection. zipentry only supports file system resources -as nested elements.

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
zipfile or its alias name archiveThe zip file containing this resourceYes, unless a nested resource - collection has been specified.
nameThe name of the archived resourceYes
encodingThe encoding of the zipfileNo; - platform default used if unspecified
- -

tarentry

- -

Represents an entry in a TAR archive. The archive can be specified -using the archive attribute or a nested single-element resource -collection.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
archiveThe tar archive containing this resourceYes, unless a nested resource - collection has been specified.
nameThe name of the archived resourceYes
- -

gzipresource

- -

This is not a stand-alone resource, but a wrapper around another -resource providing compression of the resource's contents on the fly. -A single element resource collection must be specified as a nested -element.

- -

bzip2resource

- -

This is not a stand-alone resource, but a wrapper around another -resource providing compression of the resource's contents on the fly. -A single element resource collection must be specified as a nested -element.

- -

url

- -

Represents a URL.

- - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
urlThe url to exposeExactly one of these
fileThe file to expose as a file: url
baseUrlThe base URL which must be combined with relativePath
relativePathRelative path that defines the url combined with - baseUrlIf using baseUrl
- -

string

- -

Represents a Java String. It can be written to, but only once, after which -it will be an error to write to again.

- - - - - - - - - - - - -
AttributeDescriptionRequired
valueThe value of this resourceNo
- -

The resource also supports nested text, which can only be supplied if the value attribute is unset: -

-
-  <string>
-        self.log("Ant version =${ant.version}");
-  </string>
-
- -

- -

propertyresource

- -

Represents an Ant property.

- - - - - - - - - - - - -
AttributeDescriptionRequired
nameThe property nameYes
- -
-

Resource Collections

-

-A Resource Collection is an abstraction of an entity that groups -together a number of resources. Several of -Ant's "legacy" datatypes have been modified to behave as Resource Collections: -

-

-

Strangely, some tasks can even legitimately behave as resource collections: -

-

-

The additional built-in resource collections are:

- -

resources

-

A generic resource collection, designed for use with - references. - For example, if a third-party Ant task generates a Resource Collection - of an unknown type, it can still be accessed via a - <resources> collection. The secondary use of this - collection type is as a container of other resource collections, - preserving the order of nested collections as well as - duplicate resources (contrast with union). -

-
- - - - - - - - - - - -
AttributeDescriptionRequired
cacheWhether to cache results. since Ant 1.8.0No, default false
-
- -

files

-

A group of files. These files are matched by absolute patterns - taken from a number of PatternSets. - These can be specified as nested <patternset> - elements. In addition, <files> holds an implicit - PatternSet and supports the nested <include>, - <includesfile>, <exclude> - and <excludesfile> elements of PatternSet directly, - as well as PatternSet's attributes. -

-

File Selectors are available as nested - elements. A file must be selected by all selectors in order to be included; - <files> is thus equivalent to an - <and> file selector container. -

-

More simply put, this type is equivalent to a - fileset with no base directory. - Please note that without a base directory, - filesystem scanning is based entirely on include and exclude patterns. - A filename (or any) - selector can only influence the scanning process after - the file has been included based on pattern-based selection. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
includescomma- or space-separated list of patterns - of files that must be includedAt least one of these
includesfilethe name of a file; each line of this file is - taken to be an include pattern.
excludescomma- or space-separated list of patterns - of files that must be excludedNo, default none - (except default excludes when true)
excludesfilethe name of a file; each line of this file is - taken to be an exclude pattern.
defaultexcludesWhether - default excludes - should be usedNo, default true
casesensitiveWhether patterns are case-sensitiveNo, default true
followsymlinksWhether to follow symbolic links - (see note below)No, default true
- -

Note: All files/directories for which -the canonical path is different from its path are considered symbolic -links. On Unix systems this usually means the file really is a -symbolic link but it may lead to false results on other -platforms. -

- -

restrict

-

Restricts a nested resource collection using resource selectors: -

- - - - - - - - - - - -
AttributeDescriptionRequired
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-

A single resource collection is required.

-

Nested resource selectors are used to "narrow down" the included - resources, combined via a logical AND. These are patterned - after file selectors but are, - unsurprisingly, targeted to resources. - Several built-in resource selectors are available in the internal - antlib - org.apache.tools.ant.types.resources.selectors: -

- -
    -
  • name - select resources by name.
  • -
  • exists - select existing resources.
  • -
  • date - select resources by date.
  • -
  • type - select resources by type.
  • -
  • size - select resources by size.
  • -
  • instanceof - - select resources by class or Ant datatype.
  • -
  • and - "and" nested resource selectors.
  • -
  • or - "or" nested resource selectors.
  • -
  • not - "not" a nested resource selector.
  • -
  • none - - select resources selected by no nested resource selectors.
  • -
  • majority - select resources selected - by a majority of nested resource selectors.
  • -
  • modified - select resources which - content has changed.
  • -
  • contains - select resources - containing a particular text string.
  • -
  • containsregexp - select - resources whose contents match a particular regular expression.
  • -
  • compare - select resources - based on comparison to other resources.
  • -
  • readable - - Select files (resources must be files) if they are readable.
  • -
  • writable - - Select files (resources must be files) if they are writable.
  • -
- -

name

-

Selects resources by name.

- - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameThe name pattern to test using standard Ant - patterns.Exactly one of - the two
regexThe regular expression matching files to select.
casesensitiveWhether name comparisons are case-sensitiveNo, default true
handledirsep - If this is specified, the mapper will treat a \ character in a - resource name or name attribute as a / for the purposes of - matching. This attribute can be true or false, the default is - false. - Since Ant 1.8.0. - No
- -

exists

-

Selects existing resources.

- -

date

-

Selects resources by date.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
millisThe comparison date/time in ms since January 1, 1970One of these
datetimeThe formatted comparison date/time
patternSimpleDateFormat-compatible pattern - for use with the datetime attribute - No, default is "MM/DD/YYYY HH:MM AM_or_PM"
granularityThe number of milliseconds leeway to use when - comparing file modification times. This is needed because not - every file system supports tracking the last modified time to - the millisecond level.No; default varies by platform: - FAT filesystems = 2 sec; Unix = 1 sec; NTFS = 1 ms.
whenOne of "before", "after", "equal"No, default "equal"
- -

type

-

Selects resources by type (file or directory).

- - - - - - - - - - - -
AttributeDescriptionRequired
typeOne of "file", "dir", "any" (since Ant 1.8)Yes
- -

size

-

Selects resources by size.

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
sizeThe size to compareYes
whenOne of "equal", "eq", "greater", "gt", "less", "lt", - "ge" (greater or equal), "ne" (not equal), "le" (less or equal)No, default "equal"
- -

instanceof

-

Selects resources by type.

- - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classThe class of which the resource must be an instanceOne of these
typeThe Ant type that must - be assignable from the resource
uriThe uri in which type must be definedNo
- -

and

-

Selects a resource if it is selected by all nested resource selectors.

- -

or

-

Selects a resource if it is selected - by at least one nested resource selector.

- -

not

-

Negates the selection result of the single - nested resource selector allowed.

- -

none

-

Selects a resource if it is selected - by no nested resource selectors.

- -

majority

-

Selects a resource if it is selected - by the majority of nested resource selectors.

- - - - - - - - - - - -
AttributeDescriptionRequired
allowtieWhether a tie (when there is an even number - of nested resource selectors) is considered a majorityNo, default true
- -

compare

-

Selects a resource based on its comparison to one or more "control" - resources using nested resource comparators.

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
whenComparison ("equal"/"eq", "greater"/"gt", "less"/"lt", - "le" (less or equal), "ge" (greater or equal), "ne" (not equal).No, default "equal"
againstQuantifier ("all"/"each"/"every", "any"/"some", - (exactly) "one", "most"/"majority", "none".No, default "all"
-

Parameters specified as nested elements

-

The resources against which comparisons will be made must be specified - using the nested <control> element, which denotes a - resources collection.

-

Examples

-

Assuming the namespace settings -

  rsel="antlib:org.apache.tools.ant.types.resources.selectors"
-  rcmp="antlib:org.apache.tools.ant.types.resources.comparators"
-

-
-<restrict>
-  <fileset dir="src" includes="a,b,c,d,e,f,g" />
-  <rsel:compare when="le" against="all">
-    <control>
-      <resource name="d" />
-    </control>
-    <rcmp:name />
-  </rsel:compare>
-</restrict>
-  
-

Selects files a, b, c, and d.

-
-    <project rsel="antlib:org.apache.tools.ant.types.resources.selectors">
-        <macrodef name="copyFromPath">
-            <attribute name="todir"/>
-            <attribute name="refid"/>
-            <element name="nested-resource-selectors" optional="yes" implicit="true"/>
-            <sequential>
-                <mkdir dir="@{todir}" taskname="copyFromPath"/>
-                <copy todir="@{todir}" taskname="copyFromPath">
-                    <restrict>
-                        <path refid="@{refid}"/>
-                        <rsel:or>
-                            <nested-resource-selectors/>
-                        </rsel:or>
-                    </restrict>
-                    <flattenmapper/>
-                </copy>
-            </sequential>
-        </macrodef>
-        <copyFromPath refid="classpath" todir="todir">
-            <rsel:name name="log4j.properties"/>
-            <rsel:name name="default.properties"/>
-        </copyFromPath>
-     </project>
-  
-

Creates the todir directory and copies (if present) the - files log4j.properties and default.properties - from the Classpath (already used while compiling). -

- -
-  <project>
-      <filelist id="allfiles" dir="${ant.home}/bin" files="ant.cmd,foo.txt,ant.bat,bar.txt,ant"/>
-      <restrict id="missingfiles">
-          <filelist refid="allfiles"/>
-          <rsel:not xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
-              <rsel:exists/>
-          </rsel:not>
-      </restrict>
-      <echo>These files are missed: ${toString:missingfiles}</echo>
-  </project>
-  
-

The resource collection allfiles defines a list of files which are expected. The restrict - missingfiles uses the <not><exists> selector for getting all files - which are not present. Finally we use the toString: pathshortcut for - getting them in a readable form: [echo] These files are missed: ....foo.txt;....bar.txt

- -
- -

sort

- -

Sorts a nested resource collection according to the resources' - natural order, or by one or more nested resource - comparators:

-
- - - - - - - - - - - -
AttributeDescriptionRequired
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-

A single resource collection is required.

-

The sort can be controlled and customized by specifying one or more - resource comparators. Resources can be sorted according to multiple - criteria; the first specified is the "outermost", while the last - specified is the "innermost". Several built-in resource comparators - are available in the internal antlib - org.apache.tools.ant.types.resources.comparators: -

-

Resource Comparators:

-
    -
  • name - sort resources by name
  • -
  • exists - sort resources by existence
  • -
  • date - sort resources by date
  • -
  • type - sort resources by type
  • -
  • size - sort resources by size
  • -
  • content - sort resources by content
  • -
  • reverse - reverse the natural sort order, - or that of a single nested resource comparator
  • -
- -

name

-

Sort resources by name.

- -

exists

-

Sort resources by existence. - Not existing is considered "less than" existing.

- -

date

-

Sort resources by date.

- -

type

-

Sort resources by type (file or directory). - Because directories contain files, they are considered "greater".

- -

size

-

Sort resources by size.

- -

content

-

Sort resources by content.

- - - - - - - - - - - -
AttributeDescriptionRequired
binaryWhether content should be compared in binary mode. - If false, content will be compared without regard to - platform-specific line-ending conventions.No, default true
- -

reverse

-

Reverse the natural sort order, or that of a single nested comparator.

- -

Examples

-
-    <property name="eol" value="${line.separator}" />
-    <pathconvert property="sorted" pathsep="${eol}">
-      <sort>
-        <tokens>
-          <string value="foo bar etc baz" />
-          <stringtokenizer />
-        </tokens>
-      </sort>
-    </pathconvert>
-

The resource of type string "foo bar etc baz" is split into four tokens by - the stringtokenizer. These tokens are sorted and there sorted gets the value - of "bar baz etc foo".

- -
-    <sort>
-      <fileset dir="foo" />
-      <reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
-        <date />
-      </reverse>
-    </sort>
-

This takes all files from foo - and sorts them by modification date in reverse order. - Because the resource comparators used (<reverse> - and <date>) are in an internal antlib - their namespace must be set explicitly. -

- -
- -

first

-

Includes the first count resources from a nested resource collection. -This can be used in conjunction with the sort collection, -for example, to select the first few oldest, largest, etc. resources from a -larger collection.

-
- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
countThe number of resources to includeNo, default 1
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-

A single resource collection is required.

-
- -

last

-

Includes the last count resources from a nested resource collection. -This can be used in conjunction with the sort collection, -for example, to select the last few oldest, largest, etc. resources from a -larger collection. Since Ant 1.7.1.

-
- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
countThe number of resources to includeNo, default 1
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-

A single resource collection is required.

-
- -

allbutfirst

-

Includes all elements except for the first count resources -from a nested resource collection. This can be used in conjunction -with the sort collection, for example, to select -all but the first few oldest, largest, etc. resources from a larger -collection. Since Ant 1.9.5.

-
- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
countThe number of resources to excludeNo, default 1
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-

A single resource collection is required.

-
- -

allbutlast

-

Includes all elements except for the last count resources -from a nested resource collection. This can be used in conjunction -with the sort collection, for example, to select -all but the last few oldest, largest, etc. resources from a larger -collection. Since Ant 1.9.5.

-
- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
countThe number of resources to excludeNo, default 1
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-

A single resource collection is required.

-
- -

tokens

-

Includes the string tokens gathered from a nested - resource collection. Uses the same tokenizers supported by the -TokenFilter. Imaginative - use of this resource collection can implement equivalents for such Unix - functions as sort, grep -c, wc and - wc -l.

-
- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
encodingThe encoding of the nested resourcesNo, default is platform default
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
-

Parameters specified as nested elements

-
    -
  • A single resource collection is required.
  • -
  • One nested tokenizer may be specified. If omitted, a - LineTokenizer will be used. -
  • -
-

Examples

-
<concat>
-  <union>
-    <sort>
-      <tokens>
-        <resources refid="input" />
-        <linetokenizer includedelims="true" />
-      </tokens>
-    </sort>
-  </union>
-</concat>
-  
-

Implements Unix sort -u against resource collection input.

-
- -

Set operations

-
-

The following resource collections implement set operations:

- - -

union

-

Union of nested resource collections.

- -

intersect

-

Intersection of nested resource collections.

- -

difference

-

Difference of nested resource collections.

- -

The following attributes apply to all set-operation resource collections: -

- - - - - - - - - - - -
AttributeDescriptionRequired
cacheWhether to cache results; disabling - may seriously impact performanceNo, default true
- -

Examples

-
-    <resources id="A">
-        <string value="a"/>
-        <string value="b"/>
-    </resources>
-    <resources id="B">
-        <string value="b"/>
-        <string value="c"/>
-    </resources>
-    <union id="union"><resources refid="A"/><resources refid="B"/></union>
-    <intersect id="intersect"><resources refid="A"/><resources refid="B"/></intersect>
-    <difference id="difference"><resources refid="A"/><resources refid="B"/></difference>
-    <echo>
-      A: ${toString:A}                    = a;b
-      B: ${toString:B}                    = b;c
-
-      union     : ${toString:union}       = a;b;c
-      intersect : ${toString:intersect}   = b
-      difference: ${toString:difference}  = a;c
-    </echo>
-  
-
- -

mappedresources

- -

Since Ant 1.8.0

- -

Wraps another resource collection and maps the names of the nested - resources using a mapper.

- -

Even if mappedresources wraps a resource collection that - consists of file-system based resources, mappedresources - will not appear to be file-system based. This means you can't - use mappedresources with tasks that only allow file-system - based resources.

- -
-

Parameters specified as attributes

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
cacheWhether to cache results; enabling - may improve performance. Since Ant 1.8.1No, default false
enablemultiplemappings - If true the the collection will use all the mappings for a - given source path. If false the it will only process the first - resource. - since Ant 1.8.1.No - defaults to false.
- -

Parameters specified as nested elements

-

A single resource collection is required.

-

A single mapper can be used to map - names. If no mapper has been given (which doesn't make any sense, - honestly), an identity mapper will be used.

- -

Examples

- -

Copies all files from a given directory to a target directory - adding ".bak" as an extension. Note this could be done with a - mapper nested into copy directly as well.

- -
-    <copy todir="${target}">
-      <mappedresources>
-        <fileset dir="${src}"/>
-        <globmapper from="*" to="*.bak"/>
-      </mappedresources>
-    </copy>
-  
- -

Creates a WAR archive adding all CLASSPATH entries that are files - to the WEB-INF/lib directory without keeping their - files-system structure.

- -
-    <war destfile="${output}">
-      <mappedresources>
-        <restrict>
-          <path path="${java.class.path}"/>
-          <type type="file"/>
-        </restrict>
-        <chainedmapper>
-          <flattenmapper/>
-          <globmapper from="*" to="WEB-INF/lib/*"/>
-        </chainedmapper>
-      </mappedresources>
-    </war>
-  
-
- -

archives

- -

Since Ant 1.8.0

- -

This resource collection accepts an arbitrary number of nested - resources and assumes that all those resources must be either ZIP or - TAR archives. The resources returned - by <archives> are the contents of the nested - archives.

- -

This resource collection is a generalization - of zipgroupfileset - which is only supported by the zip family of tasks.

- -

archives doesn't support any attributes.

- -
-

Parameters specified as nested elements

- -

<archives> has two nested - elements <zips> and - <tars> that are unions - themselves, i.e. they accept arbitrary many resource(collection)s - as nested elements.

- -

The nested resources of <zips> are treated as ZIP archives, - the nested resources of <tars> as TAR archives.

- -

Examples

- -

Copies all files from all jars that are on the classpath - to ${target}.

- -
-    <copy todir="${target}">
-      <archives>
-        <zips>
-          <restrict>
-            <path path="${java.class.path}"/>
-            <name name="*.jar"/>
-          </restrict>
-        </zips>
-      </archives>
-    </copy>
-  
-
- -

resourcelist

- -

Since Ant 1.8.0

- -

This resource collection accepts an arbitrary number of nested - resources, reads those resources and returns a resource for each - line read.

- -

If the line contains a colon, Ant will try to use it as an URL and - if that fails (or the line doesn't contain a colon) will return a - file resource with the line's content as its name.

- -

Properties will be expanded for each line. If the property - expansion yields a resource object rather than a string (for example - because of custom property helpers), the resources will be returned - directly.

- -

<resourcelist> is a generalization - of <filelist>.

- -
- - - - - - - - - - - -
AttributeDescriptionRequired
encodingThe encoding of the nested resourcesNo, default is platform default
-
- -
-

Parameters specified as nested elements

- -

<resourcelist> accepts arbitrary many - resource(collection)s as nested elements.

- -

In addition <resourcelist> supports - nested <filterchain> elements that can be used - to filter/modify the read resources before their lines get - expanded. Such a nested element corresponds to - a filterchain.

- -

Examples

- -

The following example copies a file from the first URL of - several alternatives that can actually be reached. It assumes - that the file mirrors.txt looks like

- -
-    mirrors.txt:
-http://best.mirror.example.org/
-http://second.best.mirror.example.org/mirror/of/best/
-https://yet.another.mirror/
-http://the.original.site/
-  
- -
-    <copy todir="${target}">
-      <first>
-        <restrict>
-          <resourcelist>
-            <file file="mirrors.txt"/>
-          </resourcelist>
-          <exists/>
-        </restrict>
-      </first>
-    </copy>
-  
-
- - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/selectors-program.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/selectors-program.html deleted file mode 100644 index 074a5426..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/selectors-program.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - -Programming Selectors in Apache Ant - - - -

Programming your own Selectors

- -

Selector Programming API

- -

Want to define your own selectors? It's easy!

- -

First, pick the type of selector that you want to define. There - are three types, and a recipe for each one follows. Chances are - you'll want to work with the first one, Custom Selectors.

- -
    -
  1. Custom Selectors - -

    This is the category that Apache Ant provides specifically for you to - define your own Selectors. Anywhere you want to use your selector - you use the <custom> element and specify - the class name of your selector within it. See the - Custom Selectors - section of the Selector page for details. The - <custom> element can be used anywhere - the core selectors can be used. It can be contained within - Selector Containers, - for example.

    - -

    To create a new Custom Selector, you have to create a class that - implements - org.apache.tools.ant.types.selectors.ExtendFileSelector. - The easiest way to do that is through the convenience base class - org.apache.tools.ant.types.selectors.BaseExtendSelector, - which provides all of the methods for supporting - <param> tags. First, override the - isSelected() method, and optionally the - verifySettings() method. If your custom - selector requires parameters to be set, you can also override - the setParameters() method and interpret the - parameters that are passed in any way you like. Several of the - core selectors demonstrate how to do that because they can - also be used as custom selectors.

    - -
  2. Core Selectors - -

    These are the selectors used by Ant itself. To implement one of - these, you will have to alter some of the classes contained within - Ant.

    - -
      -
    • First, create a class that implements - org.apache.tools.ant.types.selectors.FileSelector. - You can either choose to implement all methods yourself from - scratch, or you can extend - org.apache.tools.ant.types.selectors.BaseSelector - instead, a convenience class that provides reasonable default - behaviour for many methods.

      - -

      There is only one method required. - public boolean isSelected(File basedir, String filename, - File file) - is the real purpose of the whole exercise. It returns true - or false depending on whether the given file should be - selected from the list or not.

      - -

      If you are using - org.apache.tools.ant.types.selectors.BaseSelector - there are also some predefined behaviours you can take advantage - of. Any time you encounter a problem when setting attributes or - adding tags, you can call setError(String errmsg) and the class - will know that there is a problem. Then, at the top of your - isSelected() method call validate() and - a BuildException will be thrown with the contents of your error - message. The validate() method also gives you a - last chance to check your settings for consistency because it - calls verifySettings(). Override this method and - call setError() within it if you detect any - problems in how your selector is set up.

      - -

      You may also want to override toString().

      - -
    • Put an add method for your selector in - org.apache.tools.ant.types.selectors.SelectorContainer. - This is an interface, so you will also have to add an implementation - for the method in the classes which implement it, namely - org.apache.tools.ant.types.AbstractFileSet, - org.apache.tools.ant.taskdefs.MatchingTask and - org.apache.tools.ant.types.selectors.BaseSelectorContainer. - Once it is in there, it will be available everywhere that core - selectors are appropriate.

      -
    - -
  3. Selector Containers -

    Got an idea for a new Selector Container? Creating a new one is - no problem:

    -
      -
    • Create a new class that implements - org.apache.tools.ant.types.selectors.SelectorContainer. - This will ensure that your new - Container can access any new selectors that come along. Again, there - is a convenience class available for you called - org.apache.tools.ant.types.selectors.BaseSelectorContainer. -

      -
    • Implement the - public boolean isSelected(String filename, File file) - method to do the right thing. Chances are you'll want to iterate - over the selectors under you, so use - selectorElements() to get an iterator that will do - that.

      -
    • Again, put an add method for your container in - org.apache.tools.ant.types.selectors.SelectorContainer - and its implementations - org.apache.tools.ant.types.AbstractFileSet and - org.apache.tools.ant.types.selectors.BaseSelectorContainer. -

      -
    -
- -

Testing Selectors

- -

For a robust component (and selectors are (Project)Components) tests are - necessary. For testing Tasks we use JUnit TestCases - more specific - org.apache.tools.ant.BuildFileRule extends org.junit.rules.ExternalResource. - Some of its features like configure the (test) project by reading its buildfile and - execute targets we need for selector tests also. Therefore we use that BuildFileRule. - But testing selectors requires some more work: having a set of files, instantiate - and configure the selector, check the selection work and more. Because we usually - extend BaseExtendSelector its features have to be tested also (e.g. setError()). -

- -

That's why we have a test rule for doing our selector tests: - org.apache.tools.ant.types.selectors.BaseSelectorRule.

- -

This class extends ExternalResource and therefore can included in the set of Ant's - unit tests. It holds an instance of preconfigured BuildFileRule. Configuration - is done by parsing the src/etc/testcases/types/selectors.xml. BaseSelectorRule - then gives us helper methods for handling multiple selections.

- -

Because the term "testcase" or "testenvironment" are so often used, this - special testenvironment got a new name: bed. The setup and cleanup of - the bed is all handled by the BaseSelectorRule so any test only has to handle - the actual test scenarios

- -

A usual test scenario is:

-
    -
  1. instantiate the selector
  2. -
  3. configure the selector
  4. -
  5. let the selector do some work
  6. -
  7. verify the work
  8. -
- - - -

An example test would be:

-package org.apache.tools.ant.types.selectors;
-
-public class MySelectorTest {
-
-    @Rule
-    public final BaseSelectorRule selectorRule = new BaseSelectorRule();
-
-    @Test
-    public void testCase1() {
-
-
-        // Configure the selector
-        MySelector s = new MySelector();
-        s.addParam("key1", "value1");
-        s.addParam("key2", "value2");
-        s.setXX(true);
-        s.setYY("a value");
-
-        // do the tests
-        assertEquals("FTTTTTTTT", selectorRule.selectionString(s));
-    }
-}
-    
- As an example of an error JUnit could log
-    [junit]     FAILED
-    [junit] Error for files: .;copy.filterset.filtered;tar/gz/asf-logo.gif.tar.gz
-    [junit] expected:<FTTTFTTTF...> but was:<TTTTTTTTT...>
-    [junit] junit.framework.ComparisonFailure: Error for files: .;copy.filterset.filtered;tar/gz/asf-logo.gif.tar.gz
-    [junit] expected:<FTTTFTTTF...> but was:<TTTTTTTTT...>
-    [junit]     at junit.framework.Assert.assertEquals(Assert.java:81)
-    [junit]     at org.apache.tools.ant.types.selectors.BaseSelectorTest.performTest(BaseSelectorTest.java:194)
-    

- -

Described above the test class should provide a getInstance() - method. But that isn't used here. The used getSelector() method is - implemented in the base class and gives an instance of an Ant Project to - the selector. This is usually done inside normal build file runs, but not - inside this special environment, so this method gives the selector the - ability to use its own Project object (getProject()), for example - for logging.

- - -

Logging

- -

During development and maybe later you sometimes need the output of information. - Therefore Logging is needed. Because the selector extends BaseExtendSelector or directly - BaseSelector it is an Ant DataType and therefore a ProjectComponent.
- That means that you have access to the project object and its logging capability. - ProjectComponent itself provides log methods which will do the - access to the project instance. Logging is therefore done simply with: -

-        log( "message" );
-    
- or -
-        log( "message" , loglevel );
-    
- where the loglevel is one of the values -

- - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/selectors.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/selectors.html deleted file mode 100644 index 560b416c..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/selectors.html +++ /dev/null @@ -1,1566 +0,0 @@ - - - - - - Selectors in Apache Ant - - - -

Selectors

- -

Selectors are a mechanism whereby the files that make up a - <fileset> can be selected based on criteria - other than filename as provided by the <include> - and <exclude> tags.

- -

How to use a Selector

- -

A selector is an element of FileSet, and appears within it. It can - also be defined outside of any target by using the <selector> tag - and then using it as a reference. -

- -

Different selectors have different attributes. Some selectors can - contain other selectors, and these are called - Selector Containers. - There is also a category of selectors that allow - user-defined extensions, called - Custom Selectors. - The ones built in to Apache Ant are called - Core Selectors. -

- -

Core Selectors

- -

Core selectors are the ones that come standard - with Ant. They can be used within a fileset and can be contained - within Selector Containers.

- -

The core selectors are:

- - - -

Contains Selector

- -

The <contains> tag in a FileSet limits - the files defined by that fileset to only those which contain the - string specified by the text attribute. - .

-

The <contains> selector can be used as a - ResourceSelector (see the - <restrict> - ResourceCollection).

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
textSpecifies the text that every file must contain - Yes
casesensitiveWhether to pay attention to case when looking - for the string in the text attribute. Default is - true. - No
ignorewhitespaceWhether to eliminate whitespace before checking - for the string in the text attribute. Default is - false. - No
encodingEncoding of the resources being selected. - Required in practice if the encoding of the files being - selected is different from the default encoding of the JVM - where Ant is running. - Since Ant 1.9.0 - No
- -

Here is an example of how to use the Contains Selector:

- -
-<fileset dir="${doc.path}" includes="**/*.html">
-    <contains text="script" casesensitive="no"/>
-</fileset>
-
- -

Selects all the HTML files that contain the string - script.

- - -

Date Selector

- -

The <date> tag in a FileSet will put - a limit on the files specified by the include tag, so that tags - whose last modified date does not meet the date limits specified - by the selector will not end up being selected.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
datetimeSpecifies the date and time to test for. - Should be in the format MM/DD/YYYY HH:MM AM_or_PM, or - an alternative pattern specified via the pattern - attribute. - At least one of the two.
millisThe number of milliseconds since 1970 that should - be tested for. It is usually much easier to use the datetime - attribute. -
whenIndicates how to interpret the date, whether - the files to be selected are those whose last modified times should - be before, after, or equal to the specified value. Acceptable - values for this attribute are: -
    -
  • before - select files whose last modified date is before the indicated date -
  • after - select files whose last modified date is after the indicated date -
  • equal - select files whose last modified date is this exact date -
- The default is equal. -
No
granularityThe number of milliseconds leeway to use when - comparing file modification times. This is needed because not every - file system supports tracking the last modified time to the - millisecond level. Default is 0 milliseconds, or 2 seconds on DOS systems. - No
patternThe SimpleDateFormat-compatible pattern - to use when interpreting the datetime attribute. - Since Ant 1.6.2 - No
checkdirs - Indicates whether or not to check dates on directories. - No, defaults to false
- -

Here is an example of how to use the Date Selector:

- -
-<fileset dir="${jar.path}" includes="**/*.jar">
-    <date datetime="01/01/2001 12:00 AM" when="before"/>
-</fileset>
-
- -

Selects all JAR files which were last modified before midnight - January 1, 2001.

- - -

Depend Selector

- -

The <depend> tag selects files - whose last modified date is later than another, equivalent file in - another location.

- -

The <depend> tag supports the use of a - contained <mapper> element - to define the location of the file to be compared against. If no - <mapper> element is specified, the - identity type mapper is used.

- -

The <depend> selector is case-sensitive.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
targetdirThe base directory to look for the files to compare - against. The precise location depends on a combination of this - attribute and the <mapper> element, if any. - Yes
granularityThe number of milliseconds leeway to give before - deciding a file is out of date. This is needed because not every - file system supports tracking the last modified time to the - millisecond level. Default is 0 milliseconds, or 2 seconds on DOS systems. - No
- -

Here is an example of how to use the Depend Selector:

- -
-<fileset dir="${ant.1.5}/src/main" includes="**/*.java">
-    <depend targetdir="${ant.1.4.1}/src/main"/>
-</fileset>
-
- -

Selects all the Java source files which were modified in the - 1.5 release. -

- - -

Depth Selector

- -

The <depth> tag selects files based on - how many directory levels deep they are in relation to the base - directory of the fileset. -

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
minThe minimum number of directory levels below - the base directory that a file must be in order to be selected. - Default is no limit. - At least one of the two.
maxThe maximum number of directory levels below - the base directory that a file can be and still be selected. - Default is no limit. -
- -

Here is an example of how to use the Depth Selector:

- -
-<fileset dir="${doc.path}" includes="**/*">
-    <depth max="1"/>
-</fileset>
-
- -

Selects all files in the base directory and one directory below - that.

- - -

Different Selector

- -

The <different> selector will select a file - if it is deemed to be 'different' from an equivalent file in - another location. The rules for determining difference between - the two files are as follows: -

    -
  1. If a file is only present in the resource collection you apply - the selector to but not in targetdir (or after applying the - mapper) the file is selected. -
  2. If a file is only present in targetdir (or after applying the - mapper) it is ignored. -
  3. Files with different lengths are different. -
  4. If ignoreFileTimes is turned off, then differing file - timestamps will cause files to be regarded as different. -
  5. Unless ignoreContents is set to true, - a byte-for-byte check is run against the two files. -
- - This is a useful selector to work with programs and tasks that don't handle - dependency checking properly; even if a predecessor task always creates its - output files, followup tasks can be driven off copies made with a different - selector, so their dependencies are driven on the absolute state of the - files, not just a timestamp. For example: anything fetched from a web site, - or the output of some program. To reduce the amount of checking, when using - this task inside a <copy> task, set - preservelastmodified to true to propagate the timestamp - from the source file to the destination file.

- - The <different> selector supports the use of a - contained <mapper> element - to define the location of the file to be compared against. If no - <mapper> element is specified, the - identity type mapper is used.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
targetdirThe base directory to look for the files to compare - against. The precise location depends on a combination of this - attribute and the <mapper> element, if any. - Yes
ignoreFileTimesWhether to use file times in the comparison or not. - Default is true (time differences are ignored). - No
ignoreContentsWhether to do a byte per byte compare. - Default is false (contents are compared). - Since Ant 1.6.3 - No
granularityThe number of milliseconds leeway to give before - deciding a file is out of date. This is needed because not every - file system supports tracking the last modified time to the - millisecond level. Default is 0 milliseconds, or 2 seconds on DOS systems. - No
- -

Here is an example of how to use the Different Selector:

- -
-<fileset dir="${ant.1.5}/src/main" includes="**/*.java">
-    <different targetdir="${ant.1.4.1}/src/main"
-        ignoreFileTimes="true"/>
-</fileset>
-
- -

Compares all the Java source files between the 1.4.1 and the 1.5 release - and selects those who are different, disregarding file times. -

- -

Filename Selector

- -

The <filename> tag acts like the - <include> and <exclude> - tags within a fileset. By using a selector instead, however, - one can combine it with all the other selectors using whatever - selector container is desired. -

- -

The <filename> selector is - case-sensitive.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameThe name of files to select. The name parameter - can contain the standard Ant wildcard characters. - Exactly one of - the two
regexThe regular expression matching files to select.
casesensitiveWhether to pay attention to case when looking - at file names. Default is "true". - No
negateWhether to reverse the effects of this filename - selection, therefore emulating an exclude rather than include - tag. Default is "false". - No
- -

Here is an example of how to use the Filename Selector:

- -
-<fileset dir="${doc.path}" includes="**/*">
-    <filename name="**/*.css"/>
-</fileset>
-
- -

Selects all the cascading style sheet files.

- - -

Present Selector

- -

The <present> tag selects files - that have an equivalent file in another directory tree.

- -

The <present> tag supports the use of a - contained <mapper> element - to define the location of the file to be tested against. If no - <mapper> element is specified, the - identity type mapper is used.

- -

The <present> selector is case-sensitive.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
targetdirThe base directory to look for the files to compare - against. The precise location depends on a combination of this - attribute and the <mapper> element, if any. - Yes
presentWhether we are requiring that a file is present in - the src directory tree only, or in both the src and the target - directory tree. Valid values are: -
    -
  • srconly - select files only if they are in the src - directory tree but not in the target directory tree -
  • both - select files only if they are present both in the - src and target directory trees -
- Default is both. Setting this attribute to "srconly" - is equivalent to wrapping the selector in the <not> - selector container. -
No
- -

Here is an example of how to use the Present Selector:

- -
-<fileset dir="${ant.1.5}/src/main" includes="**/*.java">
-    <present present="srconly" targetdir="${ant.1.4.1}/src/main"/>
-</fileset>
-
- -

Selects all the Java source files which are new in the - 1.5 release. -

- -

Regular Expression Selector

- -

The <containsregexp> tag in a FileSet limits - the files defined by that fileset to only those which contents contain a - match to the regular expression specified by the expression attribute. -

-

The <containsregexp> selector can be used as a - ResourceSelector (see the - <restrict> - ResourceCollection).

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
expressionSpecifies the regular expression that must - match true in every fileYes
casesensitivePerform a case sensitive match. Default is - true. since Ant 1.8.2No
multiline - Perform a multi line match. - Default is false. since Ant 1.8.2No
singleline - This allows '.' to match new lines. - SingleLine is not to be confused with multiline, SingleLine is a perl - regex term, it corresponds to dotall in java regex. - Default is false. since Ant 1.8.2No
- -

Here is an example of how to use the regular expression Selector:

- -
-<fileset dir="${doc.path}" includes="*.txt">
-    <containsregexp expression="[4-6]\.[0-9]"/>
-</fileset>
-
- -

Selects all the text files that match the regular expression - (have a 4,5 or 6 followed by a period and a number from 0 to 9). - - -

Size Selector

- -

The <size> tag in a FileSet will put - a limit on the files specified by the include tag, so that tags - which do not meet the size limits specified by the selector will not - end up being selected.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
valueThe size of the file which should be tested for. - Yes
unitsThe units that the value attribute - is expressed in. When using the standard single letter SI - designations, such as "k","M", or - "G", multiples of 1000 are used. If you want to use - power of 2 units, use the IEC standard: "Ki" for 1024, - "Mi" for 1048576, and so on. The default is no units, - which means the value attribute expresses the exact - number of bytes. - No
whenIndicates how to interpret the size, whether - the files to be selected should be larger, smaller, or equal to - that value. Acceptable values for this attribute are: -
    -
  • less - select files less than the indicated size -
  • more - select files greater than the indicated size -
  • equal - select files this exact size -
- The default is equal. -
No
- -

Here is an example of how to use the Size Selector:

- -
-<fileset dir="${jar.path}">
-  <patternset>
-    <include name="**/*.jar"/>
-  </patternset>
-  <size value="4" units="Ki" when="more"/>
-</fileset>
-
- -

Selects all JAR files that are larger than 4096 bytes.

- -

Type Selector

- -

The <type> tag selects files of a certain type: - directory or regular.

- - - - - - - - - - - - -
AttributeDescriptionRequired
typeThe type of file which should be tested for. - Acceptable values are: -
    -
  • file - regular files
  • -
  • dir - directories
  • -
-
Yes
- -

Here is an example of how to use the Type Selector to select only - directories in ${src}

- -
-<fileset dir="${src}">
-  <type type="dir"/>
-</fileset>
-
- -

The Type Selector is often used in conjunction with other selectors. - For example, to select files that also exist in a template - directory, but avoid selecting empty directories, use: - -

-<fileset dir="${src}">
-    <and>
-        <present targetdir="template"/>
-        <type type="file"/>
-    </and>
-</fileset>
-
- - -

Modified Selector

-

The <modified> selector computes a value for a file, compares that - to the value stored in a cache and select the file, if these two values - differ.

-

Because this selector is highly configurable the order in which the selection is done - is:

    -
  1. get the absolute path for the file
  2. -
  3. get the cached value from the configured cache (absolute path as key)
  4. -
  5. get the new value from the configured algorithm
  6. -
  7. compare these two values with the configured comparator
  8. -
  9. update the cache if needed and requested
  10. -
  11. do the selection according to the comparison result
  12. -
-

The comparison, computing of the hashvalue and the store is done by implementation - of special interfaces. Therefore they may provide additional parameters.

- -

The <modified> selector can be used as a - ResourceSelector (see the - <restrict> - ResourceCollection). - In that case it maps simple file resources to files and does its job. If the - resource is from another type, the <modified> selector tries - to (attention!) copy the content into a local file for computing the - hashvalue.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
algorithm The type of algorithm should be used. - Acceptable values are (further information see later): -
    -
  • hashvalue - HashvalueAlgorithm
  • -
  • digest - DigestAlgorithm
  • -
  • checksum - ChecksumAlgorithm
  • -
-
No, defaults to digest
cache The type of cache should be used. - Acceptable values are (further information see later): -
    -
  • propertyfile - PropertyfileCache
  • -
-
No, defaults to propertyfile
comparator The type of comparator should be used. - Acceptable values are (further information see later): -
    -
  • equal - EqualComparator
  • -
  • rule - java.text.RuleBasedCollator - - (see note for restrictions) -
  • -
-
No, defaults to equal
algorithmclass Classname of custom algorithm implementation. Lower - priority than algorithm. No
cacheclass Classname of custom cache implementation. Lower - priority than cache. No
comparatorclass Classname of custom comparator implementation. Lower - priority than comparator. No
update Should the cache be updated when values differ? (boolean) No, defaults to true
seldirs Should directories be selected? (boolean) No, defaults to true
selres Should Resources without an InputStream, and - therefore without checking, be selected? (boolean) No, defaults to true. Only relevant - when used as ResourceSelector.
delayupdate If set to true, the storage of the cache will be delayed until the - next finished BuildEvent; task finished, target finished or build finished, - whichever comes first. This is provided for increased performance. If set - to false, the storage of the cache will happen with each change. This - attribute depends upon the update attribute. (boolean) No, defaults to true
- -

These attributes can be set with nested <param/> tags. With <param/> - tags you can set other values too - as long as they are named according to - the following rules:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Algorithm options
NameDescription
hashvalue Reads the content of a file into a java.lang.String - and use thats hashValue(). No additional configuration required. -
digest Uses java.security.MessageDigest. This Algorithm supports - the following attributes: -
    -
  • algorithm.algorithm (optional): Name of the Digest algorithm - (e.g. 'MD5' or 'SHA', default = MD5)
  • -
  • algorithm.provider (optional): Name of the Digest provider - (default = null)
  • -
-
checksum Uses java.util.zip.Checksum. This Algorithm supports - the following attributes: -
    -
  • algorithm.algorithm (optional): Name of the algorithm - (e.g. 'CRC' or 'ADLER', default = CRC)
  • -
-
Cache options
propertyfile Use the java.util.Properties class and its possibility - to load and store to file. - This Cache implementation supports the following attributes: -
    -
  • cache.cachefile (optional): Name of the properties-file - (default = cache.properties)
  • -
-
Comparator options
equal Very simple object comparison.
rule Uses java.text.RuleBasedCollator for Object - comparison. - - (see note for restrictions) -
- -

The <modified> selector supports a nested - <classpath> element that represents a - PATH like structure for finding custom interface implementations.

- -

Here are some examples of how to use the Modified Selector:

- -
-    <copy todir="dest">
-        <fileset dir="src">
-            <modified/>
-        </fileset>
-    </copy>
-    
-

This will copy all files from src to dest which content has changed. - Using an updating PropertyfileCache with cache.properties and - MD5-DigestAlgorithm.

- -
-    <copy todir="dest">
-        <fileset dir="src">
-            <modified update="true"
-                      seldirs="true"
-                      cache="propertyfile"
-                      algorithm="digest"
-                      comparator="equal">
-                <param name="cache.cachefile"     value="cache.properties"/>
-                <param name="algorithm.algorithm" value="MD5"/>
-            </modified>
-        </fileset>
-    </copy>
-    
-

This is the same example rewritten as CoreSelector with setting the all the values - (same as defaults are).

- -
-    <copy todir="dest">
-        <fileset dir="src">
-            <custom class="org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector">
-                <param name="update"     value="true"/>
-                <param name="seldirs"    value="true"/>
-                <param name="cache"      value="propertyfile"/>
-                <param name="algorithm"  value="digest"/>
-                <param name="comparator" value="equal"/>
-                <param name="cache.cachefile"     value="cache.properties"/>
-                <param name="algorithm.algorithm" value="MD5"/>
-            </custom>
-        </fileset>
-    </copy>
-    
-

And this is the same rewritten as CustomSelector.

- -
-  <target name="generate-and-upload-site">
-      <echo> generate the site using forrest </echo>
-      <antcall target="site"/>
-
-      <echo> upload the changed file </echo>
-      <ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.pwd}">
-          <fileset dir="htdocs/manual">
-              <modified/>
-          </fileset>
-      </ftp>
-  </target>
-    
-

A useful scenario for this selector inside a build environment - for homepage generation (e.g. with - Apache Forrest). Here all changed files are uploaded to the server. The - CacheSelector saves therefore much upload time.

- -
-  <modified cacheclassname="com.mycompany.MyCache">
-      <classpath>
-          <pathelement location="lib/mycompany-antutil.jar"/>
-      </classpath>
-  </modified>
-    
-

Uses com.mycompany.MyCache from a jar outside of Ants own classpath - as cache implementation

- -

Note on RuleBasedCollator

-

The RuleBasedCollator needs a format for its work, but its needed while - instantiation. There is a problem in the initialization algorithm for this - case. Therefore you should not use this (or tell me the workaround :-).

- -

Signed Selector

- -

- The <signedselector> tag selects signed files and optionally - signed with a certain name. -

-

- This selector has been added in Apache Ant 1.7. -

- - - - - - - - - - - -
AttributeDescriptionRequired
name The signature name to check for.no
- -

Readable Selector

- -

The <readable> selector selects only files - that are readable. Ant only invokes - java.io.File#canRead so if a file is unreadable - but the Java VM cannot detect this state, this selector will - still select the file.

- -

Writable Selector

- -

The <writable> selector selects only files - that are writable. Ant only invokes - java.io.File#canWrite so if a file is unwritable - but the Java VM cannot detect this state, this selector will - still select the file.

- -

Script Selector

- -

- The <scriptselector> element enables you - to write a complex selection algorithm in any - Apache BSF - or - JSR 223 - supported language. - See the Script task for - an explanation of scripts and dependencies. -

-

- This selector was added in Apache Ant 1.7. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
languagelanguage of the script.yes
manager - The script engine manager to use. - See the script task - for using this attribute. - No - default is "auto"
srcfilename of the scriptno
setbeanswhether to have all properties, references and targets as - global variables in the script.No, default is "true".
classpath - The classpath to pass into the script. - No
classpathrefThe classpath to use, given as a - reference to a path defined elsewhere. - No
-

- This selector can take a nested <classpath> element. - See the script task - on how to use this element. -

-

- If no src attribute is supplied, the script must be nested - inside the selector declaration. -

-

The embedded script is invoked for every test, with - the bean self - is bound to the selector. It has an attribute selected - must can be set using setSelected(boolean) to select that - file. - -

- - The following beans are configured for every script, alongside - the classic set of project, properties, and targets. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BeanDescriptionType
selfselector instanceorg.apache.tools.ant.types.optional
filenamefilename of the selectionString
filefile of the selectionjava.io.File
basedirFileset base directoryjava.io.File
-

- The self bean maps to the selector, which has the following - attributes. Only the selected flag is writable, the rest - are read only via their getter methods. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionType
selectedwriteable flag to select this fileboolean
filenamefilename of the selectionString
filefile of the selectionjava.io.File
basedirFileset base directoryjava.io.File
- -

- Example -

-
-    <scriptselector language="javascript">
-      self.setSelected(true);
-    </scriptselector>
-
-

- Selects every file. -

- -
-    <scriptselector language="javascript">
-      self.setSelected((filename.length%2)==0);
-    </scriptselector>
-
-Select files whose filename length is even. - -

Selector Containers

- -

To create more complex selections, a variety of selectors that - contain other selectors are available for your use. They combine the - selections of their child selectors in various ways.

- -

The selector containers are:

- - - -

All selector containers can contain any other selector, including - other containers, as an element. Using containers, the selector tags - can be arbitrarily deep. Here is a complete list of allowable - selector elements within a container:

- - - -

And Selector

- -

The <and> tag selects files that are - selected by all of the elements it contains. It returns as - soon as it finds a selector that does not select the file, - so it is not guaranteed to check every selector. -

- -

Here is an example of how to use the And Selector:

- -
-<fileset dir="${dist}" includes="**/*.jar">
-    <and>
-        <size value="4" units="Ki" when="more"/>
-        <date datetime="01/01/2001 12:00 AM" when="before"/>
-    </and>
-</fileset>
-
- -

Selects all the JAR file larger than 4096 bytes which haven't been update - since the last millennium. -

- - -

Majority Selector

- -

The <majority> tag selects files provided - that a majority of the contained elements also select it. Ties are - dealt with as specified by the allowtie attribute. -

- - - - - - - - - - - - -
AttributeDescriptionRequired
allowtieWhether files should be selected if there - are an even number of selectors selecting them as are - not selecting them. Default is true. - No
- - -

Here is an example of how to use the Majority Selector:

- -
-<fileset dir="${docs}" includes="**/*.html">
-    <majority>
-        <contains text="project" casesensitive="false"/>
-        <contains text="taskdef" casesensitive="false"/>
-        <contains text="IntrospectionHelper" casesensitive="true"/>
-    </majority>
-</fileset>
-
- -

Selects all the HTML files which contain at least two of the three - phrases "project", "taskdef", and "IntrospectionHelper" (this last phrase must - match case exactly). -

- - -

None Selector

- -

The <none> tag selects files that are - not selected by any of the elements it contains. It returns as - soon as it finds a selector that selects the file, - so it is not guaranteed to check every selector. -

- -

Here is an example of how to use the None Selector:

- -
-<fileset dir="${src}" includes="**/*.java">
-    <none>
-        <present targetdir="${dest}"/>
-        <present targetdir="${dest}">
-            <mapper type="glob" from="*.java" to="*.class"/>
-        </present>
-    </none>
-</fileset>
-
- -

Selects only Java files which do not have equivalent java or - class files in the dest directory. -

- - -

Not Selector

- -

The <not> tag reverses the meaning of the - single selector it contains. -

- -

Here is an example of how to use the Not Selector:

- -
-<fileset dir="${src}" includes="**/*.java">
-    <not>
-        <contains text="test"/>
-    </not>
-</fileset>
-
- -

Selects all the files in the src directory that do not contain the - string "test". -

- - -

Or Selector

- -

The <or> tag selects files that are - selected by any one of the elements it contains. It returns as - soon as it finds a selector that selects the file, - so it is not guaranteed to check every selector. -

- -

Here is an example of how to use the Or Selector:

- -
-<fileset dir="${basedir}">
-    <or>
-        <depth max="0"/>
-        <filename name="*.png"/>
-        <filename name="*.gif"/>
-        <filename name="*.jpg"/>
-    </or>
-</fileset>
-
- -

Selects all the files in the top directory along with all the - image files below it. -

- - -

Selector Reference

- -

The <selector> tag is used to create selectors - that can be reused through references. It is the only selector which can - be used outside of - any target, as an element of the <project> tag. It - can contain only one other selector, but of course that selector can - be a container. -

- -

The <selector> tag can also be used to select - files conditionally based on whether an Ant property exists or not. - This functionality is realized using the "if" and - "unless" attributes in exactly the same way they - are used on targets or on the <include> and - <exclude> tags within a - <patternset>.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
ifAllow files to be selected only if the named - property is set. - No
unlessAllow files to be selected only if the named - property is not set. - No
- -

Here is an example of how to use the Selector Reference:

- -
-<project default="all" basedir="./ant">
-
-    <selector id="completed">
-        <none>
-            <depend targetdir="build/classes">
-                <mapper type="glob" from="*.java" to="*.class"/>
-            </depend>
-            <depend targetdir="docs/manual/api">
-                <mapper type="glob" from="*.java" to="*.html"/>
-            </depend>
-        </none>
-    </selector>
-
-    <target>
-        <zip>
-            <fileset dir="src/main" includes="**/*.java">
-                <selector refid="completed"/>
-            </fileset>
-        </zip>
-    </target>
-
-</project>
-
- -

Zips up all the Java files which have an up-to-date equivalent - class file and javadoc file associated with them. -

- -

And an example of selecting files conditionally, based on whether - properties are set:

- -
-<fileset dir="${working.copy}">
-    <or>
-        <selector if="include.tests">
-            <filename name="**/*Test.class">
-        </selector>
-        <selector if="include.source">
-            <and>
-                <filename name="**/*.java">
-                <not>
-                    <selector unless="include.tests">
-                        <filename name="**/*Test.java">
-                    </selector>
-                </not>
-            </and>
-        </selector>
-    </or>
-</fileset>
-
- -

A fileset that conditionally contains Java source files and Test - source and class files.

- -

Custom Selectors

- -

You can write your own selectors and use them within the selector - containers by specifying them within the <custom> tag.

- -

First, you have to write your selector class in Java. The only - requirement it must meet in order to be a selector is that it implements - the org.apache.tools.ant.types.selectors.FileSelector - interface, which contains a single method. See - Programming Selectors in Ant for - more information.

- -

Once that is written, you include it in your build file by using - the <custom> tag. -

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classnameThe name of your class that implements - org.apache.tools.ant.types.selectors.FileSelector. - Yes
classpathThe classpath to use in order to load the - custom selector class. If neither this classpath nor the - classpathref are specified, the class will be - loaded from the classpath that Ant uses. - No
classpathrefA reference to a classpath previously - defined. If neither this reference nor the - classpath above are specified, the class will be - loaded from the classpath that Ant uses. - No
- -

Here is how you use <custom> to - use your class as a selector: -

- -
-<fileset dir="${mydir}" includes="**/*">
-    <custom classname="com.mydomain.MySelector">
-        <param name="myattribute" value="myvalue"/>
-    </custom>
-</fileset>
-
- -

A number of core selectors can also be used as custom selectors - by specifying their attributes using <param> elements. These - are

- - - -

Here is the example from the Depth Selector section rewritten - to use the selector through <custom>.

- -
-<fileset dir="${doc.path}" includes="**/*">
-    <custom classname="org.apache.tools.ant.types.selectors.DepthSelector">
-        <param name="max" value="1"/>
-    </custom>
-</fileset>
-
- -

Selects all files in the base directory and one directory below - that.

- -

For more details concerning writing your own selectors, consult - Programming Selectors in Ant.

- - - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/tarfileset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/tarfileset.html deleted file mode 100644 index 499ed798..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/tarfileset.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - -TarFileSet Type - - -

TarFileSet

- -

TarFileSet has been added as a stand-alone type in Apache Ant -1.7.

- -

A <tarfileset> is a special form of a <fileset> which can behave in 2 -different ways :
-

- -

<tarfileset> supports all attributes of <fileset> - in addition to those listed below. Note that tar archives in general - don't contain entries with leading slashes so you shouldn't use - include/exclude patterns that start with slashes either. -

-

A tarfileset can be defined with the id attribute and referred to with the refid attribute. This is also true -for tarfileset which has been added in Ant 1.7.
-

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
prefixall files in the fileset are prefixed with that -path in the archive.No
fullpaththe file described by the fileset is placed at -that exact location in the archive.No
srcmay be used in place of the dir attribute - to specify a tar file whose contents will be extracted and included -in the archive.No
filemodeA 3 digit octal string, specify the user, group -and other modes in the standard Unix fashion. Only applies to -plain files. Default is 644.No
dirmodeA 3 digit octal string, specify the user, group -and other modes in the standard Unix fashion. Only applies to -directories. Default is 755.No
usernameThe username for the tar entry. This is not the same as the UID. - No
groupThe groupname for the tar entry. This is not the same as the GID. - No
uidThe user identifier (UID) for the tar entry. This is an integer value - and is not the same as the username. - No
gidThe group identifier (GID) for the tar entry. - No
erroronmissingarchive - Specify what happens if the archive does not exist. - If true, a build error will happen; if false, the fileset - will be ignored/empty. - Defaults to true. - Since Ant 1.8.0 - No
encodingThe character encoding to use for filenames - inside the zip file. For a list of possible values see the Supported Encodings. - Defaults to the platform's default character encoding. - Since Ant 1.9.5 - No
-

The fullpath attribute can only be set for filesets that -represent a single file. The prefix and fullpath -attributes cannot both be set on the same fileset.

-

When using the src attribute, include and exclude patterns -may be used to specify a subset of the archive for inclusion in the -archive as with the dir attribute.

- -

Please note that currently only the tar task uses the permission and -ownership attributes.

- -

Parameters specified as nested elements

- -

any resource or single element -resource collection

- -

The specified resource will be used as src.

- -

Examples

-
-
-  <copy todir="some-dir">
-    <tarfileset includes="lib/**">
-      <bzip2resource>
-        <url url="http://example.org/dist/some-archive.tar.bz2"/>
-      </bzip2resource>
-    </tarfileset>
-  </copy>
-      
- -

downloads the archive some-archive.tar.bz2, uncompresses and -extracts it on the fly, copies the contents of the lib directory into -some-dir and discards the rest of the archive. File timestamps will -be compared between the archive's entries and files inside the target -directory, no files get overwritten unless they are out-of-date.

- - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/xmlcatalog.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/xmlcatalog.html deleted file mode 100644 index a0ddafc0..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/xmlcatalog.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - -XMLCatalog Type - - - - -

XMLCatalog

- -

An XMLCatalog is a catalog of public resources such as DTDs or -entities that are referenced in an XML document. Catalogs are -typically used to make web references to resources point to a locally -cached copy of the resource.

- -

This allows the XML Parser, XSLT Processor or other consumer of XML -documents -to efficiently allow a local substitution for a resource available on the -web. -

-

Note: This task uses, but does not depend on external -libraries not included in the Apache Ant distribution. See Library Dependencies for more -information.

-

This data type provides a catalog of resource locations based -on the -OASIS "Open Catalog" standard. The catalog entries are used -both for Entity resolution and URI resolution, in accordance with -the org.xml.sax.EntityResolver and -javax.xml.transform.URIResolver interfaces as defined -in the Java API for XML -Processing (JAXP) Specification.

-

For example, in a web.xml file, the DTD is referenced as: -

-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
-  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
-
-The XML processor, without XMLCatalog support, would need to retrieve the -DTD from -the URL specified whenever validation of the document was required. -

-

This can be very time consuming during the build process, -especially where network throughput is limited. Alternatively, you -can do the following: -

    -
  1. Copy web-app_2_2.dtd onto your local disk somewhere (either in the -filesystem or even embedded inside a jar or zip file on the classpath).
  2. -
  3. Create an <xmlcatalog> with a <dtd> -element whose location attribute points to the file.
  4. -
  5. Success! The XML processor will now use the local copy instead of calling out -to the internet.
  6. -
-

-

XMLCatalogs can appear inside tasks -that support this feature or at the same level as target -- i.e., as children of project for reuse across different -tasks, -e.g. XML Validation and XSLT Transformation. The XML Validate task -uses XMLCatalogs for entity resolution. The XSLT Transformation -task uses XMLCatalogs for both entity and URI resolution.

-

XMLCatalogs are specified as either a reference to another -XMLCatalog, defined previously in a build file, or as a list of -dtd or entity locations. In addition, -external catalog files may be specified in a nested catalogpath , -but they will be ignored unless the resolver library from -xml-commons is available in the system classpath. Due to backwards -incompatible changes in the resolver code after the release of -resolver 1.0, Ant will not support resolver.jar in version 1.0 - we -expect a resolver release 1.1 to happen before Ant 1.6 gets -released. A separate classpath for entity resolution may be -specified inline via nested classpath elements; otherwise -the system classpath is used for this as well.

-

XMLCatalogs can also be nested inside other XMLCatalogs. For -example, a "superset" XMLCatalog could be made by including several -nested XMLCatalogs that referred to other, previously defined -XMLCatalogs.

-

Resource locations can be specified either in-line or in -external catalog file(s), or both. In order to use an external -catalog file, the xml-commons resolver library ("resolver.jar") -must be in your path. External catalog files may be either -plain text format or -XML format. If the xml-commons resolver library is not found in the -classpath, external catalog files, specified in catalogpath, -will be ignored and a warning -will be logged. In this case, however, processing of inline entries will -proceed normally.

-

Currently, only <dtd> and -<entity> elements may be specified inline; these -roughly correspond to OASIS catalog entry types PUBLIC and -URI respectively. By contrast, external catalog files -may use any of the entry types defined in the - -+OASIS specification.

-

Entity/DTD/URI Resolution Algorithm

- -When an entity, DTD, or URI is looked up by the XML processor, the -XMLCatalog searches its list of entries to see if any match. That is, -it attempts to match the publicId attribute of each entry -with the PublicID or URI of the entity to be resolved. Assuming a -matching entry is found, XMLCatalog then executes the following steps: - -

1. Filesystem lookup

- -

The location is first looked up in the filesystem. If -the location is a relative path, the ant project basedir -attribute is used as the base directory. If the location -specifies an absolute path, it is used as is. Once we have an -absolute path in hand, we check to see if a valid and readable file -exists at that path. If so, we are done. If not, we proceed to the -next step.

- -

2. Classpath lookup

- -

The location is next looked up in the classpath. -Recall that jar files are merely fancy zip files. For classpath -lookup, the location is used as is (no base is -prepended). We use a Classloader to attempt to load the resource from -the classpath. For example, if hello.jar is in the classpath and it -contains foo/bar/blat.dtd it will resolve an entity whose -location is foo/bar/blat.dtd. Of course, it -will not resolve an entity whose location is -blat.dtd. - - -

3a. Apache xml-commons resolver lookup

- -

What happens next depends on whether the resolver library from -xml-commons is available on the classpath. If so, we defer all -further attempts at resolving to it. The resolver library supports -extremely sophisticated functionality like URL rewriting and so on, -which can be accessed by making the appropriate entries in external -catalog files (XMLCatalog does not yet provide inline support for all -of the entries defined in the OASIS -standard).

- -

3. URL-space lookup

- -

Finally, we attempt to make a URL out of the location. -At first this may seem like this would defeat the purpose of -XMLCatalogs -- why go back out to the internet? But in fact, this can -be used to (in a sense) implement HTTP redirects, substituting one URL -for another. The mapped-to URL might also be served by a local web -server. If the URL resolves to a valid and readable resource, we are -done. Otherwise, we give up. In this case, the XML processor will -perform its normal resolution algorithm. Depending on the processor -configuration, further resolution failures may or may not result in -fatal (i.e. build-ending) errors.

- -

XMLCatalog attributes

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
ida unique name for an XMLCatalog, used for referencing -the - XMLCatalog's contents from another XMLCatalogNo
refidthe id of another XMLCatalog whose -contents - you would like to be used for this XMLCatalogNo
- -

XMLCatalog nested elements

-

dtd/entity

-

The dtd and entity elements used to specify -XMLCatalogs are identical in their structure

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
publicIdThe public identifier used when defining a dtd or -entity, - e.g. "-//Sun Microsystems, Inc.//DTD Web Application -2.2//EN" - Yes
locationThe location of the local replacement to be used for -the public identifier specified. This may be specified as a file name, -resource name found on the classpath, or a URL. Relative paths will -be resolved according to the base, which by default is the Ant project -basedir. - Yes
-

classpath

-

The classpath to use for entity -resolution. The nested <classpath> is a -path-like structure.

-

catalogpath

-

-The nested catalogpath element is a path-like structure listing catalog files to -search. All files in this path are assumed to be OASIS catalog files, in -either - -plain text format or -XML format. Entries specifying nonexistent files will be ignored. If the -resolver library from xml-commons is not available in the classpath, all -catalogpaths will be ignored and a warning will be logged. -

-

Examples

-

Set up an XMLCatalog with a single dtd referenced locally in a user's -home -directory:

-
-    <xmlcatalog>
-        <dtd 
-            publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
-            location="/home/dion/downloads/docbook/docbookx.dtd"/>
-    </xmlcatalog>
-
-

Set up an XMLCatalog with a multiple dtds to be found either in the -filesystem (relative to the Ant project basedir) or in the classpath: -

-
-    <xmlcatalog id="commonDTDs">
-        <dtd 
-            publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
-            location="docbook/docbookx.dtd"/>
-        <dtd 
-            publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
-            location="web-app_2_2.dtd"/>
-    </xmlcatalog>
-
- -

Set up an XMLCatalog with a combination of DTDs and entities as -well as a nested XMLCatalog and external catalog files in both -formats:

- -
-    <xmlcatalog id="allcatalogs">
-        <dtd 
-            publicId="-//ArielPartners//DTD XML Article V1.0//EN"
-            location="com/arielpartners/knowledgebase/dtd/article.dtd"/>
-        <entity 
-            publicId="LargeLogo"
-            location="com/arielpartners/images/ariel-logo-large.gif"/>
-        <xmlcatalog refid="commonDTDs"/>
-            <catalogpath>
-                <pathelement location="/etc/sgml/catalog"/>
-                <fileset 
-                    dir="/anetwork/drive"
-                    includes="**/catalog"/>
-                <fileset 
-                    dir="/my/catalogs"
-                    includes="**/catalog.xml"/>
-            </catalogpath>
-        </xmlcatalog>
-    </xmlcatalog>
-
-

To reference the above XMLCatalog in an xslt task:

-

-    <xslt basedir="${source.doc}"
-           destdir="${dest.xdocs}"
-           extension=".xml"
-           style="${source.xsl.converter.docbook}"
-           includes="**/*.xml"
-           force="true">
-        <xmlcatalog refid="allcatalogs"/>
-    </xslt>
-
- - - - - diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Types/zipfileset.html b/framework/src/ant/apache-ant-1.9.6/manual/Types/zipfileset.html deleted file mode 100644 index 955e2718..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Types/zipfileset.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - -ZipFileSet Type - - -

ZipFileSet

- -

A <zipfileset> is a special form of a <fileset> which can behave in 2 -different ways :
-

- -

<zipfileset> supports all attributes of <fileset> - in addition to those listed below. Note that zip archives in general - don't contain entries with leading slashes so you shouldn't use - include/exclude patterns that start with slashes either.

- -

Since Ant 1.6, a zipfileset can be defined with the id attribute and referred to with -the refid attribute.
-

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
prefixall files in the fileset are prefixed with that -path in the archive.No
fullpaththe file described by the fileset is placed at -that exact location in the archive.No
srcmay be used in place of the dir attribute - to specify a zip file whose contents will be extracted and included -in the archive.No
filemodeA 3 digit octal string, specify the user, group -and other modes in the standard Unix fashion. Only applies to -plain files. Default is 644. since Ant 1.5.2.No
dirmodeA 3 digit octal string, specify the user, group -and other modes in the standard Unix fashion. Only applies to -directories. Default is 755. since Ant 1.5.2.No
encodingThe character encoding to use for filenames - inside the zip file. For a list of possible values see the Supported Encodings. - Defaults to the platform's default character encoding. - No
erroronmissingarchive - Specify what happens if the archive does not exist. - If true, a build error will happen; if false, the fileset - will be ignored/empty. - Defaults to true. - Since Ant 1.8.0 - No
-

The fullpath attribute can only be set for filesets that -represent a single file. The prefix and fullpath -attributes cannot both be set on the same fileset.

-

When using the src attribute, include and exclude patterns -may be used to specify a subset of the archive for inclusion in the -archive as with the dir attribute.

- -

Please note that currently only the tar and zip tasks use the permission.

- -

Parameters specified as nested elements

- -

any file system based resource or -single element resource collection

- -

The specified resource will be used as src.

- -

Examples

-
-
  <zip destfile="${dist}/manual.zip">
<zipfileset dir="htdocs/manual" prefix="docs/user-guide"/>
<zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/>
<zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/>
</zip>
-

zips all files in the htdocs/manual directory into -the docs/user-guide directory in the archive, adds the -file ChangeLog27.txt in the current directory as docs/ChangeLog.txt, -and includes all the html files in examples.zip under docs/examples. -The archive might end up containing the files:

- docs/user-guide/html/index.html
-docs/ChangeLog.txt
-docs/examples/index.html
-
- - - - -- cgit 1.2.3-korg