aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-05 06:36:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-05 06:36:30 +0200
commit9ec2bdd87659438b4aa021a10c4a4977ef77118e (patch)
tree12580b4d0b82bce80047b067c3bb221b49be7449 /libbuild2/rule.hxx
parentd280946474568925016359be742b59fd6c000c52 (diff)
Add ability to specify ad hoc recipe actions
We are reusing the buildspec syntax for that.
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r--libbuild2/rule.hxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx
index a79eeed..c98c29e 100644
--- a/libbuild2/rule.hxx
+++ b/libbuild2/rule.hxx
@@ -153,8 +153,13 @@ namespace build2
virtual bool
match (action, target&, const string&) const override;
+ // Dump support.
+ //
+ virtual void
+ dump_attributes (ostream&) const;
+
virtual void
- dump (ostream&, string& indentation) const = 0;
+ dump_text (ostream&, string& indentation) const = 0;
// Implementation details.
//
@@ -188,14 +193,17 @@ namespace build2
target_state
default_action (action, const target&) const;
- virtual void
- dump (ostream&, string&) const override;
-
adhoc_script_rule (const location& l, size_t b): adhoc_rule (l, b) {}
virtual bool
recipe_text (context&, const target&, string&&, attributes&) override;
+ virtual void
+ dump_attributes (ostream&) const override;
+
+ virtual void
+ dump_text (ostream&, string&) const override;
+
public:
using script_type = build::script::script;
@@ -245,9 +253,6 @@ namespace build2
virtual recipe
apply (action, target&) const override;
- virtual void
- dump (ostream&, string&) const override;
-
adhoc_cxx_rule (const location&, size_t, uint64_t version);
virtual bool
@@ -256,6 +261,9 @@ namespace build2
virtual
~adhoc_cxx_rule () override;
+ virtual void
+ dump_text (ostream&, string&) const override;
+
public:
// Note that this recipe (rule instance) can be shared between multiple
// targets which could all be matched in parallel.