diff --git a/eng/Versions.props b/eng/Versions.props index f82fda3b5632..f7dac959c682 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -39,7 +39,8 @@ - 5.6.0-preview.2.6489 + 5.6.0-preview.2.6508 + $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) diff --git a/src/Layout/redist/redist.csproj b/src/Layout/redist/redist.csproj index c6748e6ada81..a9fbbb60a902 100644 --- a/src/Layout/redist/redist.csproj +++ b/src/Layout/redist/redist.csproj @@ -20,6 +20,7 @@ + diff --git a/src/Tests/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs b/src/Tests/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs index f1aa44c4da97..e27bfea922b5 100644 --- a/src/Tests/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs +++ b/src/Tests/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs @@ -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; @@ -37,6 +39,7 @@ public void ItRestoresAppToSpecificDirectory() .Path; string[] args = new[] { "--packages", fullPath }; + args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args); new DotnetRestoreCommand(Log) .WithWorkingDirectory(projectDirectory) .Execute(args) @@ -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; @@ -64,6 +69,7 @@ public void ItRestoresLibToSpecificDirectory() .Pass(); string[] args = new[] { "--packages", dir }; + args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args); new DotnetRestoreCommand(Log) .WithWorkingDirectory(rootPath) .Execute(args) @@ -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() @@ -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) @@ -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; @@ -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) @@ -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; } }