componentdef

Description

Adds a component definition to the current project. A component definition is the same as a typedef except:

  1. that it can only be used in other types or tasks that accept components (by having an add() method).
  2. multiple components may have the same name, provided they implement different interfaces.

The purpose of this is to allow internal Apache Ant definitions to be made for tags like and or or.

Examples

Define two components with the same name or; one is a condition (see conditions) and one is a selector (see selectors).

<componentdef name="or" onerror="ignore"
              classname="com.apache.tools.ant.taskdefs.conditions.Or"/>
<componentdef name="or" onerror="ignore"
              classname="com.apache.tools.ant.types.resources.selectors.Or"/>