NAnt
![]() ![]() ![]() |
v0.85 |
[This is preliminary documentation and subject to change.]
Represent a chain of NAnt filters that can be applied to a Task.
A FilterChain represents a collection of one or more filters that can be appled to a Task such as the <copy> task . In the case of the <copy> task , the contents of the copied files are filtered through each filter specified in the filter chain. Filtering occurs in the order the filters are specified with filtered output of one filter feeding into another.
:--------:--->:----------:--->:----------: ... :----------:--->:--------:
:.Source.:--->:.Filter 1.:--->:.Filter 2.: ... :.Filter n.:--->:.target.:
:--------:--->:----------:--->:----------: ... :----------:--->:--------:
A list of all filters that come with NAnt is available here.
The following tasks support filtering with a FilterChain:
Attribute | Type | Description | Required |
---|---|---|---|
encoding | string | The encoding to assume when filter-copying files. The default is UTF-8. | False |
id | string | The ID used to be referenced later. | False |
refid | string | The ID to use as the reference. | False |
Base class for filters.
Base class for filters. All NAnt filters must be derived from this class. Filter provides support for parameters and provides a reference to the project. Filter's base class ChainableReader allows filters to be chained together.Attribute | Type | Description | Required |
---|---|---|---|
if | bool | If true then the filter will be used; otherwise, skipped. The default is true. | False |
unless | bool | Opposite of if . If false then the filter will be executed; otherwise, skipped. The default is false. | False |
Replace all occurrences of @NOW@ with the current date/time and replace tabs with spaces in all copied files.
<property name="NOW" value="${datetime::now()}" /> <copy todir="out"> <fileset basedir="in"> <include name="**/*" /> </fileset> <filterchain> <replacetokens> <token key="NOW" value="${TODAY}" /> </replacetokens> <tabstospaces /> </filterchain> </copy>