AssemblyFileSet Class

Summary

Specialized NAnt.Core.Types.FileSet class for managing assembly files.
Assembly
NAnt.DotNet.dll
Namespace
NAnt.DotNet.Types
Interfaces
  • ICloneable
Base Types
graph BT Type-->Base0["FileSet"] click Base0 "/api/NAnt.Core.Types/FileSet" Base0-->Base1["DataTypeBase"] click Base1 "/api/NAnt.Core/DataTypeBase" Base1-->Base2["Element"] click Base2 "/api/NAnt.Core/Element" Base2-->Base3["Object"] Type-.->Interface0["ICloneable"] Type["AssemblyFileSet"] class Type type-node

Syntax

[Serializable()]
[ElementName("assemblyfileset")]
public class AssemblyFileSet : FileSet, ICloneable

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>

Remarks

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.

Attributes

Type Description
SerializableAttribute
ElementNameAttribute Indicates that class should be treated as a NAnt element.

Constructors

Name Summary
AssemblyFileSet() Initializes a new instance of the NAnt.DotNet.Types.AssemblyFileSet class.
AssemblyFileSet(FileSet) copy constructor for FileSet. Required in order to assign references of FileSet type where AssemblyFileSets are used

Properties

Name Value Summary
AsIs StringCollection
Gets the collection of files that will be added to the NAnt.Core.Types.FileSet without pattern matching or checking if the file exists.
Inherited from FileSet
BaseDirectory DirectoryInfo
The base of the directory of this fileset. The default is the project base directory.
Inherited from FileSet
CanBeReferenced bool
Gets a value indicating whether a reference to the type can be defined.
Inherited from DataTypeBase
CaseSensitive bool
Indicates whether include and exclude patterns must be treated in a case-sensitive way. The default is true on Unix; otherwise, false.
Inherited from FileSet
CustomXmlProcessing bool
Gets a value indicating whether the element is performing additional processing using the NAnt.Core.Element.XmlNode that was used to initialize the element.
Inherited from Element
DefaultExcludes bool
Indicates whether default excludes should be used or not. The default is true.
Inherited from FileSet
DirectoryNames StringCollection
Gets the collection of directory names that match the fileset.
Inherited from FileSet
ExcludedDirectoryNames StringCollection
Gets the collection of excluded directory names that match the fileset.
Inherited from FileSet
ExcludedFileNames StringCollection
Gets the collection of excluded file names that match the fileset.
Inherited from FileSet
ExcludeElements FileSet.Exclude[]
The items to exclude from the fileset.
Inherited from FileSet
Excludes StringCollection
Gets the collection of exclude patterns.
Inherited from FileSet
ExcludesFiles FileSet.ExcludesFile[]
The files from which a list of patterns or files to exclude should be obtained.
Inherited from FileSet
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.
Inherited from FileSet
FileNames StringCollection
Gets the collection of file names that match the fileset.
Inherited from FileSet
HasEmptyDirectories bool
Gets a value indicating whether this instance contains empty directories.
Inherited from FileSet
ID string
The ID used to be referenced later.
Inherited from DataTypeBase
IncludeElements FileSet.Include[]
The items to include in the fileset.
Inherited from FileSet
Includes StringCollection
Gets the collection of include patterns.
Inherited from FileSet
IncludesFiles FileSet.IncludesFile[]
The files from which a list of patterns or files to include should be obtained.
Inherited from FileSet
IsEverythingIncluded bool
Gets a value indicating whether this instance retrieved all files/directories scanned and nothing was excluded.
Inherited from FileSet
Lib LibDirectorySet
Additional directories to search in for assembly references.
Location Location
Gets or sets the location in the build file where the element is defined.
Inherited from Element
MostRecentLastWriteTimeFile FileInfo
Determines the most recently modified file in the fileset (by LastWriteTime of the System.IO.FileInfo).
Inherited from FileSet
Name string
Gets the name of the data type.
Inherited from DataTypeBase
NamespaceManager XmlNamespaceManager
Gets or sets the System.Xml.XmlNamespaceManager.
Inherited from Element
Parent Object
Gets or sets the parent of the element.
Inherited from Element
PathFiles PathScanner
Inherited from FileSet
Project Project
Gets or sets the NAnt.Core.Element.Project to which this element belongs.
Inherited from Element
Properties PropertyDictionary
Gets the properties local to this NAnt.Core.Element and the NAnt.Core.Element.Project.
Inherited from Element
RefID string
The ID to use as the reference.
Inherited from DataTypeBase
ScannedDirectories StringCollection
Gets the collection of directory names that were scanned for files.
Inherited from FileSet
SetExcludes FileSet.Exclude[]
The items to exclude from the fileset.
Inherited from FileSet
SetIncludes FileSet.Include[]
The items to include in the fileset.
Inherited from FileSet
SetIncludesList FileSet.IncludesFile[]
The files from which a list of patterns or files to include should be obtained.
Inherited from FileSet
XmlNode XmlNode
Gets or sets the XML node of the element.
Inherited from Element

Methods

Name Value Summary
AddPatternSet(PatternSet) void
Adds a nested set of patterns, or references a standalone patternset.
Inherited from FileSet
Clone() Object
Creates a shallow copy of the NAnt.Core.Types.FileSet.
Inherited from FileSet
CopyTo(DataTypeBase) void
Copies all instance data of the NAnt.Core.DataTypeBase to a given NAnt.Core.DataTypeBase.
Inherited from DataTypeBase
CopyTo(Element) void
Copies all instance data of the NAnt.Core.Element to a given NAnt.Core.Element.
Inherited from Element
CopyTo(FileSet) void
Copies all instance data of the NAnt.Core.Types.FileSet to a given NAnt.Core.Types.FileSet.
Inherited from FileSet
FindMoreRecentLastWriteTime(string, DateTime) string
Determines if a file has a more recent last write time than the given time, or no longer exists.
Inherited from FileSet
static
FindMoreRecentLastWriteTime(StringCollection, DateTime) string
Determines if one of the given files has a more recent last write time than the given time. If one of the given files no longer exists, the target will be considered out-of-date.
Inherited from FileSet
static
GetAttributeConfigurationNode(FrameworkInfo, string) XmlNode
Locates the XML node for the specified attribute in the project configuration node.
Inherited from Element
GetAttributeConfigurationNode(XmlNode, FrameworkInfo, string) XmlNode
Inherited from Element
GetLocation() Location
Retrieves the location in the build file where the element is defined.
Inherited from Element
Initialize() void
Derived classes should override to this method to provide extra initialization and validation not covered by the base class.
Inherited from FileSet
Initialize(XmlNode) void
Performs default initialization.
Inherited from Element
InitializeBuildElement(Element, XmlNode, Element, Type) Element
Initializes the build element.
Inherited from Element
static
InitializeElement(XmlNode) void
Derived classes should override to this method to provide extra initialization and validation not covered by the base class.
Inherited from Element
InitializeXml(XmlNode, PropertyDictionary, FrameworkInfo) void
Initializes all build attributes and child elements.
Inherited from Element
Log(Level, string) void
Logs a message with the given priority.
Inherited from Element
Log(Level, string, Object[]) void
Logs a message with the given priority.
Inherited from Element
Reset() void
Should be overridden by derived classes. clones the referenced types data into the current instance.
Inherited from FileSet
ResolveReferences() void
Resolves references to system assemblies and assemblies that can be resolved using directories specified in NAnt.DotNet.Types.AssemblyFileSet.Lib.
Scan() void
Do a normal scan and then resolve assemblies.
ToString() string
Inherited from FileSet

See Also

  • NAnt.Core.Types.FileSet