-
Notifications
You must be signed in to change notification settings - Fork 692
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
Add support for restoring slnf file from command line #4790
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contributing @kvpt
Given that we're using reflection for an internal method, I've pinged some msbuild folks to see if they have any suggestions.
@@ -327,6 +327,55 @@ public void RestoreCommand_FromSolutionFile(string configFileName) | |||
} | |||
} | |||
|
|||
[Theory] | |||
[InlineData("packages.config")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change work with packagesreference type project too? If yes, then we may need another test for that one too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's super relevant.
This is about choosing which projects to restore which happens prior to any notion of packages.config vs PackageReference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delayed review.
@@ -327,6 +327,55 @@ public void RestoreCommand_FromSolutionFile(string configFileName) | |||
} | |||
} | |||
|
|||
[Theory] | |||
[InlineData("packages.config")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's super relevant.
This is about choosing which projects to restore which happens prior to any notion of packages.config vs PackageReference.
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetRestoreCommandTest.cs
Outdated
Show resolved
Hide resolved
Assert.False(File.Exists(packageFileB)); | ||
} | ||
|
||
using (var pathContext = new SimpleTestPathContext()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use a completely separate bath context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to isolate the two runs because in the first we only want the package A to be restored and in the second the package B. If we only use a unique context the package A will be already restored and the second assert will fail.
The use of the second context was the simplest way that I thought to reset the state of the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just make it theory and pass true/false to decide which slnf file to restore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to have the previous state, as long as we account for that.
Projects having a different package covers for that. We shouldn't need the separate working directories.
Apologies for the delay @kvpt. |
No problem, I myself didn't have time lately to process the latest feedbacks. |
No worries. |
Bug
Fixes:
NuGet/Home#10809
Regression? Last working version:
Description
Add support for restoring slnf file from command line
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation