NAnt.Core.Types.FileSet
class for managing assembly files.
If an include pattern does not contain any wildcard characters then the assembly will be searched for in following locations (in the order listed):
- The base directory of the fileset.
- The directories specified using the nested <lib> element.
- The list of reference assemblies of the current target framework.
The reference assemblies of a given target framework are defined using <reference-assemblies> filesets in the <framework> node of the NAnt configuration file.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
basedir | directory |
The base of the directory of this fileset. The default is the project
base directory.
|
False |
casesensitive | bool |
Indicates whether include and exclude patterns must be treated in a
case-sensitive way. The default is
true on Unix;
otherwise, false .
|
False |
defaultexcludes | bool |
Indicates whether default excludes should be used or not.
The default is
true .
|
False |
failonempty | bool |
When set to
true , causes the fileset element to
throw a NAnt.Core.ValidationException when no files match the
includes and excludes criteria. The default is false .
|
False |
id | string |
The ID used to be referenced later.
|
False |
refid | string |
The ID to use as the reference.
|
False |
Nested elements
<exclude>
The items to exclude from the fileset.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
name | string |
The pattern or file name to exclude.
|
True |
if | bool |
If
true then the pattern will be excluded;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.Exclude.IfDefined . If false
then the pattern will be excluded; otherwise, skipped. The default
is false .
|
False |
<exclude>
<excludesfile>
The files from which a list of patterns or files to exclude should be obtained.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
name | file |
The name of a file; each line of this file is taken to be a
pattern.
|
True |
if | bool |
If
true then the patterns will be excluded;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.ExcludesFile.IfDefined . If false
then the patterns will be excluded; otherwise, skipped. The default
is false .
|
False |
<excludesfile>
<include>
The items to include in the fileset.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
name | string |
The pattern or file name to include.
|
True |
asis | bool |
If
true then the file name will be added to
the NAnt.Core.Types.FileSet without pattern matching or checking
if the file exists. The default is false .
|
False |
frompath | bool |
If
true then the file will be searched for
on the path. The default is false .
|
False |
if | bool |
If
true then the pattern will be included;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.Include.IfDefined . If false
then the pattern will be included; otherwise, skipped. The default
is false .
|
False |
if | bool |
If
true then the pattern will be excluded;
otherwise, skipped. The default is true .
|
False |
name | string |
The pattern or file name to exclude.
|
True |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.Exclude.IfDefined . If false
then the pattern will be excluded; otherwise, skipped. The default
is false .
|
False |
<include>
<includesfile>
The files from which a list of patterns or files to include should be obtained.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
asis | bool |
If
true then the patterns in the include file
will be added to the NAnt.Core.Types.FileSet without pattern
matching or checking if the file exists. The default is
false .
|
False |
frompath | bool |
If
true then the patterns in the include file
will be searched for on the path. The default is false .
|
False |
if | bool |
If
true then the patterns will be included;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.IncludesFile.IfDefined . If false
then the patterns will be included; otherwise, skipped. The default
is false .
|
False |
if | bool |
If
true then the patterns will be excluded;
otherwise, skipped. The default is true .
|
False |
name | file |
The name of a file; each line of this file is taken to be a
pattern.
|
True |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.ExcludesFile.IfDefined . If false
then the patterns will be excluded; otherwise, skipped. The default
is false .
|
False |
<includesfile>
<excludes>
The items to exclude from the fileset.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
name | string |
The pattern or file name to exclude.
|
True |
if | bool |
If
true then the pattern will be excluded;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.Exclude.IfDefined . If false
then the pattern will be excluded; otherwise, skipped. The default
is false .
|
False |
<excludes>
<includes>
The items to include in the fileset.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
name | string |
The pattern or file name to include.
|
True |
asis | bool |
If
true then the file name will be added to
the NAnt.Core.Types.FileSet without pattern matching or checking
if the file exists. The default is false .
|
False |
frompath | bool |
If
true then the file will be searched for
on the path. The default is false .
|
False |
if | bool |
If
true then the pattern will be included;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.Include.IfDefined . If false
then the pattern will be included; otherwise, skipped. The default
is false .
|
False |
if | bool |
If
true then the pattern will be excluded;
otherwise, skipped. The default is true .
|
False |
name | string |
The pattern or file name to exclude.
|
True |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.Exclude.IfDefined . If false
then the pattern will be excluded; otherwise, skipped. The default
is false .
|
False |
<includes>
<includesList>
The files from which a list of patterns or files to include should be obtained.
Automatically validates attributes in the element based on attributes applied to members in derived classes.
Parameters
Attribute | Type | Description | Required |
---|---|---|---|
asis | bool |
If
true then the patterns in the include file
will be added to the NAnt.Core.Types.FileSet without pattern
matching or checking if the file exists. The default is
false .
|
False |
frompath | bool |
If
true then the patterns in the include file
will be searched for on the path. The default is false .
|
False |
if | bool |
If
true then the patterns will be included;
otherwise, skipped. The default is true .
|
False |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.IncludesFile.IfDefined . If false
then the patterns will be included; otherwise, skipped. The default
is false .
|
False |
if | bool |
If
true then the patterns will be excluded;
otherwise, skipped. The default is true .
|
False |
name | file |
The name of a file; each line of this file is taken to be a
pattern.
|
True |
unless | bool |
Opposite of
NAnt.Core.Types.FileSet.ExcludesFile.IfDefined . If false
then the patterns will be excluded; otherwise, skipped. The default
is false .
|
False |
<includesList>
Examples
Define a reference with name "sys.assemblies", holding a set of system assemblies.
<assemblyfileset id="sys.assemblies">
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Xml.dll" />
</assemblyfileset>
Use the predefined set of assemblies to compile a C# assembly.
<csc target="exe" output="HelloWorld.exe">
<sources>
<include name="**/*.cs" />
</sources>
<references refid="sys.assemblies" />
</csc>
Compile a C# assembly using assembly references that are searched for in the "Third Party Assemblies" and "Company Assemblies" directories.
<csc target="exe" output="HelloWorld.exe">
<sources>
<include name="**/*.cs" />
</sources>
<references>
<lib>
<include name="Third Party Assemblies" />
<include name="Company Assemblies" />
</lib>
<include name="log4net.dll" />
<include name="Company.Business.dll" />
</references>
</csc>
See Also
- NAnt.Core.Types.FileSet
Requirements
- Assembly
- NAnt
.DotNet .dll - Namespace
-
NAnt
.DotNet .Types