private static IEnumerable <string> GetTransitiveProjectReferences(ConcurrentDictionary <string, AbstractProject> projectCache, AbstractProject project) { foreach (var pr in project.ProjectReferences) { var path = StringExtension.ToNormalizedFullPath(pr.FilePath); if (projectCache.ContainsKey(path)) { yield return(path); } else { foreach (var rpr in GetTransitiveProjectReferences(projectCache, pr)) { yield return(rpr); } } } }
private static void FillProjectDependencyGraph(ConcurrentDictionary <string, AbstractProject> projectCache, ConcurrentDictionary <string, List <string> > projectDependencyGraph, AbstractProject project) { projectDependencyGraph.GetOrAdd(project.FilePath.ToNormalizedFullPath(), _ => GetTransitiveProjectReferences(projectCache, project).Distinct().ToList()); }