-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Improve support of nuget commands with file-based apps #53535
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 12 commits
4636072
6f441ad
0a3ae61
b17ab5e
d27f21e
c075657
a9b5e95
02d6243
461de77
2dcd1e7
1f019cd
8d28cc1
aba5332
fff4853
5c20baa
ca1bc34
8dee4f7
3fb5aed
32426a0
8c0b968
eab01e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Microsoft.Build.Construction; | ||
| using Microsoft.Build.Evaluation; | ||
| using Microsoft.DotNet.Cli.Commands.Package; | ||
| using Microsoft.DotNet.Cli.Commands.Run; | ||
| using Microsoft.DotNet.FileBasedPrograms; | ||
| using Microsoft.DotNet.ProjectTools; | ||
| using NuGet.CommandLine.XPlat; | ||
|
|
||
| namespace Microsoft.DotNet.Cli.Commands.NuGet; | ||
|
|
||
| internal sealed class NuGetVirtualProjectBuilder : IVirtualProjectBuilder | ||
|
Check failure on line 14 in src/Cli/dotnet/Commands/NuGet/NuGetVirtualProjectBuilder.cs
|
||
| { | ||
| public static NuGetVirtualProjectBuilder Instance => field ??= new(); | ||
|
|
||
| private NuGetVirtualProjectBuilder() { } | ||
|
|
||
| public bool IsValidEntryPointPath(string entryPointFilePath) => VirtualProjectBuilder.IsValidEntryPointPath(entryPointFilePath); | ||
|
|
||
| public string GetVirtualProjectPath(string entryPointFilePath) => VirtualProjectBuilder.GetVirtualProjectPath(entryPointFilePath); | ||
|
|
||
| public ProjectRootElement CreateProjectRootElement(string entryPointFilePath, ProjectCollection projectCollection) | ||
| { | ||
| var fullPath = Path.GetFullPath(entryPointFilePath); | ||
|
jjonescz marked this conversation as resolved.
Outdated
|
||
|
|
||
| var builder = new VirtualProjectBuilder(fullPath, VirtualProjectBuildingCommand.TargetFramework); | ||
|
|
||
| builder.CreateProjectInstance( | ||
| projectCollection, | ||
| ErrorReporters.IgnoringReporter, | ||
| out _, | ||
|
Member
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. Consider using named parameters for discards like this. |
||
| out var projectRootElement, | ||
| out _); | ||
|
|
||
| return projectRootElement; | ||
| } | ||
|
|
||
| public void SaveProject(string entryPointFilePath, ProjectRootElement projectRootElement) | ||
| { | ||
| VirtualProjectPackageReflector.ReflectChangesToDirectives(projectRootElement, entryPointFilePath); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.