Esempio n. 1
0
        public IEnumerable <PackageUpdateSet> Sort(IReadOnlyCollection <PackageUpdateSet> input)
        {
            var prioritySorter = new PrioritySort();
            var topoSorter     = new TopologicalSort(_logger);

            var priorityOrder = prioritySorter.Sort(input);

            return(topoSorter.Sort(priorityOrder.ToList()));
        }
        public IEnumerable <PackageUpdateSet> Sort(IReadOnlyCollection <PackageUpdateSet> input)
        {
            var topo = new TopologicalSort <PackageUpdateSet>(_logger, Match);

            var inputMap = input.Select(p =>
                                        new SortItemData <PackageUpdateSet>(p, PackageDeps(p, input)))
                           .ToList();

            var sorted = topo.Sort(inputMap)
                         .ToList();

            ReportSort(input.ToList(), sorted);
            return(sorted);
        }