aboutsummaryrefslogtreecommitdiff
path: root/build2/version
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-20 13:46:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-03 14:35:45 +0200
commit934f2a9a90c5cad3cdc8a66b50c17827a3ddbcee (patch)
treef35f106e5369e98350327c79080c571195234c0b /build2/version
parent280f4a5bf787587227ca193cd59c6bd74091db70 (diff)
Get rid of action rule override semantics
Instead we now have two more or less separate match states for outer and inner parts of an action.
Diffstat (limited to 'build2/version')
-rw-r--r--build2/version/init.cxx16
-rw-r--r--build2/version/rule.cxx22
-rw-r--r--build2/version/rule.hxx12
3 files changed, 25 insertions, 25 deletions
diff --git a/build2/version/init.cxx b/build2/version/init.cxx
index 63e32ab..7b8bd01 100644
--- a/build2/version/init.cxx
+++ b/build2/version/init.cxx
@@ -27,8 +27,8 @@ namespace build2
{
static const path manifest ("manifest");
- static const version_doc version_doc_;
- static const version_in version_in_;
+ static const doc_rule doc_rule_;
+ static const in_rule in_rule_;
bool
boot (scope& rs, const location& l, unique_ptr<module_base>& mod)
@@ -311,13 +311,13 @@ namespace build2
{
auto& r (rs.rules);
- r.insert<doc> (perform_update_id, "version.doc", version_doc_);
- r.insert<doc> (perform_clean_id, "version.doc", version_doc_);
- r.insert<doc> (configure_update_id, "version.doc", version_doc_);
+ r.insert<doc> (perform_update_id, "version.doc", doc_rule_);
+ r.insert<doc> (perform_clean_id, "version.doc", doc_rule_);
+ r.insert<doc> (configure_update_id, "version.doc", doc_rule_);
- r.insert<file> (perform_update_id, "version.in", version_in_);
- r.insert<file> (perform_clean_id, "version.in", version_in_);
- r.insert<file> (configure_update_id, "version.in", version_in_);
+ r.insert<file> (perform_update_id, "version.in", in_rule_);
+ r.insert<file> (perform_clean_id, "version.in", in_rule_);
+ r.insert<file> (configure_update_id, "version.in", in_rule_);
}
return true;
diff --git a/build2/version/rule.cxx b/build2/version/rule.cxx
index 9e127ca..bbfe1f6 100644
--- a/build2/version/rule.cxx
+++ b/build2/version/rule.cxx
@@ -45,12 +45,12 @@ namespace build2
return d == rs.src_path ();
}
- // version_doc
+ // doc_rule
//
- match_result version_doc::
+ bool doc_rule::
match (action a, target& xt, const string&) const
{
- tracer trace ("version::version_doc::match");
+ tracer trace ("version::doc_rule::match");
doc& t (static_cast<doc&> (xt));
@@ -76,7 +76,7 @@ namespace build2
return false;
}
- recipe version_doc::
+ recipe doc_rule::
apply (action a, target& xt) const
{
doc& t (static_cast<doc&> (xt));
@@ -101,7 +101,7 @@ namespace build2
}
}
- target_state version_doc::
+ target_state doc_rule::
perform_update (action a, const target& xt)
{
const doc& t (xt.as<const doc&> ());
@@ -168,12 +168,12 @@ namespace build2
return target_state::changed;
}
- // version_in
+ // in_rule
//
- match_result version_in::
+ bool in_rule::
match (action a, target& xt, const string&) const
{
- tracer trace ("version::version_in::match");
+ tracer trace ("version::in_rule::match");
file& t (static_cast<file&> (xt));
const scope& rs (t.root_scope ());
@@ -195,7 +195,7 @@ namespace build2
return fm && fi;
}
- recipe version_in::
+ recipe in_rule::
apply (action a, target& xt) const
{
file& t (static_cast<file&> (xt));
@@ -220,10 +220,10 @@ namespace build2
}
}
- target_state version_in::
+ target_state in_rule::
perform_update (action a, const target& xt)
{
- tracer trace ("version::version_in::perform_update");
+ tracer trace ("version::in_rule::perform_update");
const file& t (xt.as<const file&> ());
const path& tp (t.path ());
diff --git a/build2/version/rule.hxx b/build2/version/rule.hxx
index e686694..9172ba3 100644
--- a/build2/version/rule.hxx
+++ b/build2/version/rule.hxx
@@ -16,12 +16,12 @@ namespace build2
{
// Generate a version file.
//
- class version_doc: public rule
+ class doc_rule: public rule
{
public:
- version_doc () {}
+ doc_rule () {}
- virtual match_result
+ virtual bool
match (action, target&, const string&) const override;
virtual recipe
@@ -33,12 +33,12 @@ namespace build2
// Preprocess an .in file.
//
- class version_in: public rule
+ class in_rule: public rule
{
public:
- version_in () {}
+ in_rule () {}
- virtual match_result
+ virtual bool
match (action, target&, const string&) const override;
virtual recipe