mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
This is a necessary preparation for moving the C# dependency management to `paket`, which in turn is a necessary preparation for moving the C# build to bazel. As we discovered in https://github.com/github/codeql/pull/16376, `paket` tries to restore all projects recursively from the root folder. If we support building C# code under both `ql/csharp` and `ql/cpp`, we need to have a single lockfile under `ql`, as both codebases share the same set of dependencies (and utilities from `ql/csharp/extractor`). Then, `paket` will also try to restore things that look like "C# projects" in other languages' folders, which is not what we want. Therefore, we address this by moving all C# code into a common root directory, `ql/csharp`. This needs an internal PR to adjust the buildsystem to look for the autobuilder in the new location.
36 lines
995 B
C#
36 lines
995 B
C#
using System;
|
|
|
|
using Semmle.Autobuild.Shared;
|
|
using Semmle.Util;
|
|
|
|
namespace Semmle.Autobuild.Cpp
|
|
{
|
|
class Program
|
|
{
|
|
static int Main()
|
|
{
|
|
|
|
try
|
|
{
|
|
var actions = SystemBuildActions.Instance;
|
|
var options = new CppAutobuildOptions(actions);
|
|
try
|
|
{
|
|
Console.WriteLine("CodeQL C++ autobuilder");
|
|
using var builder = new CppAutobuilder(actions, options);
|
|
return builder.AttemptBuild();
|
|
}
|
|
catch (InvalidEnvironmentException ex)
|
|
{
|
|
Console.WriteLine("The environment is invalid: {0}", ex.Message);
|
|
}
|
|
}
|
|
catch (ArgumentOutOfRangeException ex)
|
|
{
|
|
Console.WriteLine("The value \"{0}\" for parameter \"{1}\" is invalid", ex.ActualValue, ex.ParamName);
|
|
}
|
|
return 1;
|
|
}
|
|
}
|
|
}
|