File tree Expand file tree Collapse file tree 3 files changed +26
-8
lines changed
Test/Commands/Targets/Actions
CodeQLToolkit.Shared/CodeQL Expand file tree Collapse file tree 3 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ public void Register(Command parentCommand)
39
39
parentCommand . Add ( runCommand ) ;
40
40
41
41
var installCommand = new Command ( "install" , "Installs CodeQL (bundle or release distribution) locally." ) ;
42
- var useCommand = new Command ( "use" , "Switches tooling to use a different CodeQL version and updates the paths accordingly." ) ;
43
- var listCommand = new Command ( "list" , "Lists versions of CodeQL available locally." ) ;
42
+ // var useCommand = new Command("use", "Switches tooling to use a different CodeQL version and updates the paths accordingly.");
43
+ // var listCommand = new Command("list", "Lists versions of CodeQL available locally.");
44
44
45
45
runCommand . Add ( installCommand ) ;
46
- runCommand . Add ( useCommand ) ;
46
+ // runCommand.Add(useCommand);
47
47
//runCommand.Add(listCommand);
48
48
49
49
Original file line number Diff line number Diff line change 1
1
using CodeQLToolkit . Features . Test . Lifecycle . Models ;
2
+ using CodeQLToolkit . Shared . CodeQL ;
2
3
using CodeQLToolkit . Shared . Utils ;
3
4
using System ;
4
5
using System . Collections . Generic ;
@@ -70,9 +71,19 @@ public override void Run()
70
71
Log < ExecuteUnitTestsCommandTarget > . G ( ) . LogInformation ( $ "Slice: { slice } of { NumThreads } ") ;
71
72
Log < ExecuteUnitTestsCommandTarget > . G ( ) . LogInformation ( $ "Report File: { outFileReport } ...") ;
72
73
74
+
75
+ // Get A Copy of the installation
76
+ var installation = CodeQLInstallation . LoadFromConfig ( Base ) ;
77
+
78
+ if ( ! installation . IsInstalled ( ) )
79
+ {
80
+ DieWithError ( $ "Requested CodeQL Version ({ CLIVersion } ) Not Installed. Run `qlt codeql run install` before running this step.") ;
81
+ }
82
+
83
+
73
84
using ( Process process = new Process ( ) )
74
85
{
75
- process . StartInfo . FileName = "codeql" ;
86
+ process . StartInfo . FileName = installation . CodeQLToolBinary ;
76
87
process . StartInfo . WorkingDirectory = workingDirectory ;
77
88
process . StartInfo . UseShellExecute = false ;
78
89
process . StartInfo . RedirectStandardOutput = true ;
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ public string PlatformExtension
98
98
}
99
99
}
100
100
101
+
101
102
public void Install ( )
102
103
{
103
104
// each time we download the file; however,
@@ -256,13 +257,19 @@ public string GetInstallationDirectory(ArtifactKind k)
256
257
257
258
}
258
259
259
- public string CodeQLHome { get {
260
- return "" ;
260
+ public string CodeQLHome {
261
+ get {
262
+ return CodeQLDirectory ;
261
263
}
262
264
}
263
265
264
- public string CodeQLToolBinary { get {
265
- return Path . Combine ( "" , "" ) ;
266
+ public string CodeQLToolBinary {
267
+ get {
268
+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
269
+ {
270
+ return Path . Combine ( CodeQLDirectory , "codeql.exe" ) ;
271
+ }
272
+ return Path . Combine ( CodeQLDirectory , "codeql" ) ;
266
273
}
267
274
}
268
275
You can’t perform that action at this time.
0 commit comments