Skip to content

Commit 8166b99

Browse files
authored
Clean up extensions for dotnet CLI & Utils (#47373)
2 parents 79f84d7 + 74362db commit 8166b99

File tree

163 files changed

+177
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+177
-26
lines changed

src/BuiltInTools/dotnet-watch/CommandLineOptions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Data;
88
using System.Diagnostics;
99
using Microsoft.DotNet.Cli;
10+
using Microsoft.DotNet.Cli.Extensions;
1011
using Microsoft.DotNet.Tools.Run;
1112
using NuGet.Common;
1213

src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Diagnostics;
55
using System.Runtime.CompilerServices;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67

78
namespace Microsoft.DotNet.Cli.Utils
89
{

src/Cli/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using Microsoft.DotNet.Cli.Utils.Extensions;
5+
46
namespace Microsoft.DotNet.Cli.Utils
57
{
68
public class EnvironmentProvider : IEnvironmentProvider

src/Cli/Microsoft.DotNet.Cli.Utils/AnsiExtensions.cs renamed to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/AnsiExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace Microsoft.DotNet.Cli.Utils
4+
namespace Microsoft.DotNet.Cli.Utils.Extensions
55
{
66
public static class AnsiExtensions
77
{

src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace Microsoft.DotNet.Cli.Utils
4+
namespace Microsoft.DotNet.Cli.Utils.Extensions
55
{
66
public static class CollectionsExtensions
77
{

src/Cli/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs renamed to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ExceptionExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace Microsoft.DotNet.Cli.Utils
4+
namespace Microsoft.DotNet.Cli.Utils.Extensions
55
{
66
internal static class ExceptionExtensions
77
{

src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
using NuGet.Packaging;
66
using NuGet.ProjectModel;
77

8-
namespace Microsoft.DotNet.Cli.Utils
8+
namespace Microsoft.DotNet.Cli.Utils.Extensions
99
{
10-
static class LockFileExtensions
10+
internal static class LockFileExtensions
1111
{
1212
public static string GetPackageDirectory(this LockFile lockFile, LockFileTargetLibrary library)
1313
{

src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using NuGet.Common;
55
using NuGet.ProjectModel;
66

7-
namespace Microsoft.DotNet.Cli.Utils
7+
namespace Microsoft.DotNet.Cli.Utils.Extensions
88
{
99
public static class LockFileFormatExtensions
1010
{

src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildProjectExtensions.cs renamed to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/MSBuildProjectExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Microsoft.Build.Construction;
55
using Microsoft.DotNet.Tools.Common;
66

7-
namespace Microsoft.DotNet.Cli.Utils
7+
namespace Microsoft.DotNet.Cli.Utils.Extensions
88
{
99
internal static class MSBuildProjectExtensions
1010
{

src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Runtime.Versioning;
66
using Microsoft.Win32.SafeHandles;
77

8-
namespace Microsoft.DotNet.Cli.Utils
8+
namespace Microsoft.DotNet.Cli.Utils.Extensions
99
{
1010
/// <summary>
1111
/// Extensions methods for <see cref="Process"/> components.

src/Cli/Microsoft.DotNet.Cli.Utils/ProcessStartInfoExtensions.cs renamed to src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/ProcessStartInfoExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Diagnostics;
55

6-
namespace Microsoft.DotNet.Cli.Utils
6+
namespace Microsoft.DotNet.Cli.Utils.Extensions
77
{
88
internal static class ProcessStartInfoExtensions
99
{

src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#if NET
55

66
using System.Diagnostics;
7+
using Microsoft.DotNet.Cli.Utils.Extensions;
78

89
namespace Microsoft.DotNet.Cli.Utils
910
{

src/Cli/Microsoft.DotNet.Cli.Utils/GracefulException.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using Microsoft.DotNet.Cli.Utils.Extensions;
5+
46
namespace Microsoft.DotNet.Cli.Utils
57
{
68
public class GracefulException : Exception

src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Linq;
1111
using System.Runtime.InteropServices;
1212
using System.Text;
13+
using Microsoft.DotNet.Cli.Utils.Extensions;
1314

1415
namespace Microsoft.DotNet.Cli.Utils
1516
{

src/Cli/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Microsoft.DotNet.Cli.Utils;
4+
using Microsoft.DotNet.Cli.Utils.Extensions;
55
using NuGet.Common;
66

77
namespace Microsoft.DotNet.Configurer

src/Cli/Microsoft.TemplateEngine.Cli/Commands/BaseCommand.cs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.CommandLine.Invocation;
77
using System.Reflection;
88
using Microsoft.DotNet.Cli.Utils;
9+
using Microsoft.DotNet.Cli.Utils.Extensions;
910
using Microsoft.TemplateEngine.Abstractions;
1011
using Microsoft.TemplateEngine.Abstractions.Mount;
1112
using Microsoft.TemplateEngine.Cli.TabularOutput;

src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.NoMatchHandling.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.CommandLine;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using Microsoft.TemplateEngine.Abstractions;
78
using Microsoft.TemplateEngine.Edge.Settings;
89
using Command = System.CommandLine.CliCommand;

src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.CommandLine;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using Microsoft.Extensions.Logging;
78
using Microsoft.TemplateEngine.Abstractions;
89
using Microsoft.TemplateEngine.Abstractions.TemplatePackage;

src/Cli/Microsoft.TemplateEngine.Cli/PostActionDispatcher.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.TemplateEngine.Abstractions;
67
using Microsoft.TemplateEngine.Cli.PostActionProcessors;
78
using Microsoft.TemplateEngine.Edge.Template;

src/Cli/Microsoft.TemplateEngine.Cli/PostActionProcessors/InstructionDisplayPostActionProcessor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.TemplateEngine.Abstractions;
67

78
namespace Microsoft.TemplateEngine.Cli.PostActionProcessors

src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Text.RegularExpressions;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using Microsoft.TemplateEngine.Abstractions;
78
using Microsoft.TemplateEngine.Abstractions.TemplatePackage;
89
using Microsoft.TemplateEngine.Cli.Commands;

src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.TemplateEngine.Abstractions;
67
using Microsoft.TemplateEngine.Cli.Commands;
78
using Microsoft.TemplateEngine.Cli.TabularOutput;

src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.CommandLine;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using Microsoft.DotNet.Tools.Common;
78
using Microsoft.TemplateEngine.Abstractions;
89
using Microsoft.TemplateEngine.Abstractions.Constraints;

src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.CommandLine;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using Microsoft.TemplateEngine.Abstractions;
78
using Microsoft.TemplateEngine.Abstractions.Constraints;
89
using Microsoft.TemplateEngine.Abstractions.Installer;

src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.TemplateEngine.Abstractions;
67
using Microsoft.TemplateEngine.Abstractions.TemplatePackage;
78
using Microsoft.TemplateEngine.Cli.Commands;

src/Cli/dotnet/BuildServer/BuildServerProvider.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.DotNet.Configurer;
67
using Microsoft.Extensions.EnvironmentAbstractions;
78

src/Cli/dotnet/CommandBase.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.CommandLine;
5+
using Microsoft.DotNet.Cli.Extensions;
56

67
namespace Microsoft.DotNet.Cli
78
{

src/Cli/dotnet/CommandFactory/CommandResolution/AbstractPathBasedCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56

67
namespace Microsoft.DotNet.CommandFactory
78
{

src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseDllCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56

67
namespace Microsoft.DotNet.CommandFactory
78
{

src/Cli/dotnet/CommandFactory/CommandResolution/DepsJsonCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.DotNet.Tools.Common;
67
using Microsoft.Extensions.DependencyModel;
78

src/Cli/dotnet/CommandFactory/CommandResolution/MSBuildProject.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Microsoft.Build.Evaluation;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using NuGet.Frameworks;
78
using NuGet.ProjectModel;
89

src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56

67
namespace Microsoft.DotNet.CommandFactory
78
{

src/Cli/dotnet/CommandFactory/CommandResolution/OutputPathCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using NuGet.Frameworks;
67

78
namespace Microsoft.DotNet.CommandFactory

src/Cli/dotnet/CommandFactory/CommandResolution/PackagedCommandSpecFactory.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using Microsoft.DotNet.Tools.Common;
67
using NuGet.ProjectModel;
78

src/Cli/dotnet/CommandFactory/CommandResolution/ProjectDependenciesCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using NuGet.Frameworks;
67
using NuGet.ProjectModel;
78

src/Cli/dotnet/CommandFactory/CommandResolution/ProjectFactory.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Microsoft.Build.Exceptions;
55
using Microsoft.DotNet.Cli.Utils;
6+
using Microsoft.DotNet.Cli.Utils.Extensions;
67
using NuGet.Frameworks;
78

89
namespace Microsoft.DotNet.CommandFactory

src/Cli/dotnet/CommandFactory/CommandResolution/ProjectPathCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56

67
namespace Microsoft.DotNet.CommandFactory
78
{

src/Cli/dotnet/CommandFactory/CommandResolution/ProjectToolsCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56
using NuGet.Frameworks;
67
using NuGet.ProjectModel;
78
using NuGet.Versioning;

src/Cli/dotnet/CommandFactory/CommandResolution/PublishedPathCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56

67
namespace Microsoft.DotNet.CommandFactory
78
{

src/Cli/dotnet/CommandFactory/CommandResolution/RootedCommandResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.DotNet.Cli.Utils;
5+
using Microsoft.DotNet.Cli.Utils.Extensions;
56

67
namespace Microsoft.DotNet.CommandFactory
78
{

src/Cli/dotnet/CommonOptions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.CommandLine.Completions;
66
using System.CommandLine.Parsing;
77
using System.CommandLine.StaticCompletions;
8+
using Microsoft.DotNet.Cli.Extensions;
89
using Microsoft.DotNet.Cli.Utils;
910
using Microsoft.DotNet.Tools;
1011
using Microsoft.DotNet.Tools.Common;

src/Cli/dotnet/CommonOptionsExtension.cs renamed to src/Cli/dotnet/Extensions/CommonOptionsExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Microsoft.Build.Framework;
55
using Microsoft.Extensions.Logging;
66

7-
namespace Microsoft.DotNet.Cli
7+
namespace Microsoft.DotNet.Cli.Extensions
88
{
9-
internal static class CommonOptionsExtension
9+
internal static class CommonOptionsExtensions
1010
{
1111
public static LoggerVerbosity ToLoggerVerbosity(this VerbosityOptions verbosityOptions)
1212
{

src/Cli/dotnet/OptionForwardingExtensions.cs renamed to src/Cli/dotnet/Extensions/OptionForwardingExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#nullable enable
99

10-
namespace Microsoft.DotNet.Cli
10+
namespace Microsoft.DotNet.Cli.Extensions
1111
{
1212
public static class OptionForwardingExtensions
1313
{

src/Cli/dotnet/ParseResultExtensions.cs renamed to src/Cli/dotnet/Extensions/ParseResultExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
using System.CommandLine;
55
using System.CommandLine.Parsing;
66
using System.Diagnostics;
7-
using System.Reflection;
87
using System.Text.RegularExpressions;
98
using Microsoft.DotNet.Cli.Utils;
9+
using Microsoft.DotNet.Cli.Utils.Extensions;
1010
using static Microsoft.DotNet.Cli.Parser;
1111
using CommandResult = System.CommandLine.Parsing.CommandResult;
1212

13-
namespace Microsoft.DotNet.Cli
13+
namespace Microsoft.DotNet.Cli.Extensions
1414
{
1515
public static class ParseResultExtensions
1616
{

src/Cli/dotnet/ParserExtensions.cs renamed to src/Cli/dotnet/Extensions/ParserExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.CommandLine;
55

6-
namespace Microsoft.DotNet.Cli
6+
namespace Microsoft.DotNet.Cli.Extensions
77
{
88
public static class ParserExtensions
99
{

src/Cli/dotnet/ProjectExtensions.cs renamed to src/Cli/dotnet/Extensions/ProjectExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Microsoft.Build.Evaluation;
55
using NuGet.Frameworks;
66

7-
namespace Microsoft.DotNet.Tools.ProjectExtensions
7+
namespace Microsoft.DotNet.Cli.Extensions
88
{
99
internal static class ProjectExtensions
1010
{

0 commit comments

Comments
 (0)