diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-11-17 23:41:25 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-11-29 20:53:58 +0300 |
commit | 22059500a799d788c09171e31b668ab8259ec057 (patch) | |
tree | b6b6d31884a2f4d4226a7299c9decd388a426044 /mod/build-config.hxx | |
parent | 2667fad8bf6e7ef6ef1894ab49a3bdc5cc858607 (diff) |
Add support for builds manifest value
Diffstat (limited to 'mod/build-config.hxx')
-rw-r--r-- | mod/build-config.hxx | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/mod/build-config.hxx b/mod/build-config.hxx index cdc7efb..e7ee9eb 100644 --- a/mod/build-config.hxx +++ b/mod/build-config.hxx @@ -6,6 +6,7 @@ #define MOD_BUILD_CONFIG_HXX #include <map> +#include <algorithm> // find() #include <libbbot/build-config.hxx> @@ -21,6 +22,8 @@ // namespace brep { + using bbot::build_config; + // Return pointer to the shared build configurations instance, creating one // on the first call. Throw tab_parsing on parsing error, io_error on the // underlying OS error. Is not thread-safe. @@ -52,17 +55,31 @@ namespace brep string force_rebuild_url (const string& host, const dir_path& root, const build&); - // Match a build configuration against the name and target patterns. + // Check if the configuration belongs to the specified class. // - bool - match (const string& config_pattern, - const optional<string>& target_pattern, - const bbot::build_config&); + inline bool + belongs (const build_config& cfg, const char* cls) + { + const strings& cs (cfg.classes); + return find (cs.begin (), cs.end (), cls) != cs.end (); + } - // Return true if a package excludes the specified build configuration. + // Return true if the specified build configuration is excluded by a package + // based on its underlying build class set, build class expressions, and + // build constraints, potentially extending the underlying set with the + // special classes. Set the exclusion reason if requested. // bool - exclude (const build_package&, const bbot::build_config&); + exclude (const build_class_exprs&, + const build_constraints&, + const build_config&, + string* reason = nullptr); + + inline bool + exclude (const build_package& p, const build_config& c, string* r = nullptr) + { + return exclude (p.builds, p.constraints, c, r); + } } #endif // MOD_BUILD_CONFIG_HXX |