public void AddLibrary(Library library) { if (AdditionalLibraries.Any(lib => lib.Name == library.Name)) return; AdditionalLibraries.Add(library); }
private bool IsCandidateLibrary(Library library) { Debug.Assert(ReferenceAssemblies != null); return !ReferenceAssemblies.Contains(library.Name); }
private void Flatten(Library info, Dictionary<string, List<Library>> firstLevelLookups, HashSet<Library> parentDependents = null) { IEnumerable<Library> libraryDependents; if (!_inverse.TryGetValue(info.Name, out libraryDependents)) { List<Library> firstLevelDependents; if (firstLevelLookups.TryGetValue(info.Name, out firstLevelDependents)) { var allDependents = new HashSet<Library>(); foreach (var dependent in firstLevelDependents) { allDependents.Add(dependent); Flatten(dependent, firstLevelLookups, allDependents); } libraryDependents = allDependents; } else { libraryDependents = Enumerable.Empty<Library>(); } _inverse[info.Name] = libraryDependents; } AddRange(parentDependents, libraryDependents); }
private bool IsCandidateLibrary(Library library) { return !_codeGenerationFrameworkAssemblies.Contains(library.Name); }
private void Visit(Library item, Dictionary<string, List<Library>> inverse, HashSet<string> visited) { if (!visited.Add(item.Name)) { return; } foreach (var dependency in item.Dependencies) { List<Library> dependents; if (!inverse.TryGetValue(dependency, out dependents)) { dependents = new List<Library>(); inverse[dependency] = dependents; } dependents.Add(item); Visit(_graph[dependency].Item1, inverse, visited); } }