Ejemplo n.º 1
0
        public async Task ApplyAnUpdate(
            IReadOnlyCollection <PackageUpdateSet> updates,
            NuGetSources sources)
        {
            if (!updates.Any())
            {
                return;
            }

            var filtered = await _selection
                           .Filter(updates, p => Task.FromResult(true));

            if (!filtered.Any())
            {
                _logger.Detailed("All updates were filtered out");
                return;
            }

            var candidate = filtered.First();

            var reporter = new ConsoleReporter();

            _logger.Minimal("Updating " + reporter.Describe(candidate));

            await _updateRunner.Update(candidate, sources);
        }
Ejemplo n.º 2
0
        public async Task ApplyUpdates(
            IReadOnlyCollection <PackageUpdateSet> updates,
            IFolder workingFolder,
            NuGetSources sources,
            SettingsContainer settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            if (!updates.Any())
            {
                return;
            }

            var filtered = _selection
                           .Filter(updates, settings.PackageFilters);

            if (!filtered.Any())
            {
                _logger.Detailed("All updates were filtered out");
                return;
            }

            await ApplyUpdates(filtered, workingFolder, sources);
        }
Ejemplo n.º 3
0
 private static void FilterIsPassThrough(IUpdateSelection selection)
 {
     selection
     .Filter(
         Arg.Any <IReadOnlyCollection <PackageUpdateSet> >(),
         Arg.Any <FilterSettings>())
     .Returns(x => x.ArgAt <IReadOnlyCollection <PackageUpdateSet> >(0));
 }
Ejemplo n.º 4
0
        public async Task <IReadOnlyCollection <PackageUpdateSet> > SelectTargets(
            ForkData pushFork,
            IReadOnlyCollection <PackageUpdateSet> potentialUpdates)
        {
            var sorted = _sort.Sort(potentialUpdates)
                         .ToList();

            var filtered = await _updateSelection.Filter(sorted,
                                                         p => _existingBranchFilter.CanMakeBranchFor(p, pushFork));

            foreach (var updateSet in filtered)
            {
                _logger.Normal($"Selected package update of {updateSet.SelectedId} to {updateSet.SelectedVersion}");
            }

            return(filtered);
        }
        public IReadOnlyCollection <PackageUpdateSet> SelectTargets(
            ForkData pushFork,
            IReadOnlyCollection <PackageUpdateSet> potentialUpdates,
            FilterSettings filterSettings)
        {
            var sorted = _sort.Sort(potentialUpdates)
                         .ToList();

            var filtered = _updateSelection.Filter(sorted, filterSettings);

            foreach (var updateSet in filtered)
            {
                _logger.Normal($"Selected package update of {updateSet.SelectedId} to {updateSet.SelectedVersion}");
            }

            return(filtered);
        }
Ejemplo n.º 6
0
        public async Task ApplyUpdates(
            IReadOnlyCollection <PackageUpdateSet> updates,
            IFolder workingFolder,
            NuGetSources sources,

            SettingsContainer settings)
        {
            if (!updates.Any())
            {
                return;
            }

            var filtered = await _selection
                           .Filter(updates, settings.PackageFilters, p => Task.FromResult(true));

            if (!filtered.Any())
            {
                _logger.Detailed("All updates were filtered out");
                return;
            }

            await ApplyUpdates(filtered, workingFolder, sources);
        }