private bool IsExcluded(string fullPath) { var result = false; if (FilterProjectFile && fullPath == Location) { result = true; } else { var path = CurrentDirectory.MakeRelativePath(fullPath).ToAvalonPath(); var filter = ExcludedFiles.FirstOrDefault(f => path.Contains(f)); result = !string.IsNullOrEmpty(filter); } return(result); }
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); }
public void AddFileExclusionFilters(string[] exclusionFilters) { ExcludedFiles.AddFilters(exclusionFilters, RegExFilters); }