C#: autobuild: fix buildless mode for CodeQL

This commit is contained in:
Arthur Baars
2020-09-02 13:23:23 +02:00
parent f4060723bb
commit 223d94219e
2 changed files with 15 additions and 3 deletions

View File

@@ -11,10 +11,15 @@ namespace Semmle.Autobuild.CSharp
{
BuildScript GetCommand(string? solution)
{
if (builder.SemmlePlatformTools is null)
string standalone;
if (!(builder.CodeQLExtractorLangRoot is null) && !(builder.CodeQlPlatform is null)) {
standalone = builder.Actions.PathCombine(builder.CodeQLExtractorLangRoot, "tools", builder.CodeQlPlatform, "Semmle.Extraction.CSharp.Standalone");
} else if (!(builder.SemmlePlatformTools is null)) {
standalone = builder.Actions.PathCombine(builder.SemmlePlatformTools, "csharp", "Semmle.Extraction.CSharp.Standalone");
} else {
return BuildScript.Failure;
}
var standalone = builder.Actions.PathCombine(builder.SemmlePlatformTools, "csharp", "Semmle.Extraction.CSharp.Standalone");
var cmd = new CommandBuilder(builder.Actions);
cmd.RunCommand(standalone);

View File

@@ -193,6 +193,8 @@ namespace Semmle.Autobuild.Shared
SemmleDist = Actions.GetEnvironmentVariable("SEMMLE_DIST");
SemmlePlatformTools = Actions.GetEnvironmentVariable("SEMMLE_PLATFORM_TOOLS");
CodeQlPlatform = Actions.GetEnvironmentVariable("CODEQL_PLATFORM");
JavaHome =
Actions.GetEnvironmentVariable("CODEQL_JAVA_HOME") ??
Actions.GetEnvironmentVariable("SEMMLE_JAVA_HOME") ??
@@ -271,7 +273,7 @@ namespace Semmle.Autobuild.Shared
/// <summary>
/// Value of CODEQL_EXTRACTOR_<LANG>_ROOT environment variable.
/// </summary>
private string? CodeQLExtractorLangRoot { get; }
public string? CodeQLExtractorLangRoot { get; }
/// <summary>
/// Value of SEMMLE_DIST environment variable.
@@ -287,6 +289,11 @@ namespace Semmle.Autobuild.Shared
/// </summary>
public string? SemmlePlatformTools { get; }
/// <summary>
/// Value of CODEQL_PLATFORM environment variable.
/// </summary>
public string? CodeQlPlatform { get; }
/// <summary>
/// The absolute path of the odasa executable.
/// null if we are running in CodeQL.