Remove environment dictionary passing

This commit is contained in:
Tamas Vajk
2024-02-22 17:12:38 +01:00
parent 648c06ce27
commit e176b32a83
2 changed files with 3 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ namespace Semmle.Autobuild.CSharp
attempt = DotNetRule.WithDotNet(this, ensureDotNetAvailable: true, (dotNetPath, env) =>
{
// No need to check that the extractor has been executed in buildless mode
return new StandaloneBuildRule(dotNetPath, env).Analyse(this, false);
return new StandaloneBuildRule(dotNetPath).Analyse(this, false);
});
break;
case CSharpBuildStrategy.MSBuild:

View File

@@ -9,12 +9,10 @@ namespace Semmle.Autobuild.CSharp
internal class StandaloneBuildRule : IBuildRule<CSharpAutobuildOptions>
{
private readonly string? dotNetPath;
private readonly IDictionary<string, string>? env;
internal StandaloneBuildRule(string? dotNetPath, IDictionary<string, string>? env)
internal StandaloneBuildRule(string? dotNetPath)
{
this.dotNetPath = dotNetPath;
this.env = env;
}
public BuildScript Analyse(IAutobuilder<CSharpAutobuildOptions> builder, bool auto)
@@ -27,7 +25,7 @@ namespace Semmle.Autobuild.CSharp
}
var standalone = builder.Actions.PathCombine(builder.CodeQLExtractorLangRoot, "tools", builder.CodeQlPlatform, "Semmle.Extraction.CSharp.Standalone");
var cmd = new CommandBuilder(builder.Actions, environment: this.env);
var cmd = new CommandBuilder(builder.Actions);
cmd.RunCommand(standalone);
if (!string.IsNullOrEmpty(this.dotNetPath))