示例#1
0
        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());
        }
示例#3
0
        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);
        }
示例#4
0
 public bool IsMatch(string resourceUrl)
 {
     return((Include.Count == 0 || Include.IsMatch(resourceUrl)) &&
            !Exclude.IsMatch(resourceUrl));
 }
示例#5
0
 bool IsAssetFile(IFile file)
 {
     return(!IsDescriptorFilename(file) &&
            (Exclude == null || !Exclude.IsMatch(file.FullPath)));
 }