From 9ec2bdd87659438b4aa021a10c4a4977ef77118e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Jun 2020 06:36:30 +0200 Subject: Add ability to specify ad hoc recipe actions We are reusing the buildspec syntax for that. --- libbuild2/rule.hxx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'libbuild2/rule.hxx') 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. -- cgit v1.1