示例#1
0
 public TargetFrameworkNode(
     DependenciesNode dependenciesNode,
     PackageDependencyInfo dependency,
     bool sdkDependencies)
 {
     this.dependenciesNode = dependenciesNode;
     this.dependency       = dependency;
     this.sdkDependencies  = sdkDependencies;
 }
示例#2
0
        public void AddChild(PackageDependencyInfo childDependency)
        {
            dependencies = dependencies.Add(childDependency);

            if (childDependency.HasChildDiagnostic || childDependency.IsDiagnostic)
            {
                HasChildDiagnostic = true;
            }
        }
示例#3
0
 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));
 }
示例#4
0
        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);
        }
示例#5
0
        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;
 }