-
Notifications
You must be signed in to change notification settings - Fork 735
Dotnet list package json output implementation #4855
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
Conversation
2d69c1a to
9d12028
Compare
f9afd82 to
1d974c7
Compare
a637450 to
ee4f557
Compare
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Show resolved
Hide resolved
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Outdated
Show resolved
Hide resolved
| var projectAPath = Path.Combine(pathContext.SolutionRoot, "projectA.csproj"); | ||
| var projectBPath = Path.Combine(pathContext.SolutionRoot, "projectB.csproj"); | ||
|
|
||
| using (FileStream stream = new FileStream(consoleOutputFileName, FileMode.Create)) |
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.
Json output is redirected to consoleOutput.txt file. Later this file content compared to expected output for assertion.
f41ee35 to
abb5159
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.
Just some minor comments at this point.
There are some tests failing, so approving it wouldn't help much :D
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Show resolved
Hide resolved
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Outdated
Show resolved
Hide resolved
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageOutputContent.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageOutputContent.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListReportPackage.cs
Outdated
Show resolved
Hide resolved
bf7a26c to
4ce40e8
Compare
4ce40e8 to
ff6b93b
Compare
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageConsoleRenderer.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageOutputContent.cs
Outdated
Show resolved
Hide resolved
|
@nkolev92 @erdembayar I wanted to check if we have the same feature but for dependency graph relation. Something like showing child dependencies in the parent (Simply a dependency relation JSON graph). |
I don't believe we have one considering this is the 1st ever json output we have. You can create a feature request here. |
* Dotnet list package machine readable output implementation
Bug
Fixes: NuGet/Home#7752
Regression? Last working version:
Description
Implement Dotnet List Package Machine Readable Json Output spec (spec PR), e.g.
dotnet list package --format jsonwill give you json output.If there any error with json generation then application will return
non-zerovalue.This PR also include MVC style refactoring of the existing
dotnet list packageto console output logic.Here get the report model/data
NuGet.Client/src/NuGet.Core/NuGet.CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Line 38 in 7691366
consoleandjsonoutput options. So that means any existing tests like DotnetListPackageTests.cs already covers up untilNuGet.Client/src/NuGet.Core/NuGet.CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Line 39 in 7691366
jsonreport Renderer implementation by passing report model.I added most basic unit tests, I'll add more later if needed.
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation