예제 #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;
 }