C#: Teach extractor and autobuilder about new environment variables

This commit is contained in:
Tom Hvitved
2019-10-24 10:38:53 +02:00
parent 4b27b2ac05
commit 83ec2d6162
11 changed files with 139 additions and 107 deletions

View File

@@ -405,22 +405,23 @@ namespace Semmle.Extraction.CSharp
static string GetCSharpLogDirectory()
{
string snapshot = Environment.GetEnvironmentVariable("ODASA_SNAPSHOT");
string buildErrorDir = Environment.GetEnvironmentVariable("ODASA_BUILD_ERROR_DIR");
string traps = Environment.GetEnvironmentVariable("TRAP_FOLDER");
var codeQlLogDir = Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_LOG_DIR");
if (!string.IsNullOrEmpty(codeQlLogDir))
return codeQlLogDir;
var snapshot = Environment.GetEnvironmentVariable("ODASA_SNAPSHOT");
if (!string.IsNullOrEmpty(snapshot))
{
return Path.Combine(snapshot, "log");
}
var buildErrorDir = Environment.GetEnvironmentVariable("ODASA_BUILD_ERROR_DIR");
if (!string.IsNullOrEmpty(buildErrorDir))
{
// Used by `qltest`
return buildErrorDir;
}
var traps = Environment.GetEnvironmentVariable("TRAP_FOLDER");
if (!string.IsNullOrEmpty(traps))
{
return traps;
}
return Directory.GetCurrentDirectory();
}
}