public override void BuildGraph( IGraphContext graphContext, string projectPath, IDependency dependency, GraphNode dependencyGraphNode, ITargetedDependenciesSnapshot targetedSnapshot) { // store refreshed dependency dependencyGraphNode.SetValue(DependenciesGraphSchema.DependencyIdProperty, dependency.Id); dependencyGraphNode.SetValue(DependenciesGraphSchema.ResolvedProperty, dependency.Resolved); ITargetedDependenciesSnapshot?otherProjectTargetedSnapshot = _aggregateSnapshotProvider.GetSnapshot(dependency); if (otherProjectTargetedSnapshot == null) { return; } foreach (IDependency childDependency in otherProjectTargetedSnapshot.TopLevelDependencies) { if (!childDependency.Visible) { continue; } Builder.AddGraphNode( graphContext, dependency.FullPath, dependencyGraphNode, childDependency.ToViewModel(otherProjectTargetedSnapshot)); } }
public override void BeforeAddOrUpdate( ITargetFramework targetFramework, IDependency dependency, IReadOnlyDictionary <string, IProjectDependenciesSubTreeProvider> subTreeProviderByProviderType, IImmutableSet <string>?projectItemSpecs, IAddDependencyContext context) { if (dependency.TopLevel && dependency.Resolved && dependency.Flags.Contains(DependencyTreeFlags.ProjectDependency) && !dependency.Flags.Contains(DependencyTreeFlags.SharedProjectFlags)) { ITargetedDependenciesSnapshot?snapshot = _aggregateSnapshotProvider.GetSnapshot(dependency); if (snapshot != null && snapshot.HasVisibleUnresolvedDependency) { context.Accept(dependency.ToUnresolved(ProjectReference.SchemaName)); return; } } context.Accept(dependency); }
public override bool ApplyChanges( IGraphContext graphContext, string nodeProjectPath, IDependency updatedDependency, GraphNode dependencyGraphNode, ITargetedDependenciesSnapshot targetedSnapshot) { ITargetedDependenciesSnapshot?referencedProjectSnapshot = _aggregateSnapshotProvider.GetSnapshot(updatedDependency); if (referencedProjectSnapshot == null) { return(false); } return(ApplyChangesInternal( graphContext, updatedDependency, dependencyGraphNode, // Project references list all top level dependencies as direct children updatedChildren: referencedProjectSnapshot.TopLevelDependencies, // Pass the path of the referenced project nodeProjectPath: updatedDependency.FullPath, targetedSnapshot: referencedProjectSnapshot)); }
public override bool HasChildren(IDependency dependency) { ITargetedDependenciesSnapshot?targetedSnapshot = _aggregateSnapshotProvider.GetSnapshot(dependency); return(targetedSnapshot?.TopLevelDependencies.Length != 0); }