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