|
1 | 1 | #include "swift/xcode-autobuilder/XcodeProjectParser.h" |
2 | | -#include "swift/xcode-autobuilder/XcodeWorkspaceParser.h" |
3 | | -#include "swift/xcode-autobuilder/CFHelpers.h" |
4 | 2 |
|
5 | 3 | #include <iostream> |
6 | 4 | #include <filesystem> |
|
9 | 7 | #include <fstream> |
10 | 8 | #include <CoreFoundation/CoreFoundation.h> |
11 | 9 |
|
| 10 | +#include "swift/xcode-autobuilder/XcodeWorkspaceParser.h" |
| 11 | +#include "swift/xcode-autobuilder/CFHelpers.h" |
| 12 | +#include "swift/logging/SwiftLogging.h" |
| 13 | + |
| 14 | +namespace codeql_diagnostics { |
| 15 | +constexpr codeql::SwiftDiagnosticsSource no_project_found{ |
| 16 | + "no_project_found", |
| 17 | + "No Xcode project or workspace detected", |
| 18 | + "Set up a manual build command", |
| 19 | + "https://docs.github.com/en/enterprise-server/code-security/code-scanning/" |
| 20 | + "automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning", |
| 21 | +}; |
| 22 | +} // namespace codeql_diagnostics |
| 23 | + |
12 | 24 | namespace fs = std::filesystem; |
13 | 25 |
|
| 26 | +static codeql::Logger& logger() { |
| 27 | + static codeql::Logger ret{"project"}; |
| 28 | + return ret; |
| 29 | +} |
| 30 | + |
14 | 31 | struct TargetData { |
15 | 32 | std::string workspace; |
16 | 33 | std::string project; |
@@ -253,7 +270,7 @@ std::vector<Target> collectTargets(const std::string& workingDir) { |
253 | 270 | // Getting a list of workspaces and the project that belong to them |
254 | 271 | auto workspaces = collectWorkspaces(workingDir); |
255 | 272 | if (workspaces.empty()) { |
256 | | - std::cerr << "[xcode autobuilder] Xcode project or workspace not found\n"; |
| 273 | + DIAGNOSE_ERROR(no_project_found, "No Xcode project or workspace was found"); |
257 | 274 | exit(1); |
258 | 275 | } |
259 | 276 |
|
|
0 commit comments