-
Notifications
You must be signed in to change notification settings - Fork 697
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 nfproj to supported project extensions #3943
Conversation
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
Outdated
Show resolved
Hide resolved
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.
Hello! My first pass is just pointing out obvious coding guideline violations. See rule #10.
Will take another look soon...
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetInstallCommandTest.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetInstallCommandTest.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetInstallCommandTest.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetInstallCommandTest.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetInstallCommandTest.cs
Outdated
Show resolved
Hide resolved
slnContent.AppendLine("# Visual Studio Version 16"); | ||
slnContent.AppendLine("VisualStudioVersion = 16.0.31005.135"); | ||
|
||
foreach(string project in projectList) |
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.
space after foreach
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.
no more space
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.
Please check below example, we want space foreach (
:
NuGet.Client/src/NuGet.Clients/NuGet.CommandLine/Commands/ProjectFactory.cs
Lines 969 to 974 in 73e5977
foreach (var reader in packagesAndDependencies) | |
{ | |
foreach (var set in reader.Item1.GetPackageDependencies()) | |
{ | |
foreach (var dependency in set.Packages) | |
{ |
Another way to deal with syntax is install dotnet-format
tool from https://github.com/dotnet/format
then run dotnet-format --exclude submodules
, it'll take care of it for you.
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.
Got you. Should be OK now
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
Outdated
Show resolved
Hide resolved
@josesimoes |
@erdembayar rebase done! As for the unaddressed comments, I couldn't find none... Can you please point me to those? |
I can see one unaddressed here: #3943 (comment) |
Just unresolved it.
|
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.
@josesimoes
Thank you for your contribution. There are still some work need to do.
Please review PR comment and clean up. There are some unused items.
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetUpdateCommandTests.cs
Show resolved
Hide resolved
/// Create a simple package with a lib folder for .NET nanoFramework | ||
/// The package will be removed from the machine cache upon creation | ||
/// </summary> | ||
public static ZipPackage CreateNFPackage(string repositoryPath, string id, string version) |
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.
What is the use of this one? Not used.
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.
Removed
/// <param name="path">Path where the package will be saved</param> | ||
/// <param name="contentFiles">Content file(s) to be added to the package</param> | ||
/// <returns></returns> | ||
public static string CreateNFTestPackage( |
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.
Here nothing special about NF is going on. How about using existing create package utility instead of creating new one?
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.
Because we don't have a TFM, our DLLs have to be placed inside the lib folder. I couldn't find a nice way to do it with the existing methods. If there is one, please point me to it.
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.
@nkolev92
Do you have any recommendation here?
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.
Look into SimpleTestPackageContext and then do Files.Clear()
and add a few file paths,
NuGet.Client/test/TestUtilities/Test.Utility/SimpleTestSetup/SimpleTestPackageContext.cs
Line 52 in c6ca6eb
public List<KeyValuePair<string, byte[]>> Files { get; set; } = new List<KeyValuePair<string, byte[]>>(); |
If you search for references of Files, you'll likely find many tests already do that.
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 believe I've replaced them all with the equivalent ones from SimpleTestPackage.
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.
@josesimoes
I assume you're going to remove this one since it's not referenced anymore.
@@ -1841,5 +1841,43 @@ public static CommandRunnerResult RunInstall(SimpleTestPathContext pathContext, | |||
|
|||
return r; | |||
} | |||
|
|||
[Fact] | |||
public void InstallCommand_NF_Project() |
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.
Please check other comment about CreateNFTestPackage
.
Here nothing is actually special about 'NF'.
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.
Because of the above, I thought it was relevant to have this one here. If it's not please confirm and I'll remove it.
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.
Currently I don't see any value in this, so I prefer to remove it.
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.
OK. Removing it.
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.
Ok. I'll review again. Also could you be able to make incremental commits instead quashing to 1 commit next time?
It's hard to see what was actual change from last time. I have to start again.
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.
oh... I apologize... though you would prefer it as a single commit...
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.
We squash when merging in the dev branch for this exact reason.
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.
Understood. Each project handles this differently... there was nothing about this on the contributing guide. I'll start doing that.
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.
Honestly, it's something we haven't documented.
The incremental commits has been largely at the discretion of the contributor + reviewers.
52435b4
to
d123a0c
Compare
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.
@josesimoes
We're getting very close, just 1 more comment from me.
Can you address comment from nkolev92
?
@@ -1841,5 +1841,43 @@ public static CommandRunnerResult RunInstall(SimpleTestPathContext pathContext, | |||
|
|||
return r; | |||
} | |||
|
|||
[Fact] | |||
public void InstallCommand_NF_Project() |
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.
Currently I don't see any value in this, so I prefer to remove it.
/// <param name="path">Path where the package will be saved</param> | ||
/// <param name="contentFiles">Content file(s) to be added to the package</param> | ||
/// <returns></returns> | ||
public static string CreateNFTestPackage( |
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.
@nkolev92
Do you have any recommendation here?
@@ -1237,5 +1237,155 @@ public static void TestCommandInvalidArguments(string command) | |||
// Verify traits of help message in stdout | |||
Assert.Contains("usage:", result.Item2); | |||
} | |||
|
|||
#region helper methods for .NET nanoFramework tests |
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.
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.
Removed
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.
@josesimoes
Good job.
Please remove unused method, then we're good.
Also just in case rebase with latest dev
branch. Once it passes CI build then I'll approve.
/// <param name="path">Path where the package will be saved</param> | ||
/// <param name="contentFiles">Content file(s) to be added to the package</param> | ||
/// <returns></returns> | ||
public static string CreateNFTestPackage( |
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.
@josesimoes
I assume you're going to remove this one since it's not referenced anymore.
a1Package.Files.Clear(); | ||
a1Package.AddFile($"lib/{a1.Id}.dll"); | ||
|
||
var a1File = await a1Package.CreateAsFileAsync(packagesSourceDirectory, a1Package.PackageName); |
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.
Replace var with FileInfo
type.
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.
Done
b1Package.Files.Clear(); | ||
b1Package.AddFile($"lib/{b1.Id}.dll"); | ||
|
||
var b1File = await a1Package.CreateAsFileAsync(packagesSourceDirectory, b1Package.PackageName); |
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.
Replace var with FileInfo
type.
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.
Done
- Add extension to supported projects. - Add unit tests for install and update commands in CLI.
Done
Rebased |
Anything I need to do/change to address whatever is causing those checks to fail? |
Most likely no, I'll take care of it. |
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.
@josesimoes
Thank you for contribution.
It'll merge today or tomorrow.
Bug
Fixes: NuGet/Home#10562.
Regression? Last working version:
Description
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation