dotnet/msbuild
Auf GitHub ansehenIMSBuildGlob should have a method that expands globs
Open
#1.908 geöffnet am 24. März 2017
Feature - Globbinghelp wantedtriaged
Repository-Metriken
- Stars
- (5.062 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 11T 7h) (125 gemergte PRs in 30 T)
Beschreibung
IMSBuildGlob currently knows how to match strings against itself.
It would be nice if it also had an ExpandToFiles method which hit the disk and expanded the glob into matching files, with the same behaviour that the engine is internally using. We didn't expose this functionality because there's no outside asks for it yet.
Implementation details:
- Since expansion is slow, the results should be cached, and maybe the method should also have an async counterpart
- A very easy implementation is to just call
EngineFileUtilities.GetFileList. However, that method needlessly parses the glob again. A better implementation is to rework the internal static methods to also accept an already parsed glob. This poses some complications due to the different validation checks done byEngineFileUtilities.GetFileListandFileMatcher.GetFiles - Behaviour on illegal filespecs (as per the engine today):
EngineFileUtilities.GetFileListreturns back the original illegal filespecFileMatcher.GetFilesreturn back the original illegal filespec if it's not excluded, otherwise returns empty