aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/adhoc-rule-buildscript.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/adhoc-rule-buildscript.hxx')
-rw-r--r--libbuild2/adhoc-rule-buildscript.hxx76
1 files changed, 66 insertions, 10 deletions
diff --git a/libbuild2/adhoc-rule-buildscript.hxx b/libbuild2/adhoc-rule-buildscript.hxx
index b863d77..336dceb 100644
--- a/libbuild2/adhoc-rule-buildscript.hxx
+++ b/libbuild2/adhoc-rule-buildscript.hxx
@@ -18,26 +18,71 @@ namespace build2
//
// Note: not exported and should not be used directly (i.e., registered).
//
- class adhoc_buildscript_rule: public adhoc_rule
+ class adhoc_buildscript_rule: public adhoc_rule,
+ public adhoc_rule_with_deadline
{
public:
virtual bool
- match (action, target&, const string&, optional<action>) const override;
+ reverse_fallback (action, const target_type&) const override;
+
+ virtual bool
+ match (action, target&, const string&, match_extra&) const override;
virtual recipe
- apply (action, target&) const override;
+ apply (action, target&, match_extra&) const override;
+
+ virtual recipe
+ apply (action, target&, match_extra&,
+ const optional<timestamp>&) const override;
target_state
- perform_update_file (action, const target&) const;
+ perform_update_file_or_group (action, const target&) const;
+
+ struct match_data;
+ struct match_data_byproduct;
target_state
- default_action (action, const target&) const;
+ perform_update_file_or_group_dyndep (
+ action, const target&, match_data&) const;
+
+ target_state
+ perform_update_file_or_group_dyndep_byproduct (
+ action, const target&, match_data_byproduct&) const;
+
+ optional<target_state>
+ execute_update_prerequisites (action, const target&, timestamp) const;
+
+ bool
+ execute_update_file (const scope&,
+ action a, const file&,
+ build::script::environment&,
+ build::script::default_runner&,
+ bool deferred_failure = false) const;
- adhoc_buildscript_rule (const location& l, size_t b)
- : adhoc_rule ("<ad hoc buildscript recipe>", l, b) {}
+ bool
+ execute_update_group (const scope&,
+ action a, const group&,
+ build::script::environment&,
+ build::script::default_runner&,
+ bool deferred_failure = false) const;
+
+ static target_state
+ perform_clean_file (action, const target&);
+
+ static target_state
+ perform_clean_group (action, const target&);
+
+ target_state
+ default_action (action, const target&, const optional<timestamp>&) const;
+
+ adhoc_buildscript_rule (string n, const location& l, size_t b)
+ : adhoc_rule (move (n), l, b) {}
virtual bool
- recipe_text (context&, const target&, string&&, attributes&) override;
+ recipe_text (const scope&,
+ const target_type&,
+ string&&,
+ attributes&) override;
virtual void
dump_attributes (ostream&) const override;
@@ -45,11 +90,22 @@ namespace build2
virtual void
dump_text (ostream&, string&) const override;
+ void
+ print_custom_diag (const scope&, names&&, const location&) const;
+
public:
using script_type = build::script::script;
- script_type script;
- string checksum; // Script text hash.
+ // The prerequisite_target::include bits that indicate update=unmatch and
+ // an ad hoc version of that.
+ //
+ static const uintptr_t include_unmatch = 0x100;
+ static const uintptr_t include_unmatch_adhoc = 0x200;
+
+
+ script_type script;
+ string checksum; // Script text hash.
+ const target_type* ttype; // First target/pattern type.
};
}