diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-24 09:15:17 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-24 09:15:17 +0100 |
| commit | a3ea256d00e5aac45574c7c8b076b60630f73a95 (patch) | |
| tree | d639c686922140ee0465b27964ce4d2b854b68b7 /dev/BuildKit | |
| parent | bb11d32131e786b40550375005b12bcb31cf25d7 (diff) | |
feat! refactor! Breaking changes of the NeBuild system.
Working on a TOML backend, refactored source code namespace. And add 'toml++' vendor library.
See commit details.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/BuildKit')
| -rw-r--r-- | dev/BuildKit/Defines.h (renamed from dev/BuildKit/Macros.h) | 12 | ||||
| -rw-r--r-- | dev/BuildKit/IManifestBuilder.h | 9 | ||||
| -rw-r--r-- | dev/BuildKit/Imports.h (renamed from dev/BuildKit/Includes.h) | 6 | ||||
| -rw-r--r-- | dev/BuildKit/JSONManifestBuilder.h | 6 | ||||
| -rw-r--r-- | dev/BuildKit/TOMLManifestBuilder.h | 33 |
5 files changed, 50 insertions, 16 deletions
diff --git a/dev/BuildKit/Macros.h b/dev/BuildKit/Defines.h index 98bf891..d408058 100644 --- a/dev/BuildKit/Macros.h +++ b/dev/BuildKit/Defines.h @@ -5,11 +5,7 @@ #pragma once -extern "C" { -#include <assert.h> -} - -#include <rang.h> +#include <BuildKit/Imports.h> #define LIKELY(ARG) ((ARG) ? assert(false) : ((void) 0)) #define UNLIKELY(ARG) LIKELY(!(ARG)) @@ -24,11 +20,11 @@ extern "C" { #define LIBNEBUILD_UNUSED(X) ((void) X) -namespace BTB::Logger { -/// @brief replacement for std::cout for BTB logging. +namespace NeBuild::Logger { +/// @brief replacement for std::cout for NeBuild logging. inline std::ostream& info() noexcept { auto& out = std::cout; out << rang::fg::red << "nebuild: " << rang::style::reset; return out; } -} // namespace BTB::Logger +} // namespace NeBuild::Logger diff --git a/dev/BuildKit/IManifestBuilder.h b/dev/BuildKit/IManifestBuilder.h index 065bec3..a0e5d85 100644 --- a/dev/BuildKit/IManifestBuilder.h +++ b/dev/BuildKit/IManifestBuilder.h @@ -5,12 +5,11 @@ #pragma once -#include <BuildKit/Includes.h> -#include <BuildKit/Macros.h> +#include <BuildKit/Defines.h> -#define NEBUILD_MANIFEST_BUILDER : public BTB::IManifestBuilder +#define NEBUILD_MANIFEST_BUILDER : public NeBuild::IManifestBuilder -namespace BTB { +namespace NeBuild { /// @brief Builder interface class. /// @note This class is meant to be used as an interface. class IManifestBuilder { @@ -29,4 +28,4 @@ class IManifestBuilder { virtual bool buildTarget(int arg_sz, const char* arg_val, const bool dry_run = false) = 0; virtual const char* buildSystem() = 0; }; -} // namespace BTB
\ No newline at end of file +} // namespace NeBuild
\ No newline at end of file diff --git a/dev/BuildKit/Includes.h b/dev/BuildKit/Imports.h index 4cb3043..b365dca 100644 --- a/dev/BuildKit/Includes.h +++ b/dev/BuildKit/Imports.h @@ -14,4 +14,10 @@ #include <string> #include <thread> +extern "C" { +#include <assert.h> +} + +#include <rang.h> + #endif // NEBUILD_INCLUDES_H diff --git a/dev/BuildKit/JSONManifestBuilder.h b/dev/BuildKit/JSONManifestBuilder.h index f7c769d..ba34a69 100644 --- a/dev/BuildKit/JSONManifestBuilder.h +++ b/dev/BuildKit/JSONManifestBuilder.h @@ -6,12 +6,12 @@ #pragma once #include <BuildKit/IManifestBuilder.h> -#include <json.h> +#include <json/json.h> /// @file JSONManifestBuilder.h /// @brief JSON manifest builder header file. -namespace BTB { +namespace NeBuild { /// @brief JSON builder class JSONManifestBuilder final NEBUILD_MANIFEST_BUILDER { public: @@ -30,4 +30,4 @@ class JSONManifestBuilder final NEBUILD_MANIFEST_BUILDER { bool buildTarget(int arg_sz, const char* arg_val, const bool dry_run = false) override; const char* buildSystem() override; }; -} // namespace BTB
\ No newline at end of file +} // namespace NeBuild
\ No newline at end of file diff --git a/dev/BuildKit/TOMLManifestBuilder.h b/dev/BuildKit/TOMLManifestBuilder.h new file mode 100644 index 0000000..5037967 --- /dev/null +++ b/dev/BuildKit/TOMLManifestBuilder.h @@ -0,0 +1,33 @@ +// ============================================================= // +// nebuild +// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. +// ============================================================= // + +#pragma once + +#include <BuildKit/IManifestBuilder.h> +#include <toml++/toml.hpp> + +/// @file TOMLManifestBuilder.h +/// @brief TOML manifest builder header file. + +namespace NeBuild { +/// @brief TOML builder +class TOMLManifestBuilder final NEBUILD_MANIFEST_BUILDER { + public: + TOMLManifestBuilder() = default; + ~TOMLManifestBuilder() override = default; + + TOMLManifestBuilder& operator=(const TOMLManifestBuilder&) = default; + TOMLManifestBuilder(const TOMLManifestBuilder&) = default; + + public: + /// @brief Builds a TOML target. + /// @param arg_sz filename size + /// @param arg_val filename path. + /// @retval true build succeeded. + /// @retval false failed to build. + bool buildTarget(int arg_sz, const char* arg_val, const bool dry_run = false) override; + const char* buildSystem() override; +}; +} // namespace NeBuild
\ No newline at end of file |
