From 4e6fd1dd8c9762ea6543ec275fe57ca474f23d8f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 9 Dec 2025 20:35:28 +0100 Subject: chore: codebase modernization and hygiene improvements. Signed-off-by: Amlal El Mahrouss --- src/lib/JSONManifestBuilder.cc | 11 ++++++----- src/lib/TOMLManifestBuilder.cc | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src/lib') diff --git a/src/lib/JSONManifestBuilder.cc b/src/lib/JSONManifestBuilder.cc index c6ff4d8..af69176 100644 --- a/src/lib/JSONManifestBuilder.cc +++ b/src/lib/JSONManifestBuilder.cc @@ -7,10 +7,8 @@ #include #include -using namespace NeBuild; -using namespace nlohmann; - -using JSON = json; +namespace NeBuild { +using JSON = nlohmann::json; namespace FS = std::filesystem; /// =========================================================== /// @@ -95,10 +93,12 @@ bool JSONManifestBuilder::BuildTarget(BuildConfig& config) { if (ret_exec > 0) { NeBuild::Logger::info() << "error: exit with message: " << std::strerror(ret_exec) << "" << std::endl; + config.has_failed_ = true; return false; } } catch (std::runtime_error& err) { NeBuild::Logger::info() << "error: exit with message: " << err.what() << "" << std::endl; + config.has_failed_ = true; return false; } @@ -108,6 +108,7 @@ bool JSONManifestBuilder::BuildTarget(BuildConfig& config) { /// =========================================================== /// /// @brief Returns the build system name. /// =========================================================== /// -const char* JSONManifestBuilder::BuildSystem() { +const std::string_view JSONManifestBuilder::BuildSystem() { return "NeBuild (JSON)"; } +} // namespace NeBuild \ No newline at end of file diff --git a/src/lib/TOMLManifestBuilder.cc b/src/lib/TOMLManifestBuilder.cc index a58b280..5b759fc 100644 --- a/src/lib/TOMLManifestBuilder.cc +++ b/src/lib/TOMLManifestBuilder.cc @@ -4,11 +4,10 @@ // ============================================================= // #include -#include #include +#include -using namespace NeBuild; - +namespace NeBuild { namespace FS = std::filesystem; /// =========================================================== /// @@ -98,10 +97,12 @@ bool TOMLManifestBuilder::BuildTarget(BuildConfig& config) { if (ret_exec > 0) { NeBuild::Logger::info() << "error: exit with message: " << std::strerror(ret_exec) << "" << std::endl; + config.has_failed_ = true; return false; } } catch (std::runtime_error& err) { NeBuild::Logger::info() << "error: exit with message: " << err.what() << "" << std::endl; + config.has_failed_ = true; return false; } @@ -111,6 +112,7 @@ bool TOMLManifestBuilder::BuildTarget(BuildConfig& config) { /// =========================================================== /// /// @brief Returns the build system name. /// =========================================================== /// -const char* TOMLManifestBuilder::BuildSystem() { +const std::string_view TOMLManifestBuilder::BuildSystem() { return "NeBuild (TOML)"; } +} // namespace NeBuild \ No newline at end of file -- cgit v1.2.3