Swift extractor: Use a global variable for the extractor name

This commit is contained in:
Calum Grant
2024-01-16 10:56:18 +00:00
parent 39edfa3c14
commit 2cc574dc70
6 changed files with 26 additions and 37 deletions

View File

@@ -8,10 +8,10 @@
#include "swift/logging/SwiftLogging.h"
#include "swift/swift-autobuilder/CustomizingBuildLink.h"
constexpr codeql::Diagnostic buildCommandFailed = codeql::swiftDiagnostic(
"build-command-failed", "Detected build command failed",
"Set up a [manual build command][1] or [check the logs of the autobuild step][2].\n"
"\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK "\n[2]: " CHECK_LOGS_HELP_LINK);
constexpr codeql::Diagnostic buildCommandFailed = codeql::Diagnostic{
.id="build-command-failed", .name="Detected build command failed",
.action="Set up a [manual build command][1] or [check the logs of the autobuild step][2].\n"
"\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK "\n[2]: " CHECK_LOGS_HELP_LINK};
static codeql::Logger& logger() {
static codeql::Logger ret{"build"};

View File

@@ -12,17 +12,18 @@ static constexpr std::string_view unitTest = "com.apple.product-type.bundle.unit
static constexpr std::string_view unknownType = "<unknown_target_type>";
const std::string_view codeql::programName = "autobuilder";
const std::string_view codeql::extractorName = "swift";
constexpr codeql::Diagnostic noProjectFound = codeql::swiftDiagnostic(
"no-project-found",
"No Xcode project or workspace found",
"Set up a [manual build command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK);
constexpr codeql::Diagnostic noProjectFound = codeql::Diagnostic{
.id="no-project-found",
.name="No Xcode project or workspace found",
.action="Set up a [manual build command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
constexpr codeql::Diagnostic noSwiftTarget = codeql::swiftDiagnostic(
"no-swift-target",
"No Swift compilation target found",
"To analyze a custom set of source files, set up a [manual build "
"command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK);
constexpr codeql::Diagnostic noSwiftTarget = codeql::Diagnostic{
.id="no-swift-target",
.name="No Swift compilation target found",
.action="To analyze a custom set of source files, set up a [manual build "
"command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
static codeql::Logger& logger() {
static codeql::Logger ret{"main"};