@@ -9,31 +9,31 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
99 /// <summary>
1010 /// Utilities to run the "dotnet" command.
1111 /// </summary>
12- internal partial class DotNetCliWrapper : IDotNet
12+ internal partial class DotNet : IDotNet
1313 {
14- private readonly IDotNetCliInvoker dotnet ;
14+ private readonly IDotNetCliInvoker dotnetCliInvoker ;
1515 private readonly ProgressMonitor progressMonitor ;
1616
17- private DotNetCliWrapper ( IDotNetCliInvoker dotnet , ProgressMonitor progressMonitor )
17+ private DotNet ( IDotNetCliInvoker dotnetCliInvoker , ProgressMonitor progressMonitor )
1818 {
1919 this . progressMonitor = progressMonitor ;
20- this . dotnet = dotnet ;
20+ this . dotnetCliInvoker = dotnetCliInvoker ;
2121 Info ( ) ;
2222 }
2323
24- private DotNetCliWrapper ( IDependencyOptions options , ProgressMonitor progressMonitor ) : this ( new DotNetCliInvoker ( progressMonitor , Path . Combine ( options . DotNetPath ?? string . Empty , "dotnet" ) ) , progressMonitor ) { }
24+ private DotNet ( IDependencyOptions options , ProgressMonitor progressMonitor ) : this ( new DotNetCliInvoker ( progressMonitor , Path . Combine ( options . DotNetPath ?? string . Empty , "dotnet" ) ) , progressMonitor ) { }
2525
26- internal static IDotNet Make ( IDotNetCliInvoker dotnet , ProgressMonitor progressMonitor ) => new DotNetCliWrapper ( dotnet , progressMonitor ) ;
26+ internal static IDotNet Make ( IDotNetCliInvoker dotnetCliInvoker , ProgressMonitor progressMonitor ) => new DotNet ( dotnetCliInvoker , progressMonitor ) ;
2727
28- public static IDotNet Make ( IDependencyOptions options , ProgressMonitor progressMonitor ) => new DotNetCliWrapper ( options , progressMonitor ) ;
28+ public static IDotNet Make ( IDependencyOptions options , ProgressMonitor progressMonitor ) => new DotNet ( options , progressMonitor ) ;
2929
3030 private void Info ( )
3131 {
3232 // TODO: make sure the below `dotnet` version is matching the one specified in global.json
33- var res = dotnet . RunCommand ( "--info" ) ;
33+ var res = dotnetCliInvoker . RunCommand ( "--info" ) ;
3434 if ( ! res )
3535 {
36- throw new Exception ( $ "{ dotnet . Exec } --info failed.") ;
36+ throw new Exception ( $ "{ dotnetCliInvoker . Exec } --info failed.") ;
3737 }
3838 }
3939
@@ -47,7 +47,7 @@ public bool RestoreProjectToDirectory(string projectFile, string packageDirector
4747 {
4848 args += $ " --configfile \" { pathToNugetConfig } \" ";
4949 }
50- var success = dotnet . RunCommand ( args , out var output ) ;
50+ var success = dotnetCliInvoker . RunCommand ( args , out var output ) ;
5151 stdout = string . Join ( "\n " , output ) ;
5252 return success ;
5353 }
@@ -56,7 +56,7 @@ public bool RestoreSolutionToDirectory(string solutionFile, string packageDirect
5656 {
5757 var args = GetRestoreArgs ( solutionFile , packageDirectory ) ;
5858 args += " --verbosity normal" ;
59- if ( dotnet . RunCommand ( args , out var output ) )
59+ if ( dotnetCliInvoker . RunCommand ( args , out var output ) )
6060 {
6161 var regex = RestoreProjectRegex ( ) ;
6262 projects = output
@@ -73,13 +73,13 @@ public bool RestoreSolutionToDirectory(string solutionFile, string packageDirect
7373 public bool New ( string folder )
7474 {
7575 var args = $ "new console --no-restore --output \" { folder } \" ";
76- return dotnet . RunCommand ( args ) ;
76+ return dotnetCliInvoker . RunCommand ( args ) ;
7777 }
7878
7979 public bool AddPackage ( string folder , string package )
8080 {
8181 var args = $ "add \" { folder } \" package \" { package } \" --no-restore";
82- return dotnet . RunCommand ( args ) ;
82+ return dotnetCliInvoker . RunCommand ( args ) ;
8383 }
8484
8585 public IList < string > GetListedRuntimes ( ) => GetListed ( "--list-runtimes" , "runtime" ) ;
@@ -88,7 +88,7 @@ public bool AddPackage(string folder, string package)
8888
8989 private IList < string > GetListed ( string args , string artifact )
9090 {
91- if ( dotnet . RunCommand ( args , out var artifacts ) )
91+ if ( dotnetCliInvoker . RunCommand ( args , out var artifacts ) )
9292 {
9393 progressMonitor . LogInfo ( $ "Found { artifact } s: { string . Join ( "\n " , artifacts ) } ") ;
9494 return artifacts ;
@@ -99,7 +99,7 @@ private IList<string> GetListed(string args, string artifact)
9999 public bool Exec ( string execArgs )
100100 {
101101 var args = $ "exec { execArgs } ";
102- return dotnet . RunCommand ( args ) ;
102+ return dotnetCliInvoker . RunCommand ( args ) ;
103103 }
104104
105105 [ GeneratedRegex ( "Restored\\ s+(.+\\ .csproj)" , RegexOptions . Compiled ) ]
0 commit comments