5 instantiations of FileMatcher
Microsoft.Build (2)
Evaluation\Context\EvaluationContext.cs (1)
71
FileMatcher = new
FileMatcher
(FileSystem, FileEntryExpansionCache);
FileMatcher.cs (1)
84
public static FileMatcher Default = new
FileMatcher
(FileSystems.Default, null);
Microsoft.Build.Engine.UnitTests (3)
FileMatcher_Tests.cs (3)
133
var fileMatcherWithCache = new
FileMatcher
(FileSystems.Default, new ConcurrentDictionary<string, IReadOnlyList<string>>());
2397
var fileMatcher = new
FileMatcher
(new FileSystemAdapter(mockFileSystem), mockFileSystem.GetAccessibleFileSystemEntries);
2467
private static FileMatcher loopBackFileMatcher = new
FileMatcher
(FileSystems.Default, GetFileSystemEntriesLoopBack);
117 references to FileMatcher
Microsoft.Build (39)
BackEnd\BuildManager\BuildManager.cs (1)
2783
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)
1707
var hasCharactersThatRequireSplitting =
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(itemElement.Include);
3089
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(unevaluatedInclude) ||
3428
var hasCharactersThatRequireSplitting =
FileMatcher
.HasWildcardsSemicolonItemOrPropertyReferences(itemElement.Include);
3461
if (!
FileMatcher
.HasWildcards(existingIncludePiece))
3466
FileMatcher
.Result match =
FileMatcher
.Default.FileMatch(existingIncludePiece, unevaluatedInclude);
3849
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)
1584
bool containsWildcards =
FileMatcher
.HasWildcards(importElement.Project);
Evaluation\ItemSpec.cs (1)
227
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)
84
public static
FileMatcher
Default = new FileMatcher(FileSystems.Default, null);
567
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)
70
fileMatcher:
FileMatcher
.Default,
106
FileMatcher
? fileMatcher = null,
121
fileMatcher ??
FileMatcher
.Default,
133
if (!
FileMatcher
.HasWildcards(filespecEscaped))
178
FileMatcher
fileMatcher,
219
FileMatcher
.Default.GetFileSpecInfo(filespecUnescaped, out string directoryPart, out string wildcardPart, out string filenamePart, out bool needsRecursion, out bool isLegalFileSpec);
222
bool logDriveEnumeratingWildcard =
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart);
229
FileMatcher
.Default.GetFileSpecInfo(excludeSpec, out directoryPart, out wildcardPart, out filenamePart, out needsRecursion, out isLegalFileSpec);
230
bool logDriveEnumeratingWildcardFromExludeSpec =
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart);
561
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)
68
string[] fileMatches =
FileMatcher
.Default.GetFiles(testFolder.Path, pattern).FileList;
84
string[] fileMatches =
FileMatcher
.Default.GetFiles(testFolder.Path, "**").FileList;
111
void VerifyImpl(
FileMatcher
fileMatcher, string include, string[] excludes, bool shouldHaveNoMatches = false, string customMessage = null)
133
var
fileMatcherWithCache = new FileMatcher(FileSystems.Default, new ConcurrentDictionary<string, IReadOnlyList<string>>());
138
VerifyImpl(
FileMatcher
.Default, include, excludes, shouldHaveNoMatches, customMessage);
593
Assert.Equal(input.Item3,
FileMatcher
.IsMatch(input.Item1, input.Item2));
594
Assert.Equal(input.Item3,
FileMatcher
.IsMatch(input.Item1.ToUpperInvariant(), input.Item2));
595
Assert.Equal(input.Item3,
FileMatcher
.IsMatch(input.Item1, input.Item2.ToUpperInvariant()));
611
private static IReadOnlyList<string> GetFileSystemEntries(
FileMatcher
.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory)
777
FileMatcher
.Normalize(inputString).ShouldBe(expectedString);
829
string longPath =
FileMatcher
.GetLongPathName(
831
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
845
string longPath =
FileMatcher
.GetLongPathName(
847
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
861
string longPath =
FileMatcher
.GetLongPathName(
863
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
877
string longPath =
FileMatcher
.GetLongPathName(
879
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
893
string longPath =
FileMatcher
.GetLongPathName(
895
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
909
string longPath =
FileMatcher
.GetLongPathName(
911
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
925
string longPath =
FileMatcher
.GetLongPathName(
927
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
941
string longPath =
FileMatcher
.GetLongPathName(
943
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
958
string longPath =
FileMatcher
.GetLongPathName(
960
new
FileMatcher
.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries));
1231
files =
FileMatcher
.Default.GetFiles(workingPath, offendingPattern).FileList;
1243
var files =
FileMatcher
.Default.GetFiles(workingPath, offendingPattern).FileList;
1263
var files =
FileMatcher
.Default.GetFiles(workingPath, offendingPattern).FileList;
1288
var files =
FileMatcher
.Default.GetFiles(testProject.TestRoot, "**/*.cs").FileList;
1292
files =
FileMatcher
.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string> { "a.cs" }).FileList;
1296
files =
FileMatcher
.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string> { "a.cs", "c.cs" }).FileList;
1303
FileMatcher
.ClearFileEnumerationsCache();
1331
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart).ShouldBeTrue();
1355
(string[] fileList,
FileMatcher
.SearchAction action, string excludeFileSpec, _) =
FileMatcher
.Default.GetFiles(
1359
action.ShouldBe(
FileMatcher
.SearchAction.FailOnDriveEnumeratingWildcard);
1364
(fileList, action, excludeFileSpec, _) =
FileMatcher
.Default.GetFiles(
1369
action.ShouldBe(
FileMatcher
.SearchAction.FailOnDriveEnumeratingWildcard);
1396
(_,
FileMatcher
.SearchAction action, string excludeFileSpec, _) =
FileMatcher
.Default.GetFiles(
1400
action.ShouldBe(
FileMatcher
.SearchAction.LogDriveEnumeratingWildcard);
1404
(_, action, excludeFileSpec, _) =
FileMatcher
.Default.GetFiles(
1409
action.ShouldBe(
FileMatcher
.SearchAction.LogDriveEnumeratingWildcard);
1440
FileMatcher
.IsDriveEnumeratingWildcardPattern(directoryPart, wildcardPart).ShouldBeFalse();
1446
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray();
1450
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\" : "/").ToArray();
1454
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray();
1458
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray();
1462
strings =
FileMatcher
.RemoveProjectDirectory(strings, NativeMethodsShared.IsWindows ? "c:\\directory" : "/directory").ToArray();
1468
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine").ToArray();
1472
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine").ToArray();
1476
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine\\directory").ToArray();
1480
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine\\directory").ToArray();
1484
strings =
FileMatcher
.RemoveProjectDirectory(strings, "\\Machine\\directory").ToArray();
1948
FileMatcher
.Default.GetFileSpecInfo(
1956
?
FileMatcher
.RegularExpressionFromFileSpec(fixedDirectoryPart, wildcardDirectoryPart, filenamePart)
2066
if (normalizedCandidate.IndexOfAny(
FileMatcher
.directorySeparatorCharacters) != -1)
2081
files.Add(
FileMatcher
.Normalize(candidate));
2090
files.Add(
FileMatcher
.Normalize(candidate));
2104
files.Add(
FileMatcher
.Normalize(candidate));
2108
else if (!
FileMatcher
.HasWildcards(pattern))
2144
int nextSlash = normalizedCandidate.IndexOfAny(
FileMatcher
.directorySeparatorCharacters, path.Length + 1);
2159
directories.Add(
FileMatcher
.Normalize(match));
2170
directories.Add(
FileMatcher
.Normalize(match));
2191
internal IReadOnlyList<string> GetAccessibleFileSystemEntries(
FileMatcher
.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory)
2196
if (entityType ==
FileMatcher
.FileSystemEntity.Files || entityType ==
FileMatcher
.FileSystemEntity.FilesAndDirectories)
2203
if (entityType ==
FileMatcher
.FileSystemEntity.Directories || entityType ==
FileMatcher
.FileSystemEntity.FilesAndDirectories)
2397
var
fileMatcher = new FileMatcher(new FileSystemAdapter(mockFileSystem), mockFileSystem.GetAccessibleFileSystemEntries);
2458
private static IReadOnlyList<string> GetFileSystemEntriesLoopBack(
FileMatcher
.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory)
2467
private static
FileMatcher
loopBackFileMatcher = new FileMatcher(FileSystems.Default, GetFileSystemEntriesLoopBack);
2599
FileMatcher
.Result match =
FileMatcher
.Default.FileMatch(filespec, fileToMatch);