Feature-based Filter
A feature-based filter is a filter with a value resolved relative to a requested feature identifier against the current or selected project.
Attributes
token | The filter token (required). |
ref | Optional reference to a project or resource that the feature request refers (if undeclared the feature will be resolved relative to the current project). |
id | The feature keyword (see feature list below). |
type | Required when referencing a feature of type produced by a resource type (see feature list). The value refers to a resource type id declared by a resource or project. |
Special URI Feature related Attributes
alias | If true the artifact uri returned for the uri feature will be a link (assuming that the resource declares production of an link alias). |
Features
Available features are listed in the following table.
name | The resource name. |
group | The resource group. |
version | The resource version. |
uri | The full artifact uri (requires type attribute). |
spec | Short form of uri. The spec value is equivalent to the uri with the "artifact:" protocol identifier (requires type attribute). |
filename | The filename of the final artifact that the resource represents (requires type attribute). |
Example
The following project definition declares four feature-based filters to be applied during project build.
<project name="dpml-metro-component" basedir="component"> <types> <type id="jar"/> </types> <dependencies> <runtime> <include key="dpml-state-api" tag="public"/> <include ref="dpml/metro/dpml-job-api" tag="public"/> <include ref="dpml/transit/dpml-transit-main" tag="private"/> </runtime> <test> <include ref="ant/ant-junit"/> </test> </dependencies> <filters> <feature token="NAME" id="name"/> <feature token="VERSION" id="version"/> <feature token="GROUP" id="group"/> <feature token="PART-HANDLER-URI" id="uri" type="part" ref="dpml/metro/dpml-metro-runtime"/> </filters> </project>