Skip to content
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
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
<Uri>https://github.com/dotnet/aspnetcore-tooling</Uri>
<Sha>7fa56fb1071c014bad8e471916a0143acb33fd6a</Sha>
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="5.6.0-preview.2.6532">
<Dependency Name="NuGet.Build.Tasks" Version="5.7.0-preview.1.6609">
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
<Sha>1c2681b16a0bb9be9271abe043a1cbf892761ef8</Sha>
<Sha>12a375a8a02764b772a20371abaf797639a7f961</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="16.7.0-preview-20200421-02">
<Uri>https://github.com/microsoft/vstest</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/nuget/nuget.client -->
<NuGetBuildTasksPackageVersion>5.6.0-preview.2.6532</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksPackageVersion>5.7.0-preview.1.6609</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksConsolePackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksConsolePackageVersion>
<NuGetBuildTasksPackPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksPackPackageVersion>
<NuGetCommandLineXPlatPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetCommandLineXPlatPackageVersion>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "5.0.100-preview.2.20152.7",
"dotnet": "5.0.100-preview.5.20258.4",
"runtimes": {
"dotnet": [
"$(MicrosoftNETCoreAppRuntimePackageVersion)"
Expand Down
36 changes: 27 additions & 9 deletions src/Tests/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.NET.TestFramework.Assertions;
using Microsoft.NET.TestFramework.Commands;
using Xunit.Abstractions;
using Microsoft.NET.TestFramework.ProjectConstruction;

namespace Microsoft.DotNet.Restore.Test
{
Expand Down Expand Up @@ -56,18 +57,22 @@ public void ItRestoresAppToSpecificDirectory(bool useStaticGraphEvaluation)
[InlineData(false)]
public void ItRestoresLibToSpecificDirectory(bool useStaticGraphEvaluation)
{
var rootPath = _testAssetsManager.CreateTestDirectory().Path;
var testProject = new TestProject()
{
Name = "RestoreToDir",
TargetFrameworks = "net5.0",
IsSdkProject = true,
};

testProject.PackageReferences.Add(new TestPackageReference("Newtonsoft.Json", "12.0.3"));

var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: useStaticGraphEvaluation.ToString());

var rootPath = Path.Combine(testAsset.TestRoot, testProject.Name);

string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));

string [] newArgs = new[] { "classlib", "-o", rootPath, "--no-restore" };
new DotnetCommand(Log, "new")
.WithWorkingDirectory(rootPath)
.Execute(newArgs)
.Should()
.Pass();

string[] args = new[] { "--packages", dir };
args = HandleStaticGraphEvaluation(useStaticGraphEvaluation, args);
new DotnetRestoreCommand(Log)
Expand All @@ -77,8 +82,21 @@ public void ItRestoresLibToSpecificDirectory(bool useStaticGraphEvaluation)
.Pass()
.And.NotHaveStdErr();

var dllCount = 0;

if (Directory.Exists(fullPath))
{
dllCount = Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count();
}

if (dllCount == 0)
{
Log.WriteLine("Assets file contents:");
Log.WriteLine(File.ReadAllText(Path.Combine(rootPath, "obj", "project.assets.json")));
}

Directory.Exists(fullPath).Should().BeTrue();
Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0);
dllCount.Should().BeGreaterThan(0);
}

[Theory]
Expand Down