public TargetFrameworkNode( DependenciesNode dependenciesNode, PackageDependencyInfo dependency, bool sdkDependencies) { this.dependenciesNode = dependenciesNode; this.dependency = dependency; this.sdkDependencies = sdkDependencies; }
public void AddChild(PackageDependencyInfo childDependency) { dependencies = dependencies.Add(childDependency); if (childDependency.HasChildDiagnostic || childDependency.IsDiagnostic) { HasChildDiagnostic = true; } }
public static IEnumerable <PackageDependencyNode> GetDependencyNodes( DependenciesNode dependenciesNode, PackageDependencyInfo dependency, bool sdkDependencies = false, bool topLevel = false) { return(dependency.Dependencies .Select(item => Create(dependenciesNode, item, sdkDependencies, topLevel)) .Where(item => item != null)); }
public static PackageDependencyNode Create( DependenciesNode dependenciesNode, PackageDependencyInfo dependency, bool sdkDependencies, bool topLevel) { var node = new PackageDependencyNode(dependenciesNode, dependency, topLevel); if (node.IsSupported(sdkDependencies)) { return(node); } return(null); }
PackageDependencyNode( DependenciesNode dependenciesNode, PackageDependencyInfo dependency, bool topLevel) { this.dependenciesNode = dependenciesNode; this.dependency = dependency; IsTopLevel = topLevel; if (dependency.IsDiagnostic) { name = dependency.DiagnosticCode; } else { name = dependency.Name; version = dependency.Version; if (IsTopLevel) { IsReadOnly = !PackageReferenceExistsInProject(); } } }
static void BuildChildDependencies(Dictionary <string, PackageDependencyInfo> packageDependencies, PackageDependencyInfo dependency) { foreach (string childDependencyName in dependency.DependencyNames) { if (packageDependencies.TryGetValue(childDependencyName, out PackageDependencyInfo childDependency)) { if (!childDependency.IsBuilt) { BuildChildDependencies(packageDependencies, childDependency); } dependency.AddChild(childDependency); } } dependency.IsBuilt = true; }