Ejemplo n.º 1
0
        internal void Initialize(SolutionDependencyContext solutions)
        {
            Solutions = solutions;
            Impacts   = solutions.DependencyTable.Where(r => r.Target != null && r.Target.Solution == Solution)
                        .Select(r => r.Solution)
                        .Distinct()
                        .Select(i => solutions.Solutions.First(d => d.Solution == i))
                        .ToList();
            MinimalImpacts = Impacts.Except(Impacts.SelectMany(r => r.TransitiveImpacts)).ToList();
            var transitive = new HashSet <DependentSolution>(Impacts);

            foreach (var i in Impacts.SelectMany(r => r.TransitiveImpacts))
            {
                transitive.Add(i);
            }
            TransitiveImpacts = transitive;

            ImportedLocalPackages = solutions.PackageDependencies
                                    .Where(d => d.Origin == this)
                                    .Select(d => new ImportedLocalPackage(d))
                                    .ToArray();

            ExportedLocalPackages = solutions.PackageDependencies
                                    .Where(d => d.Target == this)
                                    .Select(d => new ExportedLocalPackage(d))
                                    .ToArray();
        }
Ejemplo n.º 2
0
 DependencyAnalyzer(
     IActivityMonitor m,
     IReadOnlyCollection <ISolution> solutions,
     ISolutionContext solutionCtx,
     ProjectItem.Cache projects,
     List <PackageReference> externalRefs,
     bool traceGraphDetails)
 {
     _solutions                = solutions;
     _solutionContext          = solutionCtx;
     _version                  = _solutionContext?.Version ?? 0;
     _projects                 = projects;
     _externalRefs             = externalRefs;
     _defaultDependencyContext = CreateDependencyContext(m, traceGraphDetails);
 }