@@ -9,31 +9,31 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
9
9
/// <summary>
10
10
/// Utilities to run the "dotnet" command.
11
11
/// </summary>
12
- internal partial class DotNetCliWrapper : IDotNet
12
+ internal partial class DotNet : IDotNet
13
13
{
14
- private readonly IDotNetCliInvoker dotnet ;
14
+ private readonly IDotNetCliInvoker dotnetCliInvoker ;
15
15
private readonly ProgressMonitor progressMonitor ;
16
16
17
- private DotNetCliWrapper ( IDotNetCliInvoker dotnet , ProgressMonitor progressMonitor )
17
+ private DotNet ( IDotNetCliInvoker dotnetCliInvoker , ProgressMonitor progressMonitor )
18
18
{
19
19
this . progressMonitor = progressMonitor ;
20
- this . dotnet = dotnet ;
20
+ this . dotnetCliInvoker = dotnetCliInvoker ;
21
21
Info ( ) ;
22
22
}
23
23
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 ) { }
25
25
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 ) ;
27
27
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 ) ;
29
29
30
30
private void Info ( )
31
31
{
32
32
// 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" ) ;
34
34
if ( ! res )
35
35
{
36
- throw new Exception ( $ "{ dotnet . Exec } --info failed.") ;
36
+ throw new Exception ( $ "{ dotnetCliInvoker . Exec } --info failed.") ;
37
37
}
38
38
}
39
39
@@ -47,7 +47,7 @@ public bool RestoreProjectToDirectory(string projectFile, string packageDirector
47
47
{
48
48
args += $ " --configfile \" { pathToNugetConfig } \" ";
49
49
}
50
- var success = dotnet . RunCommand ( args , out var output ) ;
50
+ var success = dotnetCliInvoker . RunCommand ( args , out var output ) ;
51
51
stdout = string . Join ( "\n " , output ) ;
52
52
return success ;
53
53
}
@@ -56,7 +56,7 @@ public bool RestoreSolutionToDirectory(string solutionFile, string packageDirect
56
56
{
57
57
var args = GetRestoreArgs ( solutionFile , packageDirectory ) ;
58
58
args += " --verbosity normal" ;
59
- if ( dotnet . RunCommand ( args , out var output ) )
59
+ if ( dotnetCliInvoker . RunCommand ( args , out var output ) )
60
60
{
61
61
var regex = RestoreProjectRegex ( ) ;
62
62
projects = output
@@ -73,13 +73,13 @@ public bool RestoreSolutionToDirectory(string solutionFile, string packageDirect
73
73
public bool New ( string folder )
74
74
{
75
75
var args = $ "new console --no-restore --output \" { folder } \" ";
76
- return dotnet . RunCommand ( args ) ;
76
+ return dotnetCliInvoker . RunCommand ( args ) ;
77
77
}
78
78
79
79
public bool AddPackage ( string folder , string package )
80
80
{
81
81
var args = $ "add \" { folder } \" package \" { package } \" --no-restore";
82
- return dotnet . RunCommand ( args ) ;
82
+ return dotnetCliInvoker . RunCommand ( args ) ;
83
83
}
84
84
85
85
public IList < string > GetListedRuntimes ( ) => GetListed ( "--list-runtimes" , "runtime" ) ;
@@ -88,7 +88,7 @@ public bool AddPackage(string folder, string package)
88
88
89
89
private IList < string > GetListed ( string args , string artifact )
90
90
{
91
- if ( dotnet . RunCommand ( args , out var artifacts ) )
91
+ if ( dotnetCliInvoker . RunCommand ( args , out var artifacts ) )
92
92
{
93
93
progressMonitor . LogInfo ( $ "Found { artifact } s: { string . Join ( "\n " , artifacts ) } ") ;
94
94
return artifacts ;
@@ -99,7 +99,7 @@ private IList<string> GetListed(string args, string artifact)
99
99
public bool Exec ( string execArgs )
100
100
{
101
101
var args = $ "exec { execArgs } ";
102
- return dotnet . RunCommand ( args ) ;
102
+ return dotnetCliInvoker . RunCommand ( args ) ;
103
103
}
104
104
105
105
[ GeneratedRegex ( "Restored\\ s+(.+\\ .csproj)" , RegexOptions . Compiled ) ]
0 commit comments