21 const std::filesystem::path wmtk_spec_file = WMTK_APP_INPUT_SPEC;
22 nlohmann::json rules_json;
24 std::ifstream f(wmtk_spec_file);
27 "Could not open wmtk specification file: {}",
28 wmtk_spec_file.string());
30 rules_json = nlohmann::json::parse(f);
34 spec_engine.strict = strict;
37#include <spec_include.hpp>
38 rules_json = spec_engine.inject_include(rules_json);
41 nlohmann::json spec_json;
42 bool r = spec_engine.verify_json(json_input_file, rules_json);
46 spec_json = spec_engine.inject_defaults(json_input_file, rules_json);
57 wmtk::logger().set_level(spec_json[
"settings"][
"log_level"]);
61 const std::string root_path = spec_json[
"root_path"];
63 const std::string output_dir =
64 wmtk::utils::resolve_path(spec_json[
"output"][
"directory"], root_path,
false);
65 if (!output_dir.empty()) {
66 std::filesystem::create_directories(output_dir);
71 std::function<void(
const utils::Paths&,
const nlohmann::json&,
wmtk::io::Cache&)>>
76#include <components_map.hpp>
79 paths.root_path = root_path;
80 paths.output_dir = output_dir;
82 logger().info(
"Root path: {}, output dir: {}", root_path, output_dir);
88 for (
const nlohmann::json& component_json : spec_json[
"components"]) {
89 for (
auto& el : component_json.items()) {
92 components[el.key()](paths, el.value(), cache);