From 294c558d577cd4acb2ee8e94e0dfd6acdb946c6c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 7 Dec 2018 23:12:05 +0300 Subject: Add support for build configuration class inheritance --- mod/mod-build-configs.cxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'mod/mod-build-configs.cxx') diff --git a/mod/mod-build-configs.cxx b/mod/mod-build-configs.cxx index 99a092d..826bb87 100644 --- a/mod/mod-build-configs.cxx +++ b/mod/mod-build-configs.cxx @@ -11,7 +11,6 @@ #include #include -#include using namespace std; using namespace bbot; @@ -24,8 +23,8 @@ using namespace brep::cli; brep::build_configs:: build_configs (const build_configs& r) : handler (r), - options_ (r.initialized_ ? r.options_ : nullptr), - build_conf_ (r.initialized_ ? r.build_conf_ : nullptr) + build_config_module (r), + options_ (r.initialized_ ? r.options_ : nullptr) { } @@ -38,15 +37,7 @@ init (scanner& s) s, unknown_mode::fail, unknown_mode::fail); if (options_->build_config_specified ()) - try - { - build_conf_ = shared_build_config (options_->build_config ()); - } - catch (const io_error& e) - { - fail << "unable to read build configuration '" - << options_->build_config () << "': " << e; - } + build_config_module::init (static_cast (*options_)); } bool brep::build_configs:: @@ -133,7 +124,17 @@ handle (request& rq, response& rs) { if (!classes.empty ()) classes += ' '; + classes += cls; + + // Append the base class, if present. + // + auto i (build_conf_->class_inheritance_map.find (cls)); + if (i != build_conf_->class_inheritance_map.end ()) + { + classes += ':'; + classes += i->second; + } } s << TABLE(CLASS="proplist config") -- cgit v1.1