From e50ede393763c82523302d5c551832f43feb7f97 Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 7 Mar 2025 16:38:31 -0800 Subject: [PATCH 1/6] Updated namespaces for existing Extension classes in the Extensions folder. Moved other Extensions classes into the Extensions folder. --- src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs | 2 ++ .../{ => Extensions}/AnsiExtensions.cs | 0 .../Extensions/CollectionsExtensions.cs | 2 +- .../{ => Extensions}/ExceptionExtensions.cs | 0 .../Extensions/LockFileExtensions.cs | 4 ++-- .../Extensions/LockFileFormatExtensions.cs | 2 +- .../{ => Extensions}/MSBuildProjectExtensions.cs | 0 .../Extensions/ProcessExtensions.cs | 2 +- .../{ => Extensions}/ProcessStartInfoExtensions.cs | 0 .../CommandResolution/AbstractPathBasedCommandResolver.cs | 1 + .../CommandResolution/AppBaseDllCommandResolver.cs | 1 + .../CommandResolution/DepsJsonCommandResolver.cs | 1 + .../dotnet/CommandFactory/CommandResolution/MSBuildProject.cs | 1 + .../CommandFactory/CommandResolution/MuxerCommandResolver.cs | 1 + .../CommandResolution/OutputPathCommandResolver.cs | 1 + .../CommandResolution/PackagedCommandSpecFactory.cs | 1 + .../CommandResolution/ProjectDependenciesCommandResolver.cs | 1 + .../CommandResolution/ProjectPathCommandResolver.cs | 1 + .../CommandResolution/ProjectToolsCommandResolver.cs | 1 + .../CommandResolution/PublishedPathCommandResolver.cs | 1 + .../CommandFactory/CommandResolution/RootedCommandResolver.cs | 1 + src/Cli/dotnet/Installer/Windows/InstallerBase.cs | 2 +- .../ProcessExtensionsTests.cs | 1 + 23 files changed, 21 insertions(+), 6 deletions(-) rename src/Cli/Microsoft.DotNet.Cli.Utils/{ => Extensions}/AnsiExtensions.cs (100%) rename src/Cli/Microsoft.DotNet.Cli.Utils/{ => Extensions}/ExceptionExtensions.cs (100%) rename src/Cli/Microsoft.DotNet.Cli.Utils/{ => Extensions}/MSBuildProjectExtensions.cs (100%) rename src/Cli/Microsoft.DotNet.Cli.Utils/{ => Extensions}/ProcessStartInfoExtensions.cs (100%) diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs index 3a82aeae8b15..11d823755e86 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.DotNet.Cli.Utils.Extensions; + namespace Microsoft.DotNet.Cli.Utils { public class EnvironmentProvider : IEnvironmentProvider diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/AnsiExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs similarity index 100% rename from src/Cli/Microsoft.DotNet.Cli.Utils/AnsiExtensions.cs rename to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs index 763b3f34c8f6..611a8fb08a44 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { public static class CollectionsExtensions { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs similarity index 100% rename from src/Cli/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs rename to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs index ba6e91278ca3..8c9f7e5affd4 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs @@ -5,9 +5,9 @@ using NuGet.Packaging; using NuGet.ProjectModel; -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { - static class LockFileExtensions + internal static class LockFileExtensions { public static string GetPackageDirectory(this LockFile lockFile, LockFileTargetLibrary library) { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs index bdde214d1845..c4f1241a8081 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs @@ -4,7 +4,7 @@ using NuGet.Common; using NuGet.ProjectModel; -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { public static class LockFileFormatExtensions { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildProjectExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs similarity index 100% rename from src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildProjectExtensions.cs rename to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessExtensions.cs index dd849efe6fca..10e9e74c4377 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessExtensions.cs @@ -5,7 +5,7 @@ using System.Runtime.Versioning; using Microsoft.Win32.SafeHandles; -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { /// /// Extensions methods for components. diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/ProcessStartInfoExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs similarity index 100% rename from src/Cli/Microsoft.DotNet.Cli.Utils/ProcessStartInfoExtensions.cs rename to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/AbstractPathBasedCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/AbstractPathBasedCommandResolver.cs index 24d150743e58..f312b2597632 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/AbstractPathBasedCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/AbstractPathBasedCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.CommandFactory { diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseDllCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseDllCommandResolver.cs index 08660ae2cf86..fc3c0d031358 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseDllCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseDllCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.CommandFactory { diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/DepsJsonCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/DepsJsonCommandResolver.cs index fd5a6364f980..8ab3dbae4677 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/DepsJsonCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/DepsJsonCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools.Common; using Microsoft.Extensions.DependencyModel; diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/MSBuildProject.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/MSBuildProject.cs index 65d77cab2fe5..67b9c506de6b 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/MSBuildProject.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/MSBuildProject.cs @@ -3,6 +3,7 @@ using Microsoft.Build.Evaluation; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using NuGet.Frameworks; using NuGet.ProjectModel; diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandResolver.cs index a9a63f9120f2..fb00c4ccd459 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.CommandFactory { diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/OutputPathCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/OutputPathCommandResolver.cs index 3f7674cebdbb..21c1dd3ff8df 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/OutputPathCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/OutputPathCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using NuGet.Frameworks; namespace Microsoft.DotNet.CommandFactory diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/PackagedCommandSpecFactory.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/PackagedCommandSpecFactory.cs index 66e7ecda076a..f944042e77da 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/PackagedCommandSpecFactory.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/PackagedCommandSpecFactory.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools.Common; using NuGet.ProjectModel; diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectDependenciesCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectDependenciesCommandResolver.cs index cfcfbd28ed94..67196527f603 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectDependenciesCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectDependenciesCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using NuGet.Frameworks; using NuGet.ProjectModel; diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectPathCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectPathCommandResolver.cs index a6b1d8e162cf..c6a12ec34e01 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectPathCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectPathCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.CommandFactory { diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectToolsCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectToolsCommandResolver.cs index 16962233b2a1..79dd5a0847d7 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectToolsCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectToolsCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using NuGet.Frameworks; using NuGet.ProjectModel; using NuGet.Versioning; diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/PublishedPathCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/PublishedPathCommandResolver.cs index 6014b0f3746c..221a6fea7d9a 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/PublishedPathCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/PublishedPathCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.CommandFactory { diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/RootedCommandResolver.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/RootedCommandResolver.cs index c06dd86a8297..dc110e4badf8 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/RootedCommandResolver.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/RootedCommandResolver.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.CommandFactory { diff --git a/src/Cli/dotnet/Installer/Windows/InstallerBase.cs b/src/Cli/dotnet/Installer/Windows/InstallerBase.cs index 6ac423a25ea6..ceb56a9be64e 100644 --- a/src/Cli/dotnet/Installer/Windows/InstallerBase.cs +++ b/src/Cli/dotnet/Installer/Windows/InstallerBase.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Reflection; using System.Runtime.Versioning; -using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Workloads.Workload; using Microsoft.Win32.Msi; diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/ProcessExtensionsTests.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/ProcessExtensionsTests.cs index 68fd915050c7..ceced63a4929 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/ProcessExtensionsTests.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/ProcessExtensionsTests.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Runtime.Versioning; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Cli.Utils.Tests { From 871c0c46e86dc58d288ca2e2ede088f7160dfd3c Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 7 Mar 2025 16:40:38 -0800 Subject: [PATCH 2/6] All the Extensions classes are moved to the Extensions namespace. --- src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs | 1 + .../Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs | 2 +- .../Extensions/ExceptionExtensions.cs | 2 +- .../Extensions/MSBuildProjectExtensions.cs | 4 ++-- .../Extensions/ProcessStartInfoExtensions.cs | 2 +- .../Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs | 1 + src/Cli/Microsoft.DotNet.Cli.Utils/GracefulException.cs | 2 ++ .../MSBuildForwardingAppWithoutLogging.cs | 1 + .../Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs | 2 +- src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs | 1 + .../Commands/create/InstantiateCommand.NoMatchHandling.cs | 1 + .../Commands/create/InstantiateCommand.cs | 1 + src/Cli/Microsoft.TemplateEngine.Cli/PostActionDispatcher.cs | 1 + .../InstructionDisplayPostActionProcessor.cs | 1 + src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs | 1 + .../Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs | 1 + .../TemplatePackageCoordinator.cs | 1 + .../Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs | 1 + .../TemplateSearch/CliTemplateSearchCoordinator.cs | 1 + src/Cli/dotnet/BuildServer/BuildServerProvider.cs | 1 + .../dotnet/CommandFactory/CommandResolution/ProjectFactory.cs | 1 + src/Cli/dotnet/MsbuildProject.cs | 1 + src/Cli/dotnet/ParseResultExtensions.cs | 1 + src/Cli/dotnet/Parser.cs | 1 + src/Cli/dotnet/Program.cs | 1 + src/Cli/dotnet/ShellShim/WindowsEnvironmentPath.cs | 1 + src/Cli/dotnet/Telemetry/MacAddressGetter.cs | 2 +- .../dotnet-buildserver/shutdown/BuildServerShutdownCommand.cs | 1 + src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs | 1 + .../dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs | 1 + src/Cli/dotnet/commands/dotnet-run/Program.cs | 1 + src/Cli/dotnet/commands/dotnet-run/RunCommand.cs | 1 + .../dotnet/commands/dotnet-tool/install/ProjectRestorer.cs | 1 + .../dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs | 1 + .../commands/dotnet-tool/install/ToolInstallLocalCommand.cs | 1 + .../dotnet-tool/list/ToolListGlobalOrToolPathCommand.cs | 1 + .../dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs | 1 + .../dotnet/commands/dotnet-tool/search/SearchResultPrinter.cs | 1 + .../uninstall/ToolUninstallGlobalOrToolPathCommand.cs | 1 + .../dotnet-tool/uninstall/ToolUninstallLocalCommand.cs | 1 + .../commands/dotnet-workload/clean/WorkloadCleanCommand.cs | 1 + .../dotnet-workload/install/NetSdkMsiInstallerClient.cs | 1 + .../dotnet-workload/install/WorkloadInstallCommand.cs | 1 + .../dotnet-workload/install/WorkloadManifestUpdater.cs | 1 + .../ShellShimRepositoryTests.cs | 1 + test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs | 2 +- .../dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs | 1 + .../CommandTests/BuildServerShutdownCommandTests.cs | 2 +- .../CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs | 1 + .../dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs | 1 + .../CommandTests/ToolListGlobalOrToolPathCommandTests.cs | 1 + test/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs | 1 + .../CommandTests/ToolUninstallLocalCommandTests.cs | 1 + test/dotnet.Tests/CommandTests/ToolUpdateLocalCommandTests.cs | 1 + 54 files changed, 56 insertions(+), 9 deletions(-) diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs index fd634c174ad6..c216d4acaede 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Cli.Utils { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs index 05ce734a1536..be65fa03d7d7 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { public static class AnsiExtensions { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs index 1586b2d06741..ca35c9c786be 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { internal static class ExceptionExtensions { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs index d22d032ad4f8..ed50af97ab4f 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs @@ -4,7 +4,7 @@ using Microsoft.Build.Construction; using Microsoft.DotNet.Tools.Common; -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { internal static class MSBuildProjectExtensions { @@ -47,7 +47,7 @@ public static ISet ConditionChain(this ProjectElement projectElement) public static ProjectItemGroupElement FindUniformOrCreateItemGroupWithCondition(this ProjectRootElement root, string projectItemElementType, string framework) { - var lastMatchingItemGroup = FindExistingUniformItemGroupWithCondition(root, projectItemElementType, framework); + var lastMatchingItemGroup = root.FindExistingUniformItemGroupWithCondition(projectItemElementType, framework); if (lastMatchingItemGroup != null) { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs index e1dfa7b71203..31d66252ac81 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs @@ -3,7 +3,7 @@ using System.Diagnostics; -namespace Microsoft.DotNet.Cli.Utils +namespace Microsoft.DotNet.Cli.Utils.Extensions { internal static class ProcessStartInfoExtensions { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs index 13429fd8c663..0ec2dfbea6b5 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs @@ -4,6 +4,7 @@ #if NET using System.Diagnostics; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Cli.Utils { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/GracefulException.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/GracefulException.cs index f7baa03a7701..6b7bbfc13a65 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/GracefulException.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/GracefulException.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.DotNet.Cli.Utils.Extensions; + namespace Microsoft.DotNet.Cli.Utils { public class GracefulException : Exception diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs index 36515612598d..cf4df631d8b4 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Cli.Utils { diff --git a/src/Cli/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs b/src/Cli/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs index 705ee86a2ab3..47a36788f5c0 100644 --- a/src/Cli/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs +++ b/src/Cli/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using NuGet.Common; namespace Microsoft.DotNet.Configurer diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs index cd0107dc0b95..1eafc78d68c0 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs @@ -6,6 +6,7 @@ using System.CommandLine.Invocation; using System.Reflection; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.Mount; using Microsoft.TemplateEngine.Cli.TabularOutput; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.NoMatchHandling.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.NoMatchHandling.cs index 4f5800491918..59e07fba086f 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.NoMatchHandling.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.NoMatchHandling.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Edge.Settings; using Command = System.CommandLine.CliCommand; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs index af4b5ddb7362..c77c42e53532 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.Extensions.Logging; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.TemplatePackage; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/PostActionDispatcher.cs b/src/Cli/Microsoft.TemplateEngine.Cli/PostActionDispatcher.cs index 67ffeb7b3f97..c6f113525312 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/PostActionDispatcher.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/PostActionDispatcher.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Cli.PostActionProcessors; using Microsoft.TemplateEngine.Edge.Template; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/PostActionProcessors/InstructionDisplayPostActionProcessor.cs b/src/Cli/Microsoft.TemplateEngine.Cli/PostActionProcessors/InstructionDisplayPostActionProcessor.cs index df69b59ba132..2e57e4b0f9a2 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/PostActionProcessors/InstructionDisplayPostActionProcessor.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/PostActionProcessors/InstructionDisplayPostActionProcessor.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; namespace Microsoft.TemplateEngine.Cli.PostActionProcessors diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs index aadf9c2f8f7f..581ba2892234 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs @@ -3,6 +3,7 @@ using System.Text.RegularExpressions; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.TemplatePackage; using Microsoft.TemplateEngine.Cli.Commands; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs index 3156f196b63a..4f725fb268ff 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Cli.Commands; using Microsoft.TemplateEngine.Cli.TabularOutput; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs index 559f6f0fb5c4..ec8e545b4163 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools.Common; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.Constraints; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs index 00d5ca56a413..b0e29d105681 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.Constraints; using Microsoft.TemplateEngine.Abstractions.Installer; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs index b800dc2ce44c..10ad1d373850 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.TemplatePackage; using Microsoft.TemplateEngine.Cli.Commands; diff --git a/src/Cli/dotnet/BuildServer/BuildServerProvider.cs b/src/Cli/dotnet/BuildServer/BuildServerProvider.cs index 20b7884d30df..a7d9bde4a28f 100644 --- a/src/Cli/dotnet/BuildServer/BuildServerProvider.cs +++ b/src/Cli/dotnet/BuildServer/BuildServerProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Configurer; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectFactory.cs b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectFactory.cs index 64fe89e2bf09..7919fe4c5305 100644 --- a/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectFactory.cs +++ b/src/Cli/dotnet/CommandFactory/CommandResolution/ProjectFactory.cs @@ -3,6 +3,7 @@ using Microsoft.Build.Exceptions; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using NuGet.Frameworks; namespace Microsoft.DotNet.CommandFactory diff --git a/src/Cli/dotnet/MsbuildProject.cs b/src/Cli/dotnet/MsbuildProject.cs index efb7a245cdd4..847c811f58f8 100644 --- a/src/Cli/dotnet/MsbuildProject.cs +++ b/src/Cli/dotnet/MsbuildProject.cs @@ -7,6 +7,7 @@ using Microsoft.Build.Framework; using Microsoft.Build.Logging; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools.Common; using Microsoft.DotNet.Tools.ProjectExtensions; using NuGet.Frameworks; diff --git a/src/Cli/dotnet/ParseResultExtensions.cs b/src/Cli/dotnet/ParseResultExtensions.cs index faac5cb2ed1f..aec1323d526d 100644 --- a/src/Cli/dotnet/ParseResultExtensions.cs +++ b/src/Cli/dotnet/ParseResultExtensions.cs @@ -7,6 +7,7 @@ using System.Reflection; using System.Text.RegularExpressions; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using static Microsoft.DotNet.Cli.Parser; using CommandResult = System.CommandLine.Parsing.CommandResult; diff --git a/src/Cli/dotnet/Parser.cs b/src/Cli/dotnet/Parser.cs index f8a180036f54..8e2a5bd623f0 100644 --- a/src/Cli/dotnet/Parser.cs +++ b/src/Cli/dotnet/Parser.cs @@ -6,6 +6,7 @@ using System.CommandLine.Help; using System.Reflection; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Format; using Microsoft.DotNet.Tools.Help; diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs index 0a9872974ab6..668cdaffce77 100644 --- a/src/Cli/dotnet/Program.cs +++ b/src/Cli/dotnet/Program.cs @@ -13,6 +13,7 @@ using CommandResult = System.CommandLine.Parsing.CommandResult; using LocalizableStrings = Microsoft.DotNet.Cli.Utils.LocalizableStrings; using Microsoft.DotNet.Workloads.Workload; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/ShellShim/WindowsEnvironmentPath.cs b/src/Cli/dotnet/ShellShim/WindowsEnvironmentPath.cs index 805a3a4b126b..daefa2301bf2 100644 --- a/src/Cli/dotnet/ShellShim/WindowsEnvironmentPath.cs +++ b/src/Cli/dotnet/ShellShim/WindowsEnvironmentPath.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools; namespace Microsoft.DotNet.ShellShim diff --git a/src/Cli/dotnet/Telemetry/MacAddressGetter.cs b/src/Cli/dotnet/Telemetry/MacAddressGetter.cs index 642e2c41ed6e..b40c573d5d50 100644 --- a/src/Cli/dotnet/Telemetry/MacAddressGetter.cs +++ b/src/Cli/dotnet/Telemetry/MacAddressGetter.cs @@ -6,7 +6,7 @@ using System.IO; using System.Net.NetworkInformation; using System.Text.RegularExpressions; -using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Cli.Telemetry { diff --git a/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommand.cs b/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommand.cs index 046abc644608..7ab199003c63 100644 --- a/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-buildserver/shutdown/BuildServerShutdownCommand.cs @@ -5,6 +5,7 @@ using Microsoft.DotNet.BuildServer; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Tools.BuildServer.Shutdown { diff --git a/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs b/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs index 0c9d420c6db3..dbd0731aad2f 100644 --- a/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Cli.Commands; using NuGetDocumentedCommand = NuGet.CommandLine.XPlat.Commands.DocumentedCommand; diff --git a/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index 6e8e681db237..46f2bd5ef9e2 100644 --- a/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -6,6 +6,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Telemetry; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Tools.MSBuild { diff --git a/src/Cli/dotnet/commands/dotnet-run/Program.cs b/src/Cli/dotnet/commands/dotnet-run/Program.cs index 1dee09851a17..3f0ebd25922c 100644 --- a/src/Cli/dotnet/commands/dotnet-run/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-run/Program.cs @@ -5,6 +5,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tools.Run diff --git a/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs b/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs index e9598d7b1643..6a0bc7f6839d 100644 --- a/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs @@ -9,6 +9,7 @@ using Microsoft.Build.Logging; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.CommandFactory; using Microsoft.DotNet.Tools.Run.LaunchSettings; diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs index 103349f8e8ed..c4e21223284d 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ProjectRestorer.cs @@ -3,6 +3,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolPackage; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs index 324c5f220096..dea3f0a65e26 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs @@ -17,6 +17,7 @@ using NuGet.Frameworks; using NuGet.Versioning; using Microsoft.DotNet.Tools.Tool.List; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Tools.Tool.Install { diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs index a51ff1f196c7..e1d909c3a425 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs @@ -6,6 +6,7 @@ using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tool.Common; diff --git a/src/Cli/dotnet/commands/dotnet-tool/list/ToolListGlobalOrToolPathCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/list/ToolListGlobalOrToolPathCommand.cs index 0e2aa17def47..a468a81a382b 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/list/ToolListGlobalOrToolPathCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/list/ToolListGlobalOrToolPathCommand.cs @@ -4,6 +4,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolPackage; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs index 87215e4fb9e9..7608b520ff02 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs @@ -6,6 +6,7 @@ using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/src/Cli/dotnet/commands/dotnet-tool/search/SearchResultPrinter.cs b/src/Cli/dotnet/commands/dotnet-tool/search/SearchResultPrinter.cs index 10e0e0315bbf..45ddc1181331 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/search/SearchResultPrinter.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/search/SearchResultPrinter.cs @@ -3,6 +3,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Tools.Tool.Search { diff --git a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallGlobalOrToolPathCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallGlobalOrToolPathCommand.cs index 1b5129c8d84e..3bea984636e9 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallGlobalOrToolPathCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallGlobalOrToolPathCommand.cs @@ -5,6 +5,7 @@ using System.Transactions; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ShellShim; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tool.Common; diff --git a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallLocalCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallLocalCommand.cs index 26ea03add7f5..58c69f14414a 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallLocalCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallLocalCommand.cs @@ -4,6 +4,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tool.Common; diff --git a/src/Cli/dotnet/commands/dotnet-workload/clean/WorkloadCleanCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/clean/WorkloadCleanCommand.cs index 605771ebd18b..b0f4a04afbb7 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/clean/WorkloadCleanCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/clean/WorkloadCleanCommand.cs @@ -5,6 +5,7 @@ using Microsoft.Deployment.DotNet.Releases; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Installer.Windows; using Microsoft.DotNet.Workloads.Workload.Install; using Microsoft.DotNet.Workloads.Workload.List; diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs b/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs index 75c944e24ea4..8792c45a8604 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs @@ -9,6 +9,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Installer.Windows; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Workloads.Workload.History; diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs index 61b707bf36a3..ff789e9ce93f 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs @@ -6,6 +6,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolPackage; using Microsoft.Extensions.EnvironmentAbstractions; using Microsoft.NET.Sdk.WorkloadManifestReader; diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs index fe21f4407497..b28cc90e7afa 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs @@ -5,6 +5,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Configurer; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Workloads.Workload.History; diff --git a/test/Microsoft.DotNet.ShellShim.Tests/ShellShimRepositoryTests.cs b/test/Microsoft.DotNet.ShellShim.Tests/ShellShimRepositoryTests.cs index e7327a93b75e..624ab361f5a5 100644 --- a/test/Microsoft.DotNet.ShellShim.Tests/ShellShimRepositoryTests.cs +++ b/test/Microsoft.DotNet.ShellShim.Tests/ShellShimRepositoryTests.cs @@ -8,6 +8,7 @@ using System.Transactions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Tests.ComponentMocks; diff --git a/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs b/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs index d63d4d814e33..0295b02a35d9 100644 --- a/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs +++ b/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.Build.Construction; -using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Msbuild.Tests.Utilities { diff --git a/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs b/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs index 218a1eb81aa0..01a3f290cadd 100644 --- a/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs +++ b/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs @@ -5,6 +5,7 @@ using Microsoft.DotNet.BuildServer; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Configurer; using Microsoft.Extensions.DependencyModel.Tests; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs b/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs index 7cc65ac1d359..c368b8ce933c 100644 --- a/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs @@ -5,7 +5,7 @@ using System.CommandLine; using Microsoft.DotNet.BuildServer; -using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.Extensions.EnvironmentAbstractions; using Moq; diff --git a/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs index c858cca000eb..c2458f66ccf6 100644 --- a/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs @@ -8,6 +8,7 @@ using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ShellShim; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools; diff --git a/test/dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs index da3fefe4098c..38e2b1aa4a8a 100644 --- a/test/dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs @@ -7,6 +7,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tests.ComponentMocks; diff --git a/test/dotnet.Tests/CommandTests/ToolListGlobalOrToolPathCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolListGlobalOrToolPathCommandTests.cs index d7e16c1af9ca..7802119fba69 100644 --- a/test/dotnet.Tests/CommandTests/ToolListGlobalOrToolPathCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolListGlobalOrToolPathCommandTests.cs @@ -5,6 +5,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tool.List; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/test/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs index f5bcf9b36b48..814c6aebd7f6 100644 --- a/test/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs @@ -23,6 +23,7 @@ using Microsoft.DotNet.Cli.ToolPackage; using System.Reflection; using System.Text.Json; +using Microsoft.DotNet.Cli.Utils.Extensions; namespace Microsoft.DotNet.Tests.Commands.Tool { diff --git a/test/dotnet.Tests/CommandTests/ToolUninstallLocalCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolUninstallLocalCommandTests.cs index 01d05244db3b..384f5dca1d44 100644 --- a/test/dotnet.Tests/CommandTests/ToolUninstallLocalCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolUninstallLocalCommandTests.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tool.Uninstall; diff --git a/test/dotnet.Tests/CommandTests/ToolUpdateLocalCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolUpdateLocalCommandTests.cs index c96c40436155..2db91fecf9e5 100644 --- a/test/dotnet.Tests/CommandTests/ToolUpdateLocalCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolUpdateLocalCommandTests.cs @@ -6,6 +6,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tests.ComponentMocks; From e4e0ea583d66075341c5c72114bd0cebd9188f1c Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 7 Mar 2025 16:51:13 -0800 Subject: [PATCH 3/6] Moved top-level Extension methods for the dotnet project into an Extensions folder. --- src/Cli/dotnet/{ => Extensions}/CommonOptionsExtension.cs | 0 src/Cli/dotnet/{ => Extensions}/OptionForwardingExtensions.cs | 0 src/Cli/dotnet/{ => Extensions}/ParseResultExtensions.cs | 0 src/Cli/dotnet/{ => Extensions}/ParserExtensions.cs | 0 src/Cli/dotnet/{ => Extensions}/ProjectExtensions.cs | 0 src/Cli/dotnet/{ => Extensions}/ProjectInstanceExtensions.cs | 0 src/Cli/dotnet/{ => Extensions}/ProjectRootElementExtensions.cs | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename src/Cli/dotnet/{ => Extensions}/CommonOptionsExtension.cs (100%) rename src/Cli/dotnet/{ => Extensions}/OptionForwardingExtensions.cs (100%) rename src/Cli/dotnet/{ => Extensions}/ParseResultExtensions.cs (100%) rename src/Cli/dotnet/{ => Extensions}/ParserExtensions.cs (100%) rename src/Cli/dotnet/{ => Extensions}/ProjectExtensions.cs (100%) rename src/Cli/dotnet/{ => Extensions}/ProjectInstanceExtensions.cs (100%) rename src/Cli/dotnet/{ => Extensions}/ProjectRootElementExtensions.cs (100%) diff --git a/src/Cli/dotnet/CommonOptionsExtension.cs b/src/Cli/dotnet/Extensions/CommonOptionsExtension.cs similarity index 100% rename from src/Cli/dotnet/CommonOptionsExtension.cs rename to src/Cli/dotnet/Extensions/CommonOptionsExtension.cs diff --git a/src/Cli/dotnet/OptionForwardingExtensions.cs b/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs similarity index 100% rename from src/Cli/dotnet/OptionForwardingExtensions.cs rename to src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs diff --git a/src/Cli/dotnet/ParseResultExtensions.cs b/src/Cli/dotnet/Extensions/ParseResultExtensions.cs similarity index 100% rename from src/Cli/dotnet/ParseResultExtensions.cs rename to src/Cli/dotnet/Extensions/ParseResultExtensions.cs diff --git a/src/Cli/dotnet/ParserExtensions.cs b/src/Cli/dotnet/Extensions/ParserExtensions.cs similarity index 100% rename from src/Cli/dotnet/ParserExtensions.cs rename to src/Cli/dotnet/Extensions/ParserExtensions.cs diff --git a/src/Cli/dotnet/ProjectExtensions.cs b/src/Cli/dotnet/Extensions/ProjectExtensions.cs similarity index 100% rename from src/Cli/dotnet/ProjectExtensions.cs rename to src/Cli/dotnet/Extensions/ProjectExtensions.cs diff --git a/src/Cli/dotnet/ProjectInstanceExtensions.cs b/src/Cli/dotnet/Extensions/ProjectInstanceExtensions.cs similarity index 100% rename from src/Cli/dotnet/ProjectInstanceExtensions.cs rename to src/Cli/dotnet/Extensions/ProjectInstanceExtensions.cs diff --git a/src/Cli/dotnet/ProjectRootElementExtensions.cs b/src/Cli/dotnet/Extensions/ProjectRootElementExtensions.cs similarity index 100% rename from src/Cli/dotnet/ProjectRootElementExtensions.cs rename to src/Cli/dotnet/Extensions/ProjectRootElementExtensions.cs From 21a79a39c0d506c83c458238cf6ea9b0e5df3fec Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 7 Mar 2025 16:54:54 -0800 Subject: [PATCH 4/6] Renamed class CommonOptionsExtension to CommonOptionsExtensions. Updated Extensions namespace for all Extension classes. --- src/BuiltInTools/dotnet-watch/CommandLineOptions.cs | 1 + src/Cli/dotnet/CommandBase.cs | 1 + src/Cli/dotnet/CommonOptions.cs | 1 + src/Cli/dotnet/Extensions/CommonOptionsExtension.cs | 4 ++-- .../dotnet/Extensions/OptionForwardingExtensions.cs | 12 ++++++------ src/Cli/dotnet/Extensions/ParseResultExtensions.cs | 5 ++--- src/Cli/dotnet/Extensions/ParserExtensions.cs | 2 +- src/Cli/dotnet/Extensions/ProjectExtensions.cs | 2 +- .../dotnet/Extensions/ProjectInstanceExtensions.cs | 2 +- .../Extensions/ProjectRootElementExtensions.cs | 2 +- src/Cli/dotnet/MsbuildProject.cs | 2 +- src/Cli/dotnet/Parser.cs | 1 + src/Cli/dotnet/Program.cs | 1 + src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs | 1 + .../Telemetry/AllowListToSendFirstAppliedOptions.cs | 1 + .../AllowListToSendVerbSecondVerbFirstArgument.cs | 1 + src/Cli/dotnet/Telemetry/TelemetryFilter.cs | 1 + .../Telemetry/TopLevelCommandNameAndOptionToLog.cs | 1 + src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs | 1 + src/Cli/dotnet/commands/InstallingWorkloadCommand.cs | 1 + .../dotnet/commands/dotnet-add/AddCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-build/BuildCommand.cs | 1 + .../commands/dotnet-build/BuildCommandParser.cs | 1 + .../dotnet-buildserver/BuildServerCommandParser.cs | 1 + .../commands/dotnet-clean/CleanCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-clean/Program.cs | 1 + .../commands/dotnet-complete/CompleteCommand.cs | 1 + .../dotnet/commands/dotnet-complete/ParseCommand.cs | 1 + .../dotnet/commands/dotnet-format/FormatCommand.cs | 1 + src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs | 1 + .../InternalReportinstallsuccessCommand.cs | 1 + .../dotnet/commands/dotnet-list/ListCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-msbuild/Program.cs | 1 + .../dotnet/commands/dotnet-new/NewCommandParser.cs | 1 + .../commands/dotnet-nuget/NuGetCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-nuget/Program.cs | 1 + src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs | 1 + .../dotnet/commands/dotnet-pack/PackCommandParser.cs | 1 + .../commands/dotnet-package/PackageCommandParser.cs | 1 + .../dotnet-package/add/PackageAddCommandParser.cs | 1 + .../dotnet/commands/dotnet-package/add/Program.cs | 1 + .../list/ListPackageReferencesCommand.cs | 1 + .../dotnet-package/list/PackageListCommandParser.cs | 1 + .../remove/PackageRemoveCommandParser.cs | 1 + .../dotnet/commands/dotnet-package/remove/Program.cs | 1 + .../dotnet-package/search/PackageSearchCommand.cs | 1 + .../search/PackageSearchCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-publish/Program.cs | 1 + .../commands/dotnet-publish/PublishCommandParser.cs | 1 + .../dotnet-reference/ReferenceCommandParser.cs | 1 + .../dotnet-reference/dotnet-reference-add/Program.cs | 1 + .../ListProjectToProjectReferencesCommand.cs | 1 + .../dotnet-reference-remove/Program.cs | 1 + .../commands/dotnet-remove/RemoveCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-restore/Program.cs | 1 + .../commands/dotnet-restore/RestoreCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-run/Program.cs | 1 + src/Cli/dotnet/commands/dotnet-run/RunCommand.cs | 1 + .../dotnet/commands/dotnet-run/RunCommandParser.cs | 1 + .../dotnet/commands/dotnet-sdk/SdkCommandParser.cs | 1 + .../dotnet/commands/dotnet-sln/SlnCommandParser.cs | 1 + src/Cli/dotnet/commands/dotnet-sln/add/Program.cs | 1 + src/Cli/dotnet/commands/dotnet-store/Program.cs | 1 + .../commands/dotnet-store/StoreCommandParser.cs | 1 + .../dotnet/commands/dotnet-test/MSBuildUtility.cs | 1 + src/Cli/dotnet/commands/dotnet-test/Program.cs | 1 + .../dotnet/commands/dotnet-test/TestCommandParser.cs | 1 + .../commands/dotnet-test/TestModulesFilterHandler.cs | 1 + .../commands/dotnet-test/TestingPlatformCommand.cs | 1 + .../commands/dotnet-test/TestingPlatformOptions.cs | 1 + .../dotnet/commands/dotnet-tool/ToolCommandParser.cs | 1 + .../ToolCommandRestorePassThroughOptions.cs | 1 + .../dotnet-tool/install/ToolInstallCommandParser.cs | 1 + .../install/ToolInstallGlobalOrToolPathCommand.cs | 1 + .../dotnet-tool/install/ToolInstallLocalInstaller.cs | 1 + .../dotnet-tool/list/ToolListCommandParser.cs | 1 + .../dotnet-tool/restore/ToolRestoreCommand.cs | 1 + .../dotnet-tool/restore/ToolRestoreCommandParser.cs | 1 + .../uninstall/ToolUninstallCommandParser.cs | 1 + .../dotnet-tool/update/ToolUpdateLocalCommand.cs | 1 + src/Cli/dotnet/commands/dotnet-vstest/Program.cs | 1 + .../commands/dotnet-workload/WorkloadCommandBase.cs | 1 + ...WorkloadCommandNuGetRestoreActionConfigOptions.cs | 1 + .../dotnet-workload/WorkloadCommandParser.cs | 1 + .../dotnet-workload/config/WorkloadConfigCommand.cs | 1 + .../dotnet-workload/install/FileBasedInstaller.cs | 1 + .../install/WorkloadInstallCommand.cs | 1 + .../dotnet-workload/list/WorkloadListCommand.cs | 1 + .../list/WorkloadListCommandParser.cs | 1 + .../restore/WorkloadRestoreCommand.cs | 1 + .../search/WorkloadSearchVersionsCommand.cs | 1 + .../ParserTests/InstallToolParserTests.cs | 1 + .../ParserTests/ListPackageParserTests.cs | 1 + .../MSBuildArgumentCommandLineParserTests.cs | 1 + .../ParserTests/NuGetCommandParserTests.cs | 2 +- .../ParserTests/ParseResultExtensionsTests.cs | 2 +- test/dotnet.Tests/ParserTests/RestoreParserTests.cs | 1 + .../ParserTests/ToolRestoreParserTests.cs | 1 + test/dotnet.Tests/ParserTests/ToolRunParserTests.cs | 1 + .../ParserTests/UpdateToolParserTests.cs | 1 + 100 files changed, 107 insertions(+), 18 deletions(-) diff --git a/src/BuiltInTools/dotnet-watch/CommandLineOptions.cs b/src/BuiltInTools/dotnet-watch/CommandLineOptions.cs index 7441aaaa0496..aa80aa26aa11 100644 --- a/src/BuiltInTools/dotnet-watch/CommandLineOptions.cs +++ b/src/BuiltInTools/dotnet-watch/CommandLineOptions.cs @@ -8,6 +8,7 @@ using System.Data; using System.Diagnostics; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Run; using NuGet.Common; diff --git a/src/Cli/dotnet/CommandBase.cs b/src/Cli/dotnet/CommandBase.cs index 47cde6d8ff40..495c7bc4a115 100644 --- a/src/Cli/dotnet/CommandBase.cs +++ b/src/Cli/dotnet/CommandBase.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index aee8cb7f8d65..c65dd064d7f6 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -5,6 +5,7 @@ using System.CommandLine.Completions; using System.CommandLine.Parsing; using System.CommandLine.StaticCompletions; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Common; diff --git a/src/Cli/dotnet/Extensions/CommonOptionsExtension.cs b/src/Cli/dotnet/Extensions/CommonOptionsExtension.cs index 0cfeda1a45d8..a07a766e3484 100644 --- a/src/Cli/dotnet/Extensions/CommonOptionsExtension.cs +++ b/src/Cli/dotnet/Extensions/CommonOptionsExtension.cs @@ -4,9 +4,9 @@ using Microsoft.Build.Framework; using Microsoft.Extensions.Logging; -namespace Microsoft.DotNet.Cli +namespace Microsoft.DotNet.Cli.Extensions { - internal static class CommonOptionsExtension + internal static class CommonOptionsExtensions { public static LoggerVerbosity ToLoggerVerbosity(this VerbosityOptions verbosityOptions) { diff --git a/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs b/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs index 53b80c50931d..e3541bbba988 100644 --- a/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs +++ b/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs @@ -5,13 +5,13 @@ using System.CommandLine.Parsing; using System.CommandLine.StaticCompletions; -namespace Microsoft.DotNet.Cli +namespace Microsoft.DotNet.Cli.Extensions { public static class OptionForwardingExtensions { - public static ForwardedOption Forward(this ForwardedOption option) => option.SetForwardingFunction((T o) => new string[] { option.Name }); + public static ForwardedOption Forward(this ForwardedOption option) => option.SetForwardingFunction((o) => new string[] { option.Name }); - public static ForwardedOption ForwardAs(this ForwardedOption option, string value) => option.SetForwardingFunction((T o) => new string[] { value }); + public static ForwardedOption ForwardAs(this ForwardedOption option, string value) => option.SetForwardingFunction((o) => new string[] { value }); public static ForwardedOption ForwardAsSingle(this ForwardedOption option, Func format) => option.SetForwardingFunction(format); @@ -24,7 +24,7 @@ public static class OptionForwardingExtensions /// The option public static ForwardedOption ForwardAsOutputPath(this ForwardedOption option, string outputPropertyName, bool surroundWithDoubleQuotes = false) { - return option.SetForwardingFunction((string o) => + return option.SetForwardingFunction((o) => { string argVal = CommandDirectoryContext.GetFullPath(o); if (surroundWithDoubleQuotes) @@ -136,13 +136,13 @@ public ForwardedOption SetForwardingFunction(Func format) public ForwardedOption SetForwardingFunction(Func> func) { - ForwardingFunction = (ParseResult parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this), parseResult) : Array.Empty(); + ForwardingFunction = (parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this), parseResult) : Array.Empty(); return this; } public Func> GetForwardingFunction(Func> func) { - return (ParseResult parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this)) : Array.Empty(); + return (parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this)) : Array.Empty(); } public Func> GetForwardingFunction() diff --git a/src/Cli/dotnet/Extensions/ParseResultExtensions.cs b/src/Cli/dotnet/Extensions/ParseResultExtensions.cs index aec1323d526d..4928d58eedda 100644 --- a/src/Cli/dotnet/Extensions/ParseResultExtensions.cs +++ b/src/Cli/dotnet/Extensions/ParseResultExtensions.cs @@ -4,14 +4,13 @@ using System.CommandLine; using System.CommandLine.Parsing; using System.Diagnostics; -using System.Reflection; using System.Text.RegularExpressions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; using static Microsoft.DotNet.Cli.Parser; using CommandResult = System.CommandLine.Parsing.CommandResult; -namespace Microsoft.DotNet.Cli +namespace Microsoft.DotNet.Cli.Extensions { public static class ParseResultExtensions { @@ -104,7 +103,7 @@ public static bool CanBeInvoked(this ParseResult parseResult) { return GetBuiltInCommand(parseResult.RootSubCommandResult()) != null || parseResult.Tokens.Any(token => token.Type == CliTokenType.Directive) || - (parseResult.IsTopLevelDotnetCommand() && string.IsNullOrEmpty(parseResult.GetValue(DotnetSubCommand))); + parseResult.IsTopLevelDotnetCommand() && string.IsNullOrEmpty(parseResult.GetValue(DotnetSubCommand)); } public static int HandleMissingCommand(this ParseResult parseResult) diff --git a/src/Cli/dotnet/Extensions/ParserExtensions.cs b/src/Cli/dotnet/Extensions/ParserExtensions.cs index bc174b7e7d60..90b478734132 100644 --- a/src/Cli/dotnet/Extensions/ParserExtensions.cs +++ b/src/Cli/dotnet/Extensions/ParserExtensions.cs @@ -3,7 +3,7 @@ using System.CommandLine; -namespace Microsoft.DotNet.Cli +namespace Microsoft.DotNet.Cli.Extensions { public static class ParserExtensions { diff --git a/src/Cli/dotnet/Extensions/ProjectExtensions.cs b/src/Cli/dotnet/Extensions/ProjectExtensions.cs index b5330cfbe244..100848d93999 100644 --- a/src/Cli/dotnet/Extensions/ProjectExtensions.cs +++ b/src/Cli/dotnet/Extensions/ProjectExtensions.cs @@ -4,7 +4,7 @@ using Microsoft.Build.Evaluation; using NuGet.Frameworks; -namespace Microsoft.DotNet.Tools.ProjectExtensions +namespace Microsoft.DotNet.Cli.Extensions { internal static class ProjectExtensions { diff --git a/src/Cli/dotnet/Extensions/ProjectInstanceExtensions.cs b/src/Cli/dotnet/Extensions/ProjectInstanceExtensions.cs index eea4778316d3..4351cec626d5 100644 --- a/src/Cli/dotnet/Extensions/ProjectInstanceExtensions.cs +++ b/src/Cli/dotnet/Extensions/ProjectInstanceExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.Build.Execution; -namespace Microsoft.DotNet.Tools.Common +namespace Microsoft.DotNet.Cli.Extensions { public static class ProjectInstanceExtensions { diff --git a/src/Cli/dotnet/Extensions/ProjectRootElementExtensions.cs b/src/Cli/dotnet/Extensions/ProjectRootElementExtensions.cs index a557c787cf88..f74391843bf3 100644 --- a/src/Cli/dotnet/Extensions/ProjectRootElementExtensions.cs +++ b/src/Cli/dotnet/Extensions/ProjectRootElementExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.Build.Construction; -namespace Microsoft.DotNet.Tools.Common +namespace Microsoft.DotNet.Cli.Extensions { public static class ProjectRootElementExtensions { diff --git a/src/Cli/dotnet/MsbuildProject.cs b/src/Cli/dotnet/MsbuildProject.cs index 847c811f58f8..b2845091a88f 100644 --- a/src/Cli/dotnet/MsbuildProject.cs +++ b/src/Cli/dotnet/MsbuildProject.cs @@ -6,10 +6,10 @@ using Microsoft.Build.Exceptions; using Microsoft.Build.Framework; using Microsoft.Build.Logging; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.ProjectExtensions; using NuGet.Frameworks; namespace Microsoft.DotNet.Tools diff --git a/src/Cli/dotnet/Parser.cs b/src/Cli/dotnet/Parser.cs index 8e2a5bd623f0..b39fb3c76865 100644 --- a/src/Cli/dotnet/Parser.cs +++ b/src/Cli/dotnet/Parser.cs @@ -5,6 +5,7 @@ using System.CommandLine.Completions; using System.CommandLine.Help; using System.Reflection; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.Tools; diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs index 668cdaffce77..5bdecb67e930 100644 --- a/src/Cli/dotnet/Program.cs +++ b/src/Cli/dotnet/Program.cs @@ -14,6 +14,7 @@ using LocalizableStrings = Microsoft.DotNet.Cli.Utils.LocalizableStrings; using Microsoft.DotNet.Workloads.Workload; using Microsoft.DotNet.Cli.Utils.Extensions; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs b/src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs index 350fbf217891..3ab58ea34810 100644 --- a/src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs +++ b/src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Configurer; using NuGet.Common; diff --git a/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs b/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs index ad67fa4a7c7c..fc5843a8c001 100644 --- a/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs +++ b/src/Cli/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Cli.Telemetry diff --git a/src/Cli/dotnet/Telemetry/AllowListToSendVerbSecondVerbFirstArgument.cs b/src/Cli/dotnet/Telemetry/AllowListToSendVerbSecondVerbFirstArgument.cs index bebf4ee42223..6ef27fd3f064 100644 --- a/src/Cli/dotnet/Telemetry/AllowListToSendVerbSecondVerbFirstArgument.cs +++ b/src/Cli/dotnet/Telemetry/AllowListToSendVerbSecondVerbFirstArgument.cs @@ -3,6 +3,7 @@ using System.CommandLine; using System.CommandLine.Parsing; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Cli.Telemetry diff --git a/src/Cli/dotnet/Telemetry/TelemetryFilter.cs b/src/Cli/dotnet/Telemetry/TelemetryFilter.cs index d0990bd3652b..c5cf174d597b 100644 --- a/src/Cli/dotnet/Telemetry/TelemetryFilter.cs +++ b/src/Cli/dotnet/Telemetry/TelemetryFilter.cs @@ -3,6 +3,7 @@ using System.CommandLine; using System.Globalization; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Cli.Telemetry diff --git a/src/Cli/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs b/src/Cli/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs index 992f07aa325f..e32684989b97 100644 --- a/src/Cli/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs +++ b/src/Cli/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs @@ -3,6 +3,7 @@ using System.CommandLine; using System.CommandLine.Parsing; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; diff --git a/src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs b/src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs index d8ece8be26de..d46fae83a80f 100644 --- a/src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs +++ b/src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Reflection; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.ToolPackage; diff --git a/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs b/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs index c913c2038148..c0f7d68eb6fa 100644 --- a/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs +++ b/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs @@ -5,6 +5,7 @@ using Microsoft.Deployment.DotNet.Releases; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Commands.DotNetWorkloads; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.ToolPackage; diff --git a/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs b/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs index 9bfb6d7acc34..591630c3a8d9 100644 --- a/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-add/AddCommandParser.cs @@ -3,6 +3,7 @@ using System.CommandLine; using System.Diagnostics; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Add.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-build/BuildCommand.cs b/src/Cli/dotnet/commands/dotnet-build/BuildCommand.cs index 1e114e71786b..691f1d1881fc 100644 --- a/src/Cli/dotnet/commands/dotnet-build/BuildCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-build/BuildCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Tools.Build { diff --git a/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs b/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs index 9fabc1c33cd8..4b82f46ea0fe 100644 --- a/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Build; using LocalizableStrings = Microsoft.DotNet.Tools.Build.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs b/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs index ce249d2476db..7c52faa8a420 100644 --- a/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using LocalizableStrings = Microsoft.DotNet.Tools.BuildServer.LocalizableStrings; namespace Microsoft.DotNet.Cli diff --git a/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs b/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs index a46759e2fb73..03a55671b0a7 100644 --- a/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Clean; using LocalizableStrings = Microsoft.DotNet.Tools.Clean.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-clean/Program.cs b/src/Cli/dotnet/commands/dotnet-clean/Program.cs index 9163129f0637..a7ae1835eee6 100644 --- a/src/Cli/dotnet/commands/dotnet-clean/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-clean/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.MSBuild; namespace Microsoft.DotNet.Tools.Clean diff --git a/src/Cli/dotnet/commands/dotnet-complete/CompleteCommand.cs b/src/Cli/dotnet/commands/dotnet-complete/CompleteCommand.cs index 765b17ba2bc8..35b9856f81e2 100644 --- a/src/Cli/dotnet/commands/dotnet-complete/CompleteCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-complete/CompleteCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using System.CommandLine.Completions; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Cli diff --git a/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs b/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs index 4a324fb51e3d..66965764a289 100644 --- a/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs b/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs index 8f93537b72ff..bc090416d781 100644 --- a/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Tools.Format diff --git a/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs b/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs index dbd0731aad2f..0d164e7c4984 100644 --- a/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs @@ -4,6 +4,7 @@ using System.CommandLine; using System.Diagnostics; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.TemplateEngine.Cli.Commands; diff --git a/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs b/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs index 38faf36aaef3..55f060e4a169 100644 --- a/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Telemetry; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Configurer; diff --git a/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs index c2774866a037..186a3dd5be07 100644 --- a/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-list/ListCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.List.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs b/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs index eab68cea9f07..d73798f695be 100644 --- a/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Tools.MSBuild { diff --git a/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs b/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs index 0f9955f71f4e..7f4fcbda1d2e 100644 --- a/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs @@ -3,6 +3,7 @@ using System.CommandLine; using System.CommandLine.Parsing; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.New; diff --git a/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs b/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs index 28ba21c4a453..4230a7f34de4 100644 --- a/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.NuGet; namespace Microsoft.DotNet.Cli diff --git a/src/Cli/dotnet/commands/dotnet-nuget/Program.cs b/src/Cli/dotnet/commands/dotnet-nuget/Program.cs index 6b42ae738b12..33fed55febe6 100644 --- a/src/Cli/dotnet/commands/dotnet-nuget/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-nuget/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Tools.NuGet diff --git a/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs b/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs index 2ba99fe15d6a..6b110721f49c 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tools.Pack diff --git a/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs b/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs index 5666c4b9f065..ef97664f464a 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Pack; using LocalizableStrings = Microsoft.DotNet.Tools.Pack.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-package/PackageCommandParser.cs b/src/Cli/dotnet/commands/dotnet-package/PackageCommandParser.cs index 8824eb241aeb..67a8198227d9 100644 --- a/src/Cli/dotnet/commands/dotnet-package/PackageCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-package/PackageCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/commands/dotnet-package/add/PackageAddCommandParser.cs b/src/Cli/dotnet/commands/dotnet-package/add/PackageAddCommandParser.cs index 1da39fc4ba3a..3824a8442468 100644 --- a/src/Cli/dotnet/commands/dotnet-package/add/PackageAddCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-package/add/PackageAddCommandParser.cs @@ -8,6 +8,7 @@ using Microsoft.Extensions.EnvironmentAbstractions; using NuGet.Versioning; using Microsoft.DotNet.Tools.Package.Add; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/commands/dotnet-package/add/Program.cs b/src/Cli/dotnet/commands/dotnet-package/add/Program.cs index 7b2335837d21..92ce3dd62dea 100644 --- a/src/Cli/dotnet/commands/dotnet-package/add/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-package/add/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.MSBuild; diff --git a/src/Cli/dotnet/commands/dotnet-package/list/ListPackageReferencesCommand.cs b/src/Cli/dotnet/commands/dotnet-package/list/ListPackageReferencesCommand.cs index 4b9552f431c5..c07d808e49f5 100644 --- a/src/Cli/dotnet/commands/dotnet-package/list/ListPackageReferencesCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-package/list/ListPackageReferencesCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; using Microsoft.DotNet.Tools.NuGet; diff --git a/src/Cli/dotnet/commands/dotnet-package/list/PackageListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-package/list/PackageListCommandParser.cs index 453ddfe81eab..71a49f7633f8 100644 --- a/src/Cli/dotnet/commands/dotnet-package/list/PackageListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-package/list/PackageListCommandParser.cs @@ -5,6 +5,7 @@ using Microsoft.DotNet.Tools.Package.List; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Package.List.LocalizableStrings; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Cli { diff --git a/src/Cli/dotnet/commands/dotnet-package/remove/PackageRemoveCommandParser.cs b/src/Cli/dotnet/commands/dotnet-package/remove/PackageRemoveCommandParser.cs index 78566b1e292a..0f5c643af4b7 100644 --- a/src/Cli/dotnet/commands/dotnet-package/remove/PackageRemoveCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-package/remove/PackageRemoveCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Package.Remove; diff --git a/src/Cli/dotnet/commands/dotnet-package/remove/Program.cs b/src/Cli/dotnet/commands/dotnet-package/remove/Program.cs index 3cfed0274677..a8d340f2c9b4 100644 --- a/src/Cli/dotnet/commands/dotnet-package/remove/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-package/remove/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.NuGet; diff --git a/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommand.cs b/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommand.cs index f7a6d4800217..5937bf095606 100644 --- a/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommand.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.NuGet; using System.CommandLine; diff --git a/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommandParser.cs b/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommandParser.cs index 20cbd8024068..0dd91ad42099 100644 --- a/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-package/search/PackageSearchCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using LocalizableStrings = Microsoft.DotNet.Tools.Package.Search.LocalizableStrings; namespace Microsoft.DotNet.Cli diff --git a/src/Cli/dotnet/commands/dotnet-publish/Program.cs b/src/Cli/dotnet/commands/dotnet-publish/Program.cs index 51aca83a6f6d..1fdccf9f6b48 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-publish/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; diff --git a/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs index e23d66fdadc3..ad0a9b16e184 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Publish; using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-reference/ReferenceCommandParser.cs b/src/Cli/dotnet/commands/dotnet-reference/ReferenceCommandParser.cs index f37cc7c5c812..4370baadec42 100644 --- a/src/Cli/dotnet/commands/dotnet-reference/ReferenceCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-reference/ReferenceCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Remove.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-add/Program.cs b/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-add/Program.cs index 6c267a40aedc..8e31c38952cb 100644 --- a/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-add/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-add/Program.cs @@ -4,6 +4,7 @@ using System.CommandLine; using Microsoft.Build.Evaluation; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; using NuGet.Frameworks; diff --git a/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-list/ListProjectToProjectReferencesCommand.cs b/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-list/ListProjectToProjectReferencesCommand.cs index ad2e4e3596ff..9d1b7a027deb 100644 --- a/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-list/ListProjectToProjectReferencesCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-list/ListProjectToProjectReferencesCommand.cs @@ -4,6 +4,7 @@ using System.CommandLine; using Microsoft.Build.Evaluation; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Tools.Reference.List diff --git a/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-remove/Program.cs b/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-remove/Program.cs index 7c81cd45aa7b..ccc1f87d6d57 100644 --- a/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-remove/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-reference/dotnet-reference-remove/Program.cs @@ -4,6 +4,7 @@ using System.CommandLine; using Microsoft.Build.Evaluation; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; diff --git a/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs b/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs index 46a0ec110e05..4f8b611cb124 100644 --- a/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-remove/RemoveCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Remove.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-restore/Program.cs b/src/Cli/dotnet/commands/dotnet-restore/Program.cs index 2bb7e7fd0703..3319e848b26a 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-restore/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.MSBuild; using Parser = Microsoft.DotNet.Cli.Parser; diff --git a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index de55d4017d37..7000ce9c36d7 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Restore; using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-run/Program.cs b/src/Cli/dotnet/commands/dotnet-run/Program.cs index 3f0ebd25922c..4ff7859006ef 100644 --- a/src/Cli/dotnet/commands/dotnet-run/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-run/Program.cs @@ -4,6 +4,7 @@ using System.Collections.Immutable; using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; diff --git a/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs b/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs index 6a0bc7f6839d..d596c6a60714 100644 --- a/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-run/RunCommand.cs @@ -8,6 +8,7 @@ using Microsoft.Build.Framework; using Microsoft.Build.Logging; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; using Microsoft.DotNet.CommandFactory; diff --git a/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs b/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs index c8f5d09aab54..8656d87e290d 100644 --- a/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Run; using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs b/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs index 4222167d735d..17f725eca82e 100644 --- a/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-sdk/SdkCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Sdk.Check; using LocalizableStrings = Microsoft.DotNet.Tools.Sdk.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs b/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs index 0155ddd5e203..18233d798dc9 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/SlnCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; using Microsoft.VisualStudio.SolutionPersistence; diff --git a/src/Cli/dotnet/commands/dotnet-sln/add/Program.cs b/src/Cli/dotnet/commands/dotnet-sln/add/Program.cs index e6088fc41f1b..16f2a0ce7dbc 100644 --- a/src/Cli/dotnet/commands/dotnet-sln/add/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-sln/add/Program.cs @@ -7,6 +7,7 @@ using Microsoft.Build.Exceptions; using Microsoft.Build.Execution; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; using Microsoft.VisualStudio.SolutionPersistence; diff --git a/src/Cli/dotnet/commands/dotnet-store/Program.cs b/src/Cli/dotnet/commands/dotnet-store/Program.cs index 69c4a87983cb..300b27ce3b28 100644 --- a/src/Cli/dotnet/commands/dotnet-store/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-store/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.MSBuild; using Parser = Microsoft.DotNet.Cli.Parser; diff --git a/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs index f372c9f1f3b4..3ac691f03c08 100644 --- a/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Store; using LocalizableStrings = Microsoft.DotNet.Tools.Store.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-test/MSBuildUtility.cs b/src/Cli/dotnet/commands/dotnet-test/MSBuildUtility.cs index 8c4af51c754a..d03d44a4c738 100644 --- a/src/Cli/dotnet/commands/dotnet-test/MSBuildUtility.cs +++ b/src/Cli/dotnet/commands/dotnet-test/MSBuildUtility.cs @@ -5,6 +5,7 @@ using System.CommandLine; using Microsoft.Build.Evaluation; using Microsoft.Build.Execution; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Common; using Microsoft.VisualStudio.SolutionPersistence.Model; diff --git a/src/Cli/dotnet/commands/dotnet-test/Program.cs b/src/Cli/dotnet/commands/dotnet-test/Program.cs index 6714489eae66..8c61bd88fec7 100644 --- a/src/Cli/dotnet/commands/dotnet-test/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-test/Program.cs @@ -6,6 +6,7 @@ using System.Runtime.Versioning; using System.Text.RegularExpressions; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; diff --git a/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs b/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs index e0790c92adeb..d8e249accceb 100644 --- a/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Test; using Microsoft.Extensions.Configuration; using LocalizableStrings = Microsoft.DotNet.Tools.Test.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-test/TestModulesFilterHandler.cs b/src/Cli/dotnet/commands/dotnet-test/TestModulesFilterHandler.cs index 92c1316e5cc3..308b6661deb4 100644 --- a/src/Cli/dotnet/commands/dotnet-test/TestModulesFilterHandler.cs +++ b/src/Cli/dotnet/commands/dotnet-test/TestModulesFilterHandler.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Test; using Microsoft.Extensions.FileSystemGlobbing; diff --git a/src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs b/src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs index 661ebe196a08..24645c86c9b5 100644 --- a/src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.cs @@ -3,6 +3,7 @@ using System.Collections.Concurrent; using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Test; using Microsoft.TemplateEngine.Cli.Commands; using Microsoft.Testing.Platform.Helpers; diff --git a/src/Cli/dotnet/commands/dotnet-test/TestingPlatformOptions.cs b/src/Cli/dotnet/commands/dotnet-test/TestingPlatformOptions.cs index 696de60a33d1..0fe506b63ff3 100644 --- a/src/Cli/dotnet/commands/dotnet-test/TestingPlatformOptions.cs +++ b/src/Cli/dotnet/commands/dotnet-test/TestingPlatformOptions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Test; namespace Microsoft.DotNet.Cli diff --git a/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs index 8208ea36d612..6757a1174a91 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/ToolCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using LocalizableStrings = Microsoft.DotNet.Tools.Tool.LocalizableStrings; namespace Microsoft.DotNet.Cli diff --git a/src/Cli/dotnet/commands/dotnet-tool/ToolCommandRestorePassThroughOptions.cs b/src/Cli/dotnet/commands/dotnet-tool/ToolCommandRestorePassThroughOptions.cs index 7574aac19a02..83635fd5a8d2 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/ToolCommandRestorePassThroughOptions.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/ToolCommandRestorePassThroughOptions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs index 88498cee2bb1..de1975402bdd 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.Tool.Common; using Microsoft.DotNet.Tools.Tool.Install; diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs index dea3f0a65e26..af4c06477069 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs @@ -18,6 +18,7 @@ using NuGet.Versioning; using Microsoft.DotNet.Tools.Tool.List; using Microsoft.DotNet.Cli.Utils.Extensions; +using Microsoft.DotNet.Cli.Extensions; namespace Microsoft.DotNet.Tools.Tool.Install { diff --git a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs index 6c9e2bbaa736..a589d9006828 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; diff --git a/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs index 9ee1017ec86c..019f90a11689 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/list/ToolListCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Tool.Common; using Microsoft.DotNet.Tools.Tool.List; diff --git a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs index 7608b520ff02..c184cbc8147e 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; diff --git a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs index 878ad39b8b25..96347ca7e221 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/restore/ToolRestoreCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Tool.Common; using Microsoft.DotNet.Tools.Tool.Restore; using LocalizableStrings = Microsoft.DotNet.Tools.Tool.Restore.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs index aecf417796df..0d955f655bff 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/uninstall/ToolUninstallCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Tool.Common; using Microsoft.DotNet.Tools.Tool.Uninstall; using LocalizableStrings = Microsoft.DotNet.Tools.Tool.Uninstall.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateLocalCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateLocalCommand.cs index 0e89823ead59..b96e1e27919d 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateLocalCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateLocalCommand.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.ToolPackage; using Microsoft.DotNet.Cli.Utils; diff --git a/src/Cli/dotnet/commands/dotnet-vstest/Program.cs b/src/Cli/dotnet/commands/dotnet-vstest/Program.cs index 64382fc178da..72c4f8dd5e2e 100644 --- a/src/Cli/dotnet/commands/dotnet-vstest/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-vstest/Program.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools.Test; namespace Microsoft.DotNet.Tools.VSTest diff --git a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandBase.cs b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandBase.cs index fefcc761f966..c5f6c33ef949 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandBase.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandBase.cs @@ -3,6 +3,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.Extensions.EnvironmentAbstractions; diff --git a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs index 41a291711fa8..b929deaadc42 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandNuGetRestoreActionConfigOptions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs index 5228fe45eed8..3a27360bb7c0 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Workloads.Workload; using Microsoft.DotNet.Workloads.Workload.List; diff --git a/src/Cli/dotnet/commands/dotnet-workload/config/WorkloadConfigCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/config/WorkloadConfigCommand.cs index fd09b18ba3c2..e39d7337bb1a 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/config/WorkloadConfigCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/config/WorkloadConfigCommand.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Microsoft.Deployment.DotNet.Releases; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Workloads.Workload; using Microsoft.DotNet.Workloads.Workload.Install; diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/FileBasedInstaller.cs b/src/Cli/dotnet/commands/dotnet-workload/install/FileBasedInstaller.cs index f7f905c18888..cd7a0c252a0d 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/FileBasedInstaller.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/FileBasedInstaller.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text.Json; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.NativeWrapper; diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs index ff789e9ce93f..efd01319b8a0 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs @@ -4,6 +4,7 @@ using System.CommandLine; using System.Text.Json; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.Extensions; diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommand.cs index 2a320f18ddf7..bb6f46095ea1 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommand.cs @@ -4,6 +4,7 @@ using System.CommandLine; using System.Text.Json; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Configurer; diff --git a/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs index ca07fc062a09..ddc045f63571 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/list/WorkloadListCommandParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Workloads.Workload; using Microsoft.DotNet.Workloads.Workload.List; using LocalizableStrings = Microsoft.DotNet.Workloads.Workload.List.LocalizableStrings; diff --git a/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs index f25690d52963..ffe90c7fc3e9 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs @@ -6,6 +6,7 @@ using Microsoft.Build.Execution; using Microsoft.Build.Logging; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; diff --git a/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchVersionsCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchVersionsCommand.cs index 82c308f7cae2..cf458dcaa625 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchVersionsCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/search/WorkloadSearchVersionsCommand.cs @@ -5,6 +5,7 @@ using System.Text.Json; using Microsoft.Deployment.DotNet.Releases; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Cli.NuGetPackageDownloader; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Configurer; diff --git a/test/dotnet.Tests/ParserTests/InstallToolParserTests.cs b/test/dotnet.Tests/ParserTests/InstallToolParserTests.cs index 08deb7c68f9c..62bca59e09be 100644 --- a/test/dotnet.Tests/ParserTests/InstallToolParserTests.cs +++ b/test/dotnet.Tests/ParserTests/InstallToolParserTests.cs @@ -4,6 +4,7 @@ #nullable disable using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests diff --git a/test/dotnet.Tests/ParserTests/ListPackageParserTests.cs b/test/dotnet.Tests/ParserTests/ListPackageParserTests.cs index dd0b075d789c..bb4123e8a044 100644 --- a/test/dotnet.Tests/ParserTests/ListPackageParserTests.cs +++ b/test/dotnet.Tests/ParserTests/ListPackageParserTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests diff --git a/test/dotnet.Tests/ParserTests/MSBuildArgumentCommandLineParserTests.cs b/test/dotnet.Tests/ParserTests/MSBuildArgumentCommandLineParserTests.cs index 3ef89b177a9e..65fc011b9e74 100644 --- a/test/dotnet.Tests/ParserTests/MSBuildArgumentCommandLineParserTests.cs +++ b/test/dotnet.Tests/ParserTests/MSBuildArgumentCommandLineParserTests.cs @@ -5,6 +5,7 @@ using System.CommandLine; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Microsoft.DotNet.Tools; using BuildCommand = Microsoft.DotNet.Tools.Build.BuildCommand; using PublishCommand = Microsoft.DotNet.Tools.Publish.PublishCommand; diff --git a/test/dotnet.Tests/ParserTests/NuGetCommandParserTests.cs b/test/dotnet.Tests/ParserTests/NuGetCommandParserTests.cs index edafa3a087c6..885b61f64784 100644 --- a/test/dotnet.Tests/ParserTests/NuGetCommandParserTests.cs +++ b/test/dotnet.Tests/ParserTests/NuGetCommandParserTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests diff --git a/test/dotnet.Tests/ParserTests/ParseResultExtensionsTests.cs b/test/dotnet.Tests/ParserTests/ParseResultExtensionsTests.cs index be639fd0b2a6..04099d5791b6 100644 --- a/test/dotnet.Tests/ParserTests/ParseResultExtensionsTests.cs +++ b/test/dotnet.Tests/ParserTests/ParseResultExtensionsTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests diff --git a/test/dotnet.Tests/ParserTests/RestoreParserTests.cs b/test/dotnet.Tests/ParserTests/RestoreParserTests.cs index fc8ce711835b..2b73a82724fd 100644 --- a/test/dotnet.Tests/ParserTests/RestoreParserTests.cs +++ b/test/dotnet.Tests/ParserTests/RestoreParserTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.CommandLineParserTests diff --git a/test/dotnet.Tests/ParserTests/ToolRestoreParserTests.cs b/test/dotnet.Tests/ParserTests/ToolRestoreParserTests.cs index 929199646041..0281e7463660 100644 --- a/test/dotnet.Tests/ParserTests/ToolRestoreParserTests.cs +++ b/test/dotnet.Tests/ParserTests/ToolRestoreParserTests.cs @@ -4,6 +4,7 @@ #nullable disable using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests diff --git a/test/dotnet.Tests/ParserTests/ToolRunParserTests.cs b/test/dotnet.Tests/ParserTests/ToolRunParserTests.cs index 2fe5b825d66c..7f2ab52c5252 100644 --- a/test/dotnet.Tests/ParserTests/ToolRunParserTests.cs +++ b/test/dotnet.Tests/ParserTests/ToolRunParserTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests diff --git a/test/dotnet.Tests/ParserTests/UpdateToolParserTests.cs b/test/dotnet.Tests/ParserTests/UpdateToolParserTests.cs index c05841a0bea8..391a9f534fe2 100644 --- a/test/dotnet.Tests/ParserTests/UpdateToolParserTests.cs +++ b/test/dotnet.Tests/ParserTests/UpdateToolParserTests.cs @@ -4,6 +4,7 @@ #nullable disable using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Extensions; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tests.ParserTests From 377ec0ace498414d9e4a4d3f179b885db63e32f0 Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 7 Mar 2025 16:55:48 -0800 Subject: [PATCH 5/6] Renamed CommonOptionsExtension.cs to CommonOptionsExtensions.cs. --- .../{CommonOptionsExtension.cs => CommonOptionsExtensions.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Cli/dotnet/Extensions/{CommonOptionsExtension.cs => CommonOptionsExtensions.cs} (100%) diff --git a/src/Cli/dotnet/Extensions/CommonOptionsExtension.cs b/src/Cli/dotnet/Extensions/CommonOptionsExtensions.cs similarity index 100% rename from src/Cli/dotnet/Extensions/CommonOptionsExtension.cs rename to src/Cli/dotnet/Extensions/CommonOptionsExtensions.cs From 37cf645450bd300c5db0eb3a234b9ee67c4b5d6d Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Mon, 10 Mar 2025 13:11:32 -0700 Subject: [PATCH 6/6] Reverted changes based on IDE analyzer adjustments. --- .../Extensions/MSBuildProjectExtensions.cs | 2 +- .../dotnet/Extensions/OptionForwardingExtensions.cs | 10 +++++----- src/Cli/dotnet/Extensions/ParseResultExtensions.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs index ed50af97ab4f..9bc6b3113469 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs @@ -47,7 +47,7 @@ public static ISet ConditionChain(this ProjectElement projectElement) public static ProjectItemGroupElement FindUniformOrCreateItemGroupWithCondition(this ProjectRootElement root, string projectItemElementType, string framework) { - var lastMatchingItemGroup = root.FindExistingUniformItemGroupWithCondition(projectItemElementType, framework); + var lastMatchingItemGroup = FindExistingUniformItemGroupWithCondition(root, projectItemElementType, framework); if (lastMatchingItemGroup != null) { diff --git a/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs b/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs index e3541bbba988..fef15f1e8b62 100644 --- a/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs +++ b/src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs @@ -9,9 +9,9 @@ namespace Microsoft.DotNet.Cli.Extensions { public static class OptionForwardingExtensions { - public static ForwardedOption Forward(this ForwardedOption option) => option.SetForwardingFunction((o) => new string[] { option.Name }); + public static ForwardedOption Forward(this ForwardedOption option) => option.SetForwardingFunction((T o) => new string[] { option.Name }); - public static ForwardedOption ForwardAs(this ForwardedOption option, string value) => option.SetForwardingFunction((o) => new string[] { value }); + public static ForwardedOption ForwardAs(this ForwardedOption option, string value) => option.SetForwardingFunction((T o) => new string[] { value }); public static ForwardedOption ForwardAsSingle(this ForwardedOption option, Func format) => option.SetForwardingFunction(format); @@ -24,7 +24,7 @@ public static class OptionForwardingExtensions /// The option public static ForwardedOption ForwardAsOutputPath(this ForwardedOption option, string outputPropertyName, bool surroundWithDoubleQuotes = false) { - return option.SetForwardingFunction((o) => + return option.SetForwardingFunction((string o) => { string argVal = CommandDirectoryContext.GetFullPath(o); if (surroundWithDoubleQuotes) @@ -136,13 +136,13 @@ public ForwardedOption SetForwardingFunction(Func format) public ForwardedOption SetForwardingFunction(Func> func) { - ForwardingFunction = (parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this), parseResult) : Array.Empty(); + ForwardingFunction = (ParseResult parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this), parseResult) : Array.Empty(); return this; } public Func> GetForwardingFunction(Func> func) { - return (parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this)) : Array.Empty(); + return (ParseResult parseResult) => parseResult.GetResult(this) is not null ? func(parseResult.GetValue(this)) : Array.Empty(); } public Func> GetForwardingFunction() diff --git a/src/Cli/dotnet/Extensions/ParseResultExtensions.cs b/src/Cli/dotnet/Extensions/ParseResultExtensions.cs index 4928d58eedda..62d5a5080392 100644 --- a/src/Cli/dotnet/Extensions/ParseResultExtensions.cs +++ b/src/Cli/dotnet/Extensions/ParseResultExtensions.cs @@ -103,7 +103,7 @@ public static bool CanBeInvoked(this ParseResult parseResult) { return GetBuiltInCommand(parseResult.RootSubCommandResult()) != null || parseResult.Tokens.Any(token => token.Type == CliTokenType.Directive) || - parseResult.IsTopLevelDotnetCommand() && string.IsNullOrEmpty(parseResult.GetValue(DotnetSubCommand)); + (parseResult.IsTopLevelDotnetCommand() && string.IsNullOrEmpty(parseResult.GetValue(DotnetSubCommand))); } public static int HandleMissingCommand(this ParseResult parseResult)