diff options
Diffstat (limited to 'dev/src/JSONManifestBuilder.cc')
| -rw-r--r-- | dev/src/JSONManifestBuilder.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/dev/src/JSONManifestBuilder.cc b/dev/src/JSONManifestBuilder.cc index aa277c7..6b72ff0 100644 --- a/dev/src/JSONManifestBuilder.cc +++ b/dev/src/JSONManifestBuilder.cc @@ -10,7 +10,7 @@ using JSON = nlohmann::json; namespace FS = std::filesystem; -using namespace BTB; +using namespace NeBuild; /// @brief Builds a JSON target from a JSON file. /// @param arg_sz filename size (must be 1 or greater). @@ -21,13 +21,13 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo String path; if (!arg_val || arg_sz < 0) { - BTB::Logger::info() << "nebuild: error: file path is empty" << std::endl; + NeBuild::Logger::info() << "nebuild: error: file path is empty" << std::endl; return false; } else { path += arg_val; if (!FS::exists(path)) { - BTB::Logger::info() << "nebuild: error: file '" << path << "' does not exist" << std::endl; + NeBuild::Logger::info() << "nebuild: error: file '" << path << "' does not exist" << std::endl; return false; } } @@ -36,7 +36,7 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo std::ifstream json(path); if (!json.good()) { - BTB::Logger::info() << "nebuild: error: file '" << path << "' is not a valid JSON" << std::endl; + NeBuild::Logger::info() << "nebuild: error: file '" << path << "' is not a valid JSON" << std::endl; return false; } @@ -76,8 +76,8 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo auto target = json_obj["output_name"].get<String>(); - BTB::Logger::info() << "output path: " << target << "\n"; - BTB::Logger::info() << "command: " << command << "\n"; + NeBuild::Logger::info() << "output path: " << target << "\n"; + NeBuild::Logger::info() << "command: " << command << "\n"; try { if (json_obj["dry_run"].get<bool>()) return true; @@ -91,14 +91,14 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo auto ret_exec = std::system(command.c_str()); if (ret_exec > 0) { - BTB::Logger::info() << "error: exit with message: " << std::strerror(ret_exec) << "" << std::endl; + NeBuild::Logger::info() << "error: exit with message: " << std::strerror(ret_exec) << "" << std::endl; return false; } try { if (json_obj["run_after_build"].get<bool>()) { if (target.ends_with(".so")) { - BTB::Logger::info() << "error: can't open dynamic library, it mayn't have an entrypoint" + NeBuild::Logger::info() << "error: can't open dynamic library, it mayn't have an entrypoint" << std::endl; return true; @@ -109,20 +109,20 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo ss << file.rdbuf(); if (ss.str()[0] == 'O' && ss.str()[1] == 'p' && ss.str()[2] == 'e' && ss.str()[3] == 'n') - BTB::Logger::info() + NeBuild::Logger::info() << "error: can't open PEF dynamic library, it mayn't contain an entrypoint" << std::endl; else if (ss.str()[0] == 'n' && ss.str()[1] == 'e' && ss.str()[2] == 'p' && ss.str()[3] == 'O') - BTB::Logger::info() + NeBuild::Logger::info() << "error: can't open FEP dynamic library, it mayn't contain an entrypoint" << std::endl; else if (ss.str()[0] == 'M' && ss.str()[1] == 'Z') - BTB::Logger::info() + NeBuild::Logger::info() << "error: can't open MZ dynamic library, it mayn't contain an entrypoint" << std::endl; else if (ss.str()[0] == 0x7F && ss.str()[1] == 'E') { - BTB::Logger::info() + NeBuild::Logger::info() << "error: can't open ELF dynamic library, it mayn't contain an entrypoint" << std::endl; } @@ -140,7 +140,7 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo return true; } } catch (std::runtime_error& err) { - BTB::Logger::info() << "error: " << err.what() << std::endl; + NeBuild::Logger::info() << "error: " << err.what() << std::endl; return false; } |
