From c1dc06dfd1d329f8c6499dbe2166725ab9c35e17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jul 2018 15:31:13 +0200 Subject: Implement bash module --- build2/algorithm.hxx | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'build2/algorithm.hxx') diff --git a/build2/algorithm.hxx b/build2/algorithm.hxx index 93fe131..22b8471 100644 --- a/build2/algorithm.hxx +++ b/build2/algorithm.hxx @@ -289,18 +289,34 @@ namespace build2 match_inner (action, const target&, unmatch); // The standard prerequisite search and match implementations. They call - // search() and then match() for each prerequisite in a loop omitting out of - // project prerequisites for the clean operation. If this target is a member - // of a group, then they first do this to the group's prerequisites. + // search() (unless a custom is provided) and then match() (unless custom + // returned NULL) for each prerequisite in a loop omitting out of project + // prerequisites for the clean operation. If this target is a member of a + // group, then first do this to the group's prerequisites. // + using match_search =function< + prerequisite_target (action, + const target&, + const prerequisite&, + include_type)>; + void - match_prerequisites (action, target&); + match_prerequisites (action, target&, const match_search& = nullptr); - // If we are cleaning, this function doesn't go into group members, - // as an optimization (the group should clean everything up). + // As above but go into group members. + // + // Note that if we cleaning, this function doesn't go into group members, as + // an optimization (the group should clean everything up). // + using match_search_member = function< + prerequisite_target (action, + const target&, + const prerequisite_member&, + include_type)>; + void - match_prerequisite_members (action, target&); + match_prerequisite_members (action, target&, + const match_search_member& = nullptr); // As above but omit prerequisites that are not in the specified scope. // @@ -495,12 +511,12 @@ namespace build2 // Note that because we use mtime, this function should normally only be // used in the perform_update action (which is straight). // - using prerequisite_filter = function; + using execute_filter = function; optional execute_prerequisites (action, const target&, const timestamp&, - const prerequisite_filter& = nullptr, + const execute_filter& = nullptr, size_t count = 0); // Another version of the above that does two extra things for the caller: @@ -514,14 +530,14 @@ namespace build2 pair, const T&> execute_prerequisites (action, const target&, const timestamp&, - const prerequisite_filter& = nullptr, + const execute_filter& = nullptr, size_t count = 0); pair, const target&> execute_prerequisites (const target_type&, action, const target&, const timestamp&, - const prerequisite_filter& = nullptr, + const execute_filter& = nullptr, size_t count = 0); template @@ -529,7 +545,7 @@ namespace build2 execute_prerequisites (const target_type&, action, const target&, const timestamp&, - const prerequisite_filter& = nullptr, + const execute_filter& = nullptr, size_t count = 0); // Execute members of a group or similar prerequisite-like dependencies. -- cgit v1.1