FindUnder Class | MSBuild Extension Pack Help 4.0.12.0 |
Valid TaskActions are:
FindFiles (Required: Path Optional: ModifiedAfterDate, ModifiedBeforeDate, Recursive, SearchPattern Output: FoundItems)
FindDirectories (Required: Path Optional: ModifiedAfterDate, ModifiedBeforeDate, Recursive, SearchPattern Output: FoundItems)
FindFilesAndDirectories (Required: Path Optional: ModifiedAfterDate, ModifiedBeforeDate, Recursive, SearchPattern Output: FoundItems)
Remote Execution Support: NA
Inheritance Hierarchy
MSBuild.ExtensionPackBaseTask
MSBuild.ExtensionPack.FileSystemFindUnder
Namespace: MSBuild.ExtensionPack.FileSystem
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The FindUnder type exposes the following members.
Constructors
Name | Description | |
---|---|---|
FindUnder |
Properties
Name | Description | |
---|---|---|
FoundItems |
The list of items (files and or directories) which were found.
| |
ModifiedAfterDate |
Set this value to only return files or folders modified after the given value
| |
ModifiedBeforeDate |
Set this value to only return files or folders modified before the given value
| |
Path |
The path that the FindUnder will be executed against.
This is a Required value.
| |
Recursive |
Sets whether the File search is recursive. Default is true
| |
SearchPattern |
This in an optional input property. This will set the SearchPattern
to be used in the search. The default value for this is "*"; This value is passed to either the System.IO.DirectoryInfo.GetDirectories method and/or the System.IO.FileInfo.GetFiles method. See that documentation for usage guidlines. |
Examples
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Demo"> <PropertyGroup> <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath> <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath> </PropertyGroup> <Import Project="$(TPath)"/> <Target Name="Demo"> <!-- Only finds files --> <MSBuild.ExtensionPack.FileSystem.FindUnder TaskAction="FindFiles" Path="$(MSBuildProjectDirectory)"> <Output ItemName="AllFoundFiles" TaskParameter="FoundItems"/> </MSBuild.ExtensionPack.FileSystem.FindUnder> <Message Text="===== Found Files =====" Importance="high"/> <Message Text="AllFoundFiles:%0d%0a@(AllFoundFiles,'%0d%0a')"/> <!-- Only finds directories --> <MSBuild.ExtensionPack.FileSystem.FindUnder TaskAction="FindDirectories" Path="$(MSBuildProjectDirectory)\..\"> <Output ItemName="AllFoundDirectories" TaskParameter="FoundItems"/> </MSBuild.ExtensionPack.FileSystem.FindUnder> <Message Text="===== Found Directories =====" Importance="high"/> <Message Text="AllFoundDirectories:%0d%0a@(AllFoundDirectories,'%0d%0a')"/> <!-- Find both files and directories --> <MSBuild.ExtensionPack.FileSystem.FindUnder TaskAction="FindFilesAndDirectories" Path="$(MSBuildProjectDirectory)\..\"> <Output ItemName="AllFoundItems" TaskParameter="FoundItems"/> </MSBuild.ExtensionPack.FileSystem.FindUnder> <Message Text="===== Found Files and Directories =====" Importance="high"/> <Message Text="AllFoundItems:%0d%0a@(AllFoundItems,'%0d%0a')"/> <!-- Find both files with SearchPattern = "F*" --> <MSBuild.ExtensionPack.FileSystem.FindUnder TaskAction="FindFiles" Path="$(MSBuildProjectDirectory)\..\" SearchPattern="F*"> <Output ItemName="AllFilesStartingWithF" TaskParameter="FoundItems"/> </MSBuild.ExtensionPack.FileSystem.FindUnder> <Message Text="===== Found Files Starting with 'F' =====" Importance="high"/> <Message Text="AllFilesStartingWithF:%0d%0a@(AllFilesStartingWithF,'%0d%0a')"/> </Target> </Project>
See Also