5 instantiations of FileMatcher
Microsoft.Build (2)
Evaluation\Context\EvaluationContext.cs (1)
71
FileMatcher = new
FileMatcher
(FileSystem, FileEntryExpansionCache);
FileMatcher.cs (1)
85
public static FileMatcher Default = new
FileMatcher
(FileSystems.Default, null);
Microsoft.Build.Engine.UnitTests (3)
FileMatcher_Tests.cs (3)
134
var fileMatcherWithCache = new
FileMatcher
(FileSystems.Default, new ConcurrentDictionary<string, IReadOnlyList<string>>());
2398
var fileMatcher = new
FileMatcher
(new FileSystemAdapter(mockFileSystem), mockFileSystem.GetAccessibleFileSystemEntries);
2468
private static FileMatcher loopBackFileMatcher = new
FileMatcher
(FileSystems.Default, GetFileSystemEntriesLoopBack);
117 references to FileMatcher
Microsoft.Build (39)
BackEnd\BuildManager\BuildManager.cs (1)
2747
FileMatcher
.ClearFileEnumerationsCache();
Construction\ProjectItemElement.cs (1)
344
_includeHasWildcards = (Include != null) &&
FileMatcher
.HasWildcards(_include);
Definition\BuiltInMetadata.cs (2)
110
FileMatcher
.Result match =
FileMatcher
.Default.FileMatch(evaluatedIncludeBeforeWildcardExpansion, evaluatedInclude);
Definition\Project.cs (7)
1701
var hasCharactersThatRequireSplitting =
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(itemElement.Include);
3083
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(unevaluatedInclude) ||
3422
var hasCharactersThatRequireSplitting =
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(itemElement.Include);
3455
if (!
FileMatcher
.HasWildcards(existingIncludePiece))
3460
FileMatcher
.Result match =
FileMatcher
.Default.FileMatch(existingIncludePiece, unevaluatedInclude);
3842
if (
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(unevaluatedInclude))
Definition\ProjectItem.cs (1)
705
if (_xml.Count == 0 /* no metadata */ && _project.IsSuitableExistingItemXml(_xml, name, null /* no metadata */) && !
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(name))
Evaluation\Context\EvaluationContext.cs (1)
56
internal
FileMatcher
FileMatcher { get; }
Evaluation\Evaluator.cs (1)
1570
bool containsWildcards =
FileMatcher
.HasWildcards(importElement.Project);
Evaluation\ItemSpec.cs (1)
228
if (!
FileMatcher
.HasWildcards(splitEscaped))
Evaluation\LazyItemEvaluator.cs (1)
50
protected
FileMatcher
FileMatcher => EvaluationContext.FileMatcher;
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
53
protected
FileMatcher
FileMatcher => _lazyEvaluator.FileMatcher;
FileMatcher.cs (2)
85
public static
FileMatcher
Default = new FileMatcher(FileSystems.Default, null);
570
fixedDirectoryPart =
FileMatcher
.GetLongPathName(fixedDirectoryPart, _getFileSystemEntries);
FileSystem\DirectoryCacheFileSystemWrapper.cs (2)
88
return
FileMatcher
.IsAllFilesWildcard(searchPattern) ||
FileMatcher
.IsMatch(fileName, searchPattern);
Globbing\MSBuildGlob.cs (4)
127
FileMatcher
.GetRegexMatchInfo(
184
FileMatcher
.Default.GetFileSpecInfo(
201
string matchFileExpression =
FileMatcher
.RegularExpressionFromFileSpec(fixedDirectoryPart, wildcardDirectoryPart, filenamePart);
210
RegexOptions regexOptions =
FileMatcher
.DefaultRegexOptions;
Utilities\EngineFileUtilities.cs (10)
71
fileMatcher:
FileMatcher
.Default,
107
FileMatcher
fileMatcher = null,
122
fileMatcher ??
FileMatcher
.Default,
134
if (!
FileMatcher
.HasWildcards(filespecEscaped))
179
FileMatcher
fileMatcher,
220
FileMatcher
.Default.GetFileSpecInfo(filespecUnescaped, out string directoryPart, out string wildcardPart, out string filenamePart, out bool needsRecursion, out bool isLegalFileSpec);
223
bool logDriveEnumeratingWildcard =
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart);
230
FileMatcher
.Default.GetFileSpecInfo(excludeSpec, out directoryPart, out wildcardPart, out filenamePart, out needsRecursion, out isLegalFileSpec);
231
bool logDriveEnumeratingWildcardFromExludeSpec =
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart);
533
var hasBothWildcardsAndEscapedWildcards =
FileMatcher
.HasWildcards(exclude) && EscapingUtilities.ContainsEscapedWildcards(exclude);
Utilities\FileSpecMatchTester.cs (4)
90
if (!
FileMatcher
.IsMatch(filename, _filenamePattern))
107
FileMatcher
.Default.SplitFileSpec(
121
if (string.IsNullOrEmpty(fixedDirPart) &&
FileMatcher
.IsRecursiveDirectoryMatch(wildcardDirectoryPart))
138
FileMatcher
.Default.GetFileSpecInfoWithRegexObject(
Microsoft.Build.Engine.UnitTests (78)
Evaluation\ItemEvaluation_Tests.cs (1)
696
FileMatcher
.ClearFileEnumerationsCache();
FileMatcher_Tests.cs (77)
69
string[] fileMatches =
FileMatcher
.Default.GetFiles(testFolder.Path, pattern).FileList;
85
string[] fileMatches =
FileMatcher
.Default.GetFiles(testFolder.Path, "**").FileList;
112
void VerifyImpl(
FileMatcher
fileMatcher, string include, string[] excludes, bool shouldHaveNoMatches = false, string customMessage = null)
134
var
fileMatcherWithCache = new FileMatcher(FileSystems.Default, new ConcurrentDictionary<string, IReadOnlyList<string>>());
139
VerifyImpl(
FileMatcher
.Default, include, excludes, shouldHaveNoMatches, customMessage);
594
Assert.Equal(input.Item3,
FileMatcher
.IsMatch(input.Item1, input.Item2));
595
Assert.Equal(input.Item3,
FileMatcher
.IsMatch(input.Item1.ToUpperInvariant(), input.Item2));
596
Assert.Equal(input.Item3,
FileMatcher
.IsMatch(input.Item1, input.Item2.ToUpperInvariant()));
612
private static IReadOnlyList<string> GetFileSystemEntries(
FileMatcher
.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory)
778
FileMatcher
.Normalize(inputString).ShouldBe(expectedString);
830
string longPath =
FileMatcher
.GetLongPathName(
832
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
846
string longPath =
FileMatcher
.GetLongPathName(
848
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
862
string longPath =
FileMatcher
.GetLongPathName(
864
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
878
string longPath =
FileMatcher
.GetLongPathName(
880
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
894
string longPath =
FileMatcher
.GetLongPathName(
896
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
910
string longPath =
FileMatcher
.GetLongPathName(
912
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
926
string longPath =
FileMatcher
.GetLongPathName(
928
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
942
string longPath =
FileMatcher
.GetLongPathName(
944
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
959
string longPath =
FileMatcher
.GetLongPathName(
961
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
1232
files =
FileMatcher
.Default.GetFiles(workingPath, offendingPattern).FileList;
1244
var files =
FileMatcher
.Default.GetFiles(workingPath, offendingPattern).FileList;
1264
var files =
FileMatcher
.Default.GetFiles(workingPath, offendingPattern).FileList;
1289
var files =
FileMatcher
.Default.GetFiles(testProject.TestRoot, "**/*.cs").FileList;
1293
files =
FileMatcher
.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string> { "a.cs" }).FileList;
1297
files =
FileMatcher
.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string> { "a.cs", "c.cs" }).FileList;
1304
FileMatcher
.ClearFileEnumerationsCache();
1332
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart).ShouldBeTrue();
1356
(string[] fileList,
FileMatcher
.SearchAction action, string excludeFileSpec) =
FileMatcher
.Default.GetFiles(
1360
action.ShouldBe(
FileMatcher
.SearchAction.FailOnDriveEnumeratingWildcard);
1365
(fileList, action, excludeFileSpec) =
FileMatcher
.Default.GetFiles(
1370
action.ShouldBe(
FileMatcher
.SearchAction.FailOnDriveEnumeratingWildcard);
1397
(_,
FileMatcher
.SearchAction action, string excludeFileSpec) =
FileMatcher
.Default.GetFiles(
1401
action.ShouldBe(
FileMatcher
.SearchAction.LogDriveEnumeratingWildcard);
1405
(_, action, excludeFileSpec) =
FileMatcher
.Default.GetFiles(
1410
action.ShouldBe(
FileMatcher
.SearchAction.LogDriveEnumeratingWildcard);
1441
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart).ShouldBeFalse();
1447
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray();
1451
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray();
1455
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray();
1459
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray();
1463
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray();
1469
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine").ToArray();
1473
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine").ToArray();
1477
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine\\directory").ToArray();
1481
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine\\directory").ToArray();
1485
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine\\directory").ToArray();
1949
FileMatcher
.Default.GetFileSpecInfo(
1957
?
FileMatcher
.RegularExpressionFromFileSpec(fixedDirectoryPart, wildcardDirectoryPart, filenamePart)
2067
if (normalizedCandidate.IndexOfAny(
FileMatcher
.directorySeparatorCharacters) != -1)
2082
files.Add(
FileMatcher
.Normalize(candidate));
2091
files.Add(
FileMatcher
.Normalize(candidate));
2105
files.Add(
FileMatcher
.Normalize(candidate));
2109
else if (!
FileMatcher
.HasWildcards(pattern))
2145
int nextSlash = normalizedCandidate.IndexOfAny(
FileMatcher
.directorySeparatorCharacters, path.Length + 1);
2160
directories.Add(
FileMatcher
.Normalize(match));
2171
directories.Add(
FileMatcher
.Normalize(match));
2192
internal IReadOnlyList<string> GetAccessibleFileSystemEntries(
FileMatcher
.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory)
2197
if (entityType ==
FileMatcher
.FileSystemEntity.Files || entityType ==
FileMatcher
.FileSystemEntity.FilesAndDirectories)
2204
if (entityType ==
FileMatcher
.FileSystemEntity.Directories || entityType ==
FileMatcher
.FileSystemEntity.FilesAndDirectories)
2398
var
fileMatcher = new FileMatcher(new FileSystemAdapter(mockFileSystem), mockFileSystem.GetAccessibleFileSystemEntries);
2459
private static IReadOnlyList<string> GetFileSystemEntriesLoopBack(
FileMatcher
.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory)
2468
private static
FileMatcher
loopBackFileMatcher = new FileMatcher(FileSystems.Default, GetFileSystemEntriesLoopBack);
2600
FileMatcher
.Result match =
FileMatcher
.Default.FileMatch(filespec, fileToMatch);