Adding the configurer to dotnet.
This commit is contained in:
parent
461c26b78d
commit
4c5f097d67
6 changed files with 39 additions and 8 deletions
|
@ -119,6 +119,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Configurer
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Configurer.UnitTests", "test\Microsoft.DotNet.Configurer.UnitTests\Microsoft.DotNet.Configurer.UnitTests.xproj", "{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Configurer.UnitTests", "test\Microsoft.DotNet.Configurer.UnitTests\Microsoft.DotNet.Configurer.UnitTests.xproj", "{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Archive", "src\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.xproj", "{35B19F22-B8C0-4849-9C35-3F809B7588B8}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -883,6 +885,22 @@ Global
|
||||||
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||||
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||||
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.MinSizeRel|x64.Build.0 = Debug|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -940,5 +958,6 @@ Global
|
||||||
{5DF6C9DA-6909-4EC0-909E-6913580BB4A4} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
{5DF6C9DA-6909-4EC0-909E-6913580BB4A4} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||||
{E5ED47EF-BF25-4DA9-A7FE-290C642CBF0F} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
{E5ED47EF-BF25-4DA9-A7FE-290C642CBF0F} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
||||||
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||||
|
{35B19F22-B8C0-4849-9C35-3F809B7588B8} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
@ -165,12 +165,14 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
|
||||||
public ICommand CaptureStdErr()
|
public ICommand CaptureStdErr()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
_stdErr.Capture();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand CaptureStdOut()
|
public ICommand CaptureStdOut()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
_stdOut.Capture();
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand EnvironmentVariable(string name, string value)
|
public ICommand EnvironmentVariable(string name, string value)
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace Microsoft.DotNet.Configurer
|
||||||
{
|
{
|
||||||
if(ShouldPrimeNugetCache())
|
if(ShouldPrimeNugetCache())
|
||||||
{
|
{
|
||||||
|
Reporter.Output.WriteLine("Configuring dotnet CLI for first time use.");
|
||||||
_nugetCachePrimer.PrimeCache();
|
_nugetCachePrimer.PrimeCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,13 +63,13 @@ namespace Microsoft.DotNet.Configurer
|
||||||
|
|
||||||
private bool CreateTemporaryProject(string workingDirectory)
|
private bool CreateTemporaryProject(string workingDirectory)
|
||||||
{
|
{
|
||||||
return RunCommand("dotnet new", Enumerable.Empty<string>(), workingDirectory);
|
return RunCommand("new", Enumerable.Empty<string>(), workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool RestoreTemporaryProject(string pathToPackagesArchive, string workingDirectory)
|
private bool RestoreTemporaryProject(string pathToPackagesArchive, string workingDirectory)
|
||||||
{
|
{
|
||||||
return RunCommand(
|
return RunCommand(
|
||||||
"dotnet restore",
|
"restore",
|
||||||
new[] {NUGET_SOURCE_PARAMETER, $"{pathToPackagesArchive}"},
|
new[] {NUGET_SOURCE_PARAMETER, $"{pathToPackagesArchive}"},
|
||||||
workingDirectory);
|
workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ using System.Linq;
|
||||||
using System.Runtime.Loader;
|
using System.Runtime.Loader;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
|
using Microsoft.DotNet.Configurer;
|
||||||
using Microsoft.DotNet.InternalAbstractions;
|
using Microsoft.DotNet.InternalAbstractions;
|
||||||
using Microsoft.DotNet.ProjectModel.Server;
|
using Microsoft.DotNet.ProjectModel.Server;
|
||||||
using Microsoft.DotNet.Tools.Build;
|
using Microsoft.DotNet.Tools.Build;
|
||||||
|
@ -56,6 +57,14 @@ namespace Microsoft.DotNet.Cli
|
||||||
{
|
{
|
||||||
using (PerfTrace.Current.CaptureTiming())
|
using (PerfTrace.Current.CaptureTiming())
|
||||||
{
|
{
|
||||||
|
var nugetCacheSentinel = new NuGetCacheSentinel();
|
||||||
|
var nugetPackagesArchiver = new NuGetPackagesArchiver();
|
||||||
|
var commandFactory = new DotNetCommandFactory();
|
||||||
|
var nugetCachePrimer = new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
|
||||||
|
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(nugetCachePrimer, nugetCacheSentinel);
|
||||||
|
|
||||||
|
dotnetConfigurer.Configure();
|
||||||
|
|
||||||
return ProcessArgs(args, new Telemetry());
|
return ProcessArgs(args, new Telemetry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,14 +58,14 @@ namespace Microsoft.DotNet.Configurer.UnitTests
|
||||||
_dotnetNewCommandMock = new Mock<ICommand>();
|
_dotnetNewCommandMock = new Mock<ICommand>();
|
||||||
SetupCommandMock(_dotnetNewCommandMock);
|
SetupCommandMock(_dotnetNewCommandMock);
|
||||||
commandFactoryMock
|
commandFactoryMock
|
||||||
.Setup(c => c.Create("dotnet new", Enumerable.Empty<string>(), null, Constants.DefaultConfiguration))
|
.Setup(c => c.Create("new", Enumerable.Empty<string>(), null, Constants.DefaultConfiguration))
|
||||||
.Returns(_dotnetNewCommandMock.Object);
|
.Returns(_dotnetNewCommandMock.Object);
|
||||||
|
|
||||||
_dotnetRestoreCommandMock = new Mock<ICommand>();
|
_dotnetRestoreCommandMock = new Mock<ICommand>();
|
||||||
SetupCommandMock(_dotnetRestoreCommandMock);
|
SetupCommandMock(_dotnetRestoreCommandMock);
|
||||||
commandFactoryMock
|
commandFactoryMock
|
||||||
.Setup(c => c.Create(
|
.Setup(c => c.Create(
|
||||||
"dotnet restore",
|
"restore",
|
||||||
It.IsAny<IEnumerable<string>>(),
|
It.IsAny<IEnumerable<string>>(),
|
||||||
null,
|
null,
|
||||||
Constants.DefaultConfiguration))
|
Constants.DefaultConfiguration))
|
||||||
|
@ -118,7 +118,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests
|
||||||
{
|
{
|
||||||
_commandFactoryMock.Verify(
|
_commandFactoryMock.Verify(
|
||||||
c => c.Create(
|
c => c.Create(
|
||||||
"dotnet restore",
|
"restore",
|
||||||
new [] {"-s", $"{PACKAGES_ARCHIVE_PATH}"},
|
new [] {"-s", $"{PACKAGES_ARCHIVE_PATH}"},
|
||||||
null,
|
null,
|
||||||
Constants.DefaultConfiguration),
|
Constants.DefaultConfiguration),
|
||||||
|
@ -141,7 +141,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests
|
||||||
|
|
||||||
commandFactoryMock.Verify(
|
commandFactoryMock.Verify(
|
||||||
c => c.Create(
|
c => c.Create(
|
||||||
"dotnet restore",
|
"restore",
|
||||||
It.IsAny<IEnumerable<string>>(),
|
It.IsAny<IEnumerable<string>>(),
|
||||||
It.IsAny<NuGetFramework>(),
|
It.IsAny<NuGetFramework>(),
|
||||||
It.IsAny<string>()),
|
It.IsAny<string>()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue