<patternset>

A set of patterns, mostly used to include or exclude certain files.

The individual patterns support if and unless attributes to specify that the element should only be used if or unless a given condition is met.

The includesfile and excludesfile elements load patterns from a file. When the file is a relative path, it will be resolved relative to the project base directory in which the patternset is defined. Each line of this file is taken to be a pattern.

The number sign (#) as the first non-blank character in a line denotes that all text following it is a comment:

     EventLog.cs
     # requires Mono.Posix
     SysLogEventLogImpl.cs
     # uses the win32 eventlog API
     Win32EventLogImpl.cs
  

Patterns can be grouped to sets, and later be referenced by their id.

When used as a standalone element (global type), any properties that are referenced will be resolved when the definition is processed, not when it actually used. Passing a reference to a nested build file will not cause the properties to be re-evaluated.

To improve reuse of globally defined patternsets, avoid referencing any properties altogether.

Parameters

Attribute Type Description Required
id string The ID used to be referenced later. False
refid string The ID to use as the reference. False

Nested Elements:

<include>

Defines a single pattern for files to include.

Parameters

AttributeTypeDescriptionRequired
namestring The name pattern to include/exclude. True
ifbool If true then the pattern will be used; otherwise, skipped. The default is true. False
unlessbool If false then the pattern will be used; otherwise, skipped. The default is false. False

</include>

<includesfile>

Loads multiple patterns of files to include from a given file, set using the name parameter.

Parameters

AttributeTypeDescriptionRequired
namestring The name pattern to include/exclude. True
ifbool If true then the pattern will be used; otherwise, skipped. The default is true. False
unlessbool If false then the pattern will be used; otherwise, skipped. The default is false. False

</includesfile>

<exclude>

Defines a single pattern for files to exclude.

Parameters

AttributeTypeDescriptionRequired
namestring The name pattern to include/exclude. True
ifbool If true then the pattern will be used; otherwise, skipped. The default is true. False
unlessbool If false then the pattern will be used; otherwise, skipped. The default is false. False

</exclude>

<excludesfile>

Loads multiple patterns of files to exclude from a given file, set using the name parameter.

Parameters

AttributeTypeDescriptionRequired
namestring The name pattern to include/exclude. True
ifbool If true then the pattern will be used; otherwise, skipped. The default is true. False
unlessbool If false then the pattern will be used; otherwise, skipped. The default is false. False

</excludesfile>

<patternset>

Adds a nested set of patterns, or references other standalone patternset.

</patternset>

Examples

Requirements

Assembly: NAnt.Core (0.90.3780.0)

See Also

<fileset>