-
Notifications
You must be signed in to change notification settings - Fork 740
Add dotnet nuget why command
#5761
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
Changes from 1 commit
708f4e2
10245f8
2098b79
3d428bc
db9a7ce
ef25ca2
9170c26
b1b74f5
067430a
08e95fc
ae50998
3f153f9
8a750f1
25804a8
a44299b
073e9b5
7ed373a
aaee328
ebc4732
4a42f3e
d9a6482
904740e
69bfb3b
cb0c043
e55583a
7891af4
fa67ec9
961b7df
cf5771f
efaee79
0bba3a1
8ee8eba
31a6bf3
5c3ad52
852edf0
923a1df
527d448
506ee92
1297105
fec9de8
b164b31
2a1c576
dccf34c
50394da
8f3db89
d9c8890
6074b25
7aceac8
8aff030
ee68859
118735d
7b9a2e9
4a60b13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,35 +39,48 @@ public static int ExecuteCommand(WhyCommandArgs whyCommandArgs) | |
| foreach (var projectPath in projectPaths) | ||
| { | ||
| Project project = MSBuildAPIUtility.GetProject(projectPath); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can enhance the MSBuildAPIUtility to just return the ProjectAndSolution type instead of selecting only the paths in I'm not familiar with these types, so let's see if @jeffkl has opinions on this. |
||
| LockFile? assetsFile = GetProjectAssetsFile(project, whyCommandArgs.Logger); | ||
|
|
||
| if (assetsFile != null) | ||
| { | ||
| ValidateFrameworksOptions(assetsFile, whyCommandArgs.Frameworks, whyCommandArgs.Logger); | ||
| string usingNetSdk = project.GetPropertyValue("UsingMicrosoftNETSdk"); | ||
|
|
||
| Dictionary<string, List<DependencyNode>?>? dependencyGraphPerFramework = DependencyGraphFinder.GetAllDependencyGraphsForTarget( | ||
| assetsFile, | ||
| whyCommandArgs.Package, | ||
| whyCommandArgs.Frameworks); | ||
| if (!string.IsNullOrEmpty(usingNetSdk)) | ||
| { | ||
| LockFile? assetsFile = GetProjectAssetsFile(project, whyCommandArgs.Logger); | ||
|
|
||
| if (dependencyGraphPerFramework != null) | ||
| if (assetsFile != null) | ||
| { | ||
| whyCommandArgs.Logger.LogMinimal( | ||
| string.Format( | ||
| Strings.WhyCommand_Message_DependencyGraphsFoundInProject, | ||
| assetsFile.PackageSpec.Name, | ||
| targetPackage)); | ||
|
|
||
| DependencyGraphPrinter.PrintAllDependencyGraphs(dependencyGraphPerFramework, targetPackage, whyCommandArgs.Logger); | ||
| ValidateFrameworksOptions(assetsFile, whyCommandArgs.Frameworks, whyCommandArgs.Logger); | ||
|
|
||
| Dictionary<string, List<DependencyNode>?>? dependencyGraphPerFramework = DependencyGraphFinder.GetAllDependencyGraphsForTarget( | ||
| assetsFile, | ||
| whyCommandArgs.Package, | ||
| whyCommandArgs.Frameworks); | ||
|
|
||
| if (dependencyGraphPerFramework != null) | ||
| { | ||
| whyCommandArgs.Logger.LogMinimal( | ||
| string.Format( | ||
| Strings.WhyCommand_Message_DependencyGraphsFoundInProject, | ||
| assetsFile.PackageSpec.Name, | ||
| targetPackage)); | ||
|
|
||
| DependencyGraphPrinter.PrintAllDependencyGraphs(dependencyGraphPerFramework, targetPackage, whyCommandArgs.Logger); | ||
| } | ||
| else | ||
| { | ||
| whyCommandArgs.Logger.LogMinimal( | ||
| string.Format( | ||
| Strings.WhyCommand_Message_NoDependencyGraphsFoundInProject, | ||
| assetsFile.PackageSpec.Name, | ||
| targetPackage)); | ||
| } | ||
| } | ||
| else | ||
| { | ||
| whyCommandArgs.Logger.LogMinimal( | ||
| } | ||
| else | ||
| { | ||
| whyCommandArgs.Logger.LogMinimal( | ||
| string.Format( | ||
| Strings.WhyCommand_Message_NoDependencyGraphsFoundInProject, | ||
| assetsFile.PackageSpec.Name, | ||
| targetPackage)); | ||
| } | ||
| Strings.WhyCommand_Message_NonSDKStyleProjectsAreNotSupported, | ||
| project.GetPropertyValue("MSBuildProjectName"))); | ||
| } | ||
|
|
||
| ProjectCollection.GlobalProjectCollection.UnloadProject(project); | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.