summaryrefslogtreecommitdiffhomepage
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/JSONManifestBuilder.cc8
-rw-r--r--src/lib/TOMLManifestBuilder.cc7
2 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/JSONManifestBuilder.cc b/src/lib/JSONManifestBuilder.cc
index 9de6608..c6ff4d8 100644
--- a/src/lib/JSONManifestBuilder.cc
+++ b/src/lib/JSONManifestBuilder.cc
@@ -4,6 +4,8 @@
// ============================================================= //
#include <NeBuildKit/JSONManifestBuilder.h>
+#include <json/json.h>
+#include <fstream>
using namespace NeBuild;
using namespace nlohmann;
@@ -18,14 +20,14 @@ namespace FS = std::filesystem;
/// @retval true building has succeeded.
/// @retval false fail to build, see error message.
/// =========================================================== ///
-bool JSONManifestBuilder::BuildTarget(const std::string& argv_val, const bool dry_run) {
+bool JSONManifestBuilder::BuildTarget(BuildConfig& config) {
std::string path;
- if (argv_val.empty()) {
+ if (config.path_.empty()) {
NeBuild::Logger::info() << "nebuild: error: file path is empty" << std::endl;
return false;
} else {
- path = argv_val;
+ path = config.path_;
if (!FS::exists(path)) {
NeBuild::Logger::info() << "nebuild: error: file '" << path << "' does not exist"
diff --git a/src/lib/TOMLManifestBuilder.cc b/src/lib/TOMLManifestBuilder.cc
index fc10c88..a58b280 100644
--- a/src/lib/TOMLManifestBuilder.cc
+++ b/src/lib/TOMLManifestBuilder.cc
@@ -4,6 +4,7 @@
// ============================================================= //
#include <NeBuildKit/TOMLManifestBuilder.h>
+#include <toml++/toml.hpp>
#include <filesystem>
using namespace NeBuild;
@@ -17,14 +18,14 @@ namespace FS = std::filesystem;
/// @retval true building has succeeded.
/// @retval false fail to build, see error message.
/// =========================================================== ///
-bool TOMLManifestBuilder::BuildTarget(const std::string& argv_val, const bool dry_run) {
+bool TOMLManifestBuilder::BuildTarget(BuildConfig& config) {
std::string path;
- if (argv_val.empty()) {
+ if (config.path_.empty()) {
NeBuild::Logger::info() << "nebuild: error: file path is empty" << std::endl;
return false;
} else {
- path = argv_val;
+ path = config.path_;
if (!FS::exists(path)) {
NeBuild::Logger::info() << "nebuild: error: file '" << path << "' does not exist"