public bool ExcludeByFile(string fileName) { if (ExcludedFiles.Count == 0 || string.IsNullOrWhiteSpace(fileName)) { return(false); } return(ExcludedFiles.Any(excludeFile => excludeFile.Value.Match(fileName).Success)); }
public bool ExcludeByFile(string fileName) { if (ExcludedFiles.Count == 0 || string.IsNullOrWhiteSpace(fileName)) { return(false); } return(ExcludedFiles.Any(excludeFile => excludeFile.IsMatchingExpression(fileName))); }
protected bool ParseProjectFile() { TargetFrameworks = new List <TargetFramework>(); XDocument projDoc = CreateProjectDocument(ProjectFilePath); if (projDoc == null) { return(false); } ProjectElement = projDoc.Root?.DescendantsAndSelf() .FirstOrDefault(e => e.Name == "AssemblyName") ?.Parent; if (ProjectElement == null) { Logger.Error <string>("'{0}' has no primary ProjectGroup ", ProjectFilePath); return(false); } Document = projDoc; if (!InitializeTargetFrameworks()) { Logger.Error($"Failed to initialize target framework(s) from project file"); return(false); } SourceFiles = Directory.GetFiles(ProjectDirectory, $"*.cs").ToList() .Where(f => !ExcludedFiles.Any(x => f.Equals(x, StringComparison.OrdinalIgnoreCase))) .ToList(); return(true); }