Swift: address code review comments

This commit is contained in:
Alex Denisov
2023-08-22 10:01:16 +02:00
parent b98a966729
commit 48607e3ad7
2 changed files with 4 additions and 5 deletions

View File

@@ -59,14 +59,13 @@ static bool run_build_command(const std::vector<std::string>& argv, bool dryRun)
DIAGNOSE_ERROR(buildCommandFailed,
"`autobuild` failed to run the build command:\n\n```\n{}\n```",
absl::StrJoin(argv, " "));
codeql::Log::flush();
return false;
}
}
return true;
}
bool buildXcodeTarget(XcodeTarget& target, bool dryRun) {
bool buildXcodeTarget(const XcodeTarget& target, bool dryRun) {
std::vector<std::string> argv({"/usr/bin/xcodebuild", "build"});
if (!target.workspace.empty()) {
argv.push_back("-workspace");
@@ -103,7 +102,7 @@ static void carthage_install(const std::string& carthage,
run_build_command(argv, dryRun);
}
void installDependencies(ProjectStructure& target, bool dryRun) {
void installDependencies(const ProjectStructure& target, bool dryRun) {
auto pod = std::string(getenv("CODEQL_SWIFT_POD_EXEC") ?: "");
auto carthage = std::string(getenv("CODEQL_SWIFT_CARTHAGE_EXEC") ?: "");
if (!pod.empty() && !target.podfiles.empty()) {

View File

@@ -4,6 +4,6 @@
#include "swift/xcode-autobuilder/XcodeProjectParser.h"
#include <filesystem>
void installDependencies(ProjectStructure& target, bool dryRun);
bool buildXcodeTarget(XcodeTarget& target, bool dryRun);
void installDependencies(const ProjectStructure& target, bool dryRun);
bool buildXcodeTarget(const XcodeTarget& target, bool dryRun);
bool buildSwiftPackage(const std::filesystem::path& packageFile, bool dryRun);