public bool IsMatch(string filename) { if (Exclude != null && Exclude.IsMatch(filename)) { return(false); } var patternRegexes = GetFilePatterns().Select(CreateRegexFromPattern); return(patternRegexes.Any(regex => regex.IsMatch(filename))); }
IEnumerable <string> GetAssetFilenamesByConfiguration(IDirectory directory) { IEnumerable <string> filenames = null; //if (string.IsNullOrWhiteSpace(FilePattern)) //{ // filenames = directory.GetFiles("*", SearchOption); //} //else //{ // var patterns = FilePattern.Split(new[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries); // filenames = patterns.SelectMany(pattern => directory.GetFiles(pattern, SearchOption)).Distinct(); //} if (Exclude != null) { filenames = filenames.Where(f => Exclude.IsMatch(f) == false); } // TODO: Remove the legacy "module.txt" support. return(filenames.Except(new[] { "bundle.txt", "module.txt" }).ToArray()); }
IEnumerable <string> GetFilenames(IDirectory directory) { IEnumerable <string> filenames; if (string.IsNullOrEmpty(FilePattern)) { filenames = null; // directory.GetFiles("*", SearchOption); } else { var patterns = FilePattern.Split(';', ','); filenames = null; //filenames = patterns.SelectMany( // pattern => directory.GetFiles(pattern, SearchOption) //); } if (Exclude != null) { filenames = filenames.Where(f => Exclude.IsMatch(f) == false); } return(filenames); }
public bool IsMatch(string resourceUrl) { return((Include.Count == 0 || Include.IsMatch(resourceUrl)) && !Exclude.IsMatch(resourceUrl)); }
bool IsAssetFile(IFile file) { return(!IsDescriptorFilename(file) && (Exclude == null || !Exclude.IsMatch(file.FullPath))); }