Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle NuGet.Build.Tasks.Console in redist #10794

Merged
merged 6 commits into from
Mar 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/nuget/nuget.client -->
<NuGetBuildTasksPackageVersion>5.6.0-preview.2.6489</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksPackageVersion>5.6.0-preview.2.6508</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksConsolePackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksConsolePackageVersion>
<NuGetBuildTasksPackPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksPackPackageVersion>
<NuGetCommandLineXPlatPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetCommandLineXPlatPackageVersion>
<NuGetProjectModelPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetProjectModelPackageVersion>
Expand Down
1 change: 1 addition & 0 deletions src/Layout/redist/redist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<ItemGroup>
<PackageReference Include="NuGet.Build.Tasks" Version="$(NuGetBuildTasksPackageVersion)" />
<PackageReference Include="NuGet.Build.Tasks.Console" Version="$(NuGetBuildTasksConsolePackageVersion)" />
<PackageReference Include="Microsoft.Build.NuGetSdkResolver" Version="$(MicrosoftBuildNuGetSdkResolverPackageVersion)" />
<PackageReference Include="Microsoft.TestPlatform.CLI" Version="$(MicrosoftTestPlatformCLIPackageVersion)" ExcludeAssets="All" />
<PackageReference Include="Microsoft.TestPlatform.Build" Version="$(MicrosoftTestPlatformBuildPackageVersion)" />
Expand Down
33 changes: 25 additions & 8 deletions src/Tests/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ public GivenThatIWantToRestoreApp(ITestOutputHelper log) : base(log)
{
}

[Fact]
public void ItRestoresAppToSpecificDirectory()
[Theory]
[InlineData(true)]
[InlineData(false)]
public void ItRestoresAppToSpecificDirectory(bool useStaticGraphEvaluation)
{
var rootPath = _testAssetsManager.CreateTestDirectory().Path;

Expand All @@ -37,6 +39,7 @@ public void ItRestoresAppToSpecificDirectory()
.Path;

string[] args = new[] { "--packages", fullPath };
args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args);
new DotnetRestoreCommand(Log)
.WithWorkingDirectory(projectDirectory)
.Execute(args)
Expand All @@ -48,8 +51,10 @@ public void ItRestoresAppToSpecificDirectory()
Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0);
}

[Fact]
public void ItRestoresLibToSpecificDirectory()
[Theory]
[InlineData(true)]
[InlineData(false)]
public void ItRestoresLibToSpecificDirectory(bool useStaticGraphEvaluation)
{
var rootPath = _testAssetsManager.CreateTestDirectory().Path;

Expand All @@ -64,6 +69,7 @@ public void ItRestoresLibToSpecificDirectory()
.Pass();

string[] args = new[] { "--packages", dir };
args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args);
new DotnetRestoreCommand(Log)
.WithWorkingDirectory(rootPath)
.Execute(args)
Expand All @@ -75,8 +81,10 @@ public void ItRestoresLibToSpecificDirectory()
Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0);
}

[Fact]
public void ItRestoresTestAppToSpecificDirectory()
[Theory]
[InlineData(true)]
[InlineData(false)]
public void ItRestoresTestAppToSpecificDirectory(bool useStaticGraphEvaluation)
{
var rootPath = _testAssetsManager.CopyTestAsset("VSTestCore")
.WithSource()
Expand All @@ -87,6 +95,7 @@ public void ItRestoresTestAppToSpecificDirectory()
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));

string[] args = new[] { "--packages", dir };
args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args);
new DotnetRestoreCommand(Log)
.WithWorkingDirectory(rootPath)
.Execute(args)
Expand All @@ -98,8 +107,10 @@ public void ItRestoresTestAppToSpecificDirectory()
Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0);
}

[Fact]
public void ItRestoresWithTheSpecifiedVerbosity()
[Theory]
[InlineData(true)]
[InlineData(false)]
public void ItRestoresWithTheSpecifiedVerbosity(bool useStaticGraphEvaluation)
{
var rootPath = _testAssetsManager.CreateTestDirectory().Path;

Expand All @@ -114,6 +125,7 @@ public void ItRestoresWithTheSpecifiedVerbosity()
.Pass();

string[] args = new[] { "--packages", dir, "--verbosity", "quiet" };
args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args);
new DotnetRestoreCommand(Log)
.WithWorkingDirectory(rootPath)
.Execute(args)
Expand All @@ -122,5 +134,10 @@ public void ItRestoresWithTheSpecifiedVerbosity()
.And.NotHaveStdErr()
.And.NotHaveStdOut();
}

private static string[] HandleStaticGraphEvaluation(bool useStaticGraphEvaluation, string[] args) =>
useStaticGraphEvaluation ?
args.Append("/p:RestoreUseStaticGraphEvaluation=true").ToArray() :
args;
}
}