mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Remove support for legacy LGTM options in autobuilder
This commit is contained in:
@@ -25,9 +25,11 @@ namespace Semmle.Autobuild.CSharp
|
||||
/// </summary>
|
||||
public CSharpAutobuildOptions(IBuildActions actions) : base(actions)
|
||||
{
|
||||
Buildless = actions.GetEnvironmentVariable(lgtmPrefix + "BUILDLESS").AsBool("buildless", false) ||
|
||||
Buildless =
|
||||
actions.GetEnvironmentVariable(extractorOptionPrefix + "BUILDLESS").AsBool("buildless", false) ||
|
||||
actions.GetEnvironmentVariable(buildModeEnvironmentVariable)?.ToLower() == "none";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,19 +48,10 @@ namespace Semmle.Autobuild.CSharp
|
||||
var attempt = BuildScript.Failure;
|
||||
switch (GetCSharpBuildStrategy())
|
||||
{
|
||||
case CSharpBuildStrategy.CustomBuildCommand:
|
||||
attempt = new BuildCommandRule(DotNetRule.WithDotNet).Analyse(this, false) & CheckExtractorRun(true);
|
||||
break;
|
||||
case CSharpBuildStrategy.Buildless:
|
||||
// No need to check that the extractor has been executed in buildless mode
|
||||
attempt = new StandaloneBuildRule().Analyse(this, false);
|
||||
break;
|
||||
case CSharpBuildStrategy.MSBuild:
|
||||
attempt = new MsBuildRule().Analyse(this, false) & CheckExtractorRun(true);
|
||||
break;
|
||||
case CSharpBuildStrategy.DotNet:
|
||||
attempt = new DotNetRule().Analyse(this, false) & CheckExtractorRun(true);
|
||||
break;
|
||||
case CSharpBuildStrategy.Auto:
|
||||
attempt =
|
||||
// Attempt a few different build strategies to see if one works
|
||||
@@ -198,32 +191,15 @@ namespace Semmle.Autobuild.CSharp
|
||||
/// </summary>
|
||||
private CSharpBuildStrategy GetCSharpBuildStrategy()
|
||||
{
|
||||
if (Options.BuildCommand is not null)
|
||||
return CSharpBuildStrategy.CustomBuildCommand;
|
||||
|
||||
if (Options.Buildless)
|
||||
return CSharpBuildStrategy.Buildless;
|
||||
|
||||
if (Options.MsBuildArguments is not null
|
||||
|| Options.MsBuildConfiguration is not null
|
||||
|| Options.MsBuildPlatform is not null
|
||||
|| Options.MsBuildTarget is not null)
|
||||
{
|
||||
return CSharpBuildStrategy.MSBuild;
|
||||
}
|
||||
|
||||
if (Options.DotNetArguments is not null || Options.DotNetVersion is not null)
|
||||
return CSharpBuildStrategy.DotNet;
|
||||
|
||||
return CSharpBuildStrategy.Auto;
|
||||
}
|
||||
|
||||
private enum CSharpBuildStrategy
|
||||
{
|
||||
CustomBuildCommand,
|
||||
Buildless,
|
||||
MSBuild,
|
||||
DotNet,
|
||||
Auto
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,8 +150,7 @@ namespace Semmle.Autobuild.CSharp
|
||||
Argument("--no-incremental");
|
||||
|
||||
return
|
||||
script.Argument(builder.Options.DotNetArguments).
|
||||
QuoteArgument(projOrSln).
|
||||
script.QuoteArgument(projOrSln).
|
||||
Script;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user