Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Initialize NuGet's Credential Service (#868)
Browse files Browse the repository at this point in the history
* Initialize NuGet's Credential Service

* Init credentials (#3)

* Initialize NuGet's Credential Service

* Rebased and switched to the expected Logger (#2)

* 📦 Automatic update of NUnit3TestAdapter to 3.15.1 (#869)

* 📦 Automatic update of SimpleInjector to 4.7.1 (#870)

* 📦 Automatic update of LibGit2Sharp to 0.26.1 (#874)

* Automatic update of NuGet.CommandLine to 5.2.0 (#875)

* 📦 Automatic update of NuGet.CommandLine to 5.2.0

* Bump the packaged NuGet version

* 📦 Automatic update of Octokit to 0.34.0 (#880)

* FxCopAnalyzers already pulls in other analyzers (#883)

* Automatic update of Microsoft.NET.Test.Sdk to 16.3.0 (#884)

* 📦 Automatic update of Microsoft.NET.Test.Sdk to 16.3.0

* Fix mismatched test project target framework

* Automatic update of coverlet.msbuild to 2.7.0 (#885)

* 📦 Automatic update of coverlet.msbuild to 2.7.0

* Remove duplicate coverlet privateassets node

* 📦 Automatic update of NuGet.Protocol to 5.3.0 (#886)

* 📦 Automatic update of System.Text.Encoding.CodePages to 4.6.0 (#887)

* 📦 Automatic update of McMaster.Extensions.CommandLineUtils to 2.4.2 (#888)

* 📦 Automatic update of Octokit to 0.36.0 (#890)

* Initialize NuGet's Credential Service

* Switch to nuget logger
  • Loading branch information
ransagy committed Feb 11, 2020
1 parent 6375b62 commit 3af96ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NuKeeper.Tests/Local/LocalEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ private static LocalEngine MakeLocalEngine(IUpdateFinder finder, ILocalUpdater u

var logger = Substitute.For<INuKeeperLogger>();

var reporter = Substitute.For<IReporter>();
var nugetLogger = Substitute.For<NuGet.Common.ILogger>();

var reporter = Substitute.For<IReporter>();

var engine = new LocalEngine(reader, finder, sorter, updater,
reporter, logger);
reporter, logger, nugetLogger);
Assert.That(engine, Is.Not.Null);
return engine;
}
Expand Down
9 changes: 8 additions & 1 deletion NuKeeper/Local/LocalEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using NuGet.Common;
using NuGet.Credentials;
using NuKeeper.Abstractions.Configuration;
using NuKeeper.Abstractions.Inspections.Files;
using NuKeeper.Abstractions.Logging;
Expand All @@ -24,25 +26,30 @@ public class LocalEngine : ILocalEngine
private readonly ILocalUpdater _updater;
private readonly IReporter _reporter;
private readonly INuKeeperLogger _logger;
private readonly ILogger _nugetLogger;

public LocalEngine(
INuGetSourcesReader nuGetSourcesReader,
IUpdateFinder updateFinder,
IPackageUpdateSetSort sorter,
ILocalUpdater updater,
IReporter reporter,
INuKeeperLogger logger)
INuKeeperLogger logger,
ILogger nugetLogger)
{
_nuGetSourcesReader = nuGetSourcesReader;
_updateFinder = updateFinder;
_sorter = sorter;
_updater = updater;
_reporter = reporter;
_logger = logger;
_nugetLogger = nugetLogger;
}

public async Task Run(SettingsContainer settings, bool write)
{
DefaultCredentialServiceUtility.SetupDefaultCredentialService(_nugetLogger, true);

var folder = TargetFolder(settings.UserSettings);

var sources = _nuGetSourcesReader.Read(folder, settings.UserSettings.NuGetSources);
Expand Down
1 change: 1 addition & 0 deletions NuKeeper/NuKeeper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NuGet.Credentials" Version="5.2.0" />
<PackageReference Include="SimpleInjector" Version="4.7.1" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 3af96ea

Please sign in to comment.