aboutsummaryrefslogtreecommitdiff
path: root/build2/dist
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-11 07:57:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-11 07:57:19 +0200
commit0342dc2fcdd78ef28a4e59d84193a3807068d726 (patch)
treee750c3062d6ff54f0d409fe1a25984b7e78592c8 /build2/dist
parent5f7c3f923de106f9d204a8f3500274731ae84fd9 (diff)
New configuration logic, iteration 1
Diffstat (limited to 'build2/dist')
-rw-r--r--build2/dist/module4
-rw-r--r--build2/dist/module.cxx30
-rw-r--r--build2/dist/operation.cxx9
3 files changed, 21 insertions, 22 deletions
diff --git a/build2/dist/module b/build2/dist/module
index 829f3f7..61e44c3 100644
--- a/build2/dist/module
+++ b/build2/dist/module
@@ -15,11 +15,11 @@ namespace build2
namespace dist
{
extern "C" void
- dist_boot (scope&, const location&, unique_ptr<module>&);
+ dist_boot (scope&, const location&, unique_ptr<module_base>&);
extern "C" bool
dist_init (
- scope&, scope&, const location&, unique_ptr<module>&, bool, bool);
+ scope&, scope&, const location&, unique_ptr<module_base>&, bool, bool);
}
}
diff --git a/build2/dist/module.cxx b/build2/dist/module.cxx
index 4b68bb8..2a7ba92 100644
--- a/build2/dist/module.cxx
+++ b/build2/dist/module.cxx
@@ -23,7 +23,7 @@ namespace build2
static rule rule_;
extern "C" void
- dist_boot (scope& r, const location&, unique_ptr<module>&)
+ dist_boot (scope& r, const location&, unique_ptr<module_base>&)
{
tracer trace ("dist::boot");
@@ -39,20 +39,18 @@ namespace build2
{
auto& v (var_pool);
- // @@ OVR
+ // Note: some overridable, some not.
+ //
+ v.insert<abs_dir_path> ("config.dist.root", true);
+ v.insert<strings> ("config.dist.archives", true);
+ v.insert<path> ("config.dist.cmd", true);
- v.insert<bool> ("dist");
+ v.insert<dir_path> ("dist.root");
+ v.insert<path> ("dist.cmd");
+ v.insert<strings> ("dist.archives");
- v.insert<string> ("dist.package");
-
- v.insert<dir_path> ("dist.root");
- v.insert<dir_path> ("config.dist.root");
-
- v.insert<path> ("dist.cmd");
- v.insert<path> ("config.dist.cmd");
-
- v.insert<strings> ("dist.archives");
- v.insert<strings> ("config.dist.archives");
+ v.insert<bool> ("dist"); // Flag.
+ v.insert<string> ("dist.package"); // Project's package name.
}
}
@@ -60,7 +58,7 @@ namespace build2
dist_init (scope& r,
scope&,
const location& l,
- unique_ptr<module>&,
+ unique_ptr<module_base>&,
bool first,
bool)
{
@@ -97,10 +95,10 @@ namespace build2
if (s)
{
- const value& cv (config::optional_absolute (r, "config.dist.root"));
+ const value& cv (config::optional (r, "config.dist.root"));
if (cv && !cv.empty ())
- v = cv;
+ v = cast<dir_path> (cv); // Strip abs_dir_path.
}
}
diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx
index 8a890fa..9ae5773 100644
--- a/build2/dist/operation.cxx
+++ b/build2/dist/operation.cxx
@@ -72,7 +72,7 @@ namespace build2
// Make sure we have the necessary configuration before
// we get down to business.
//
- auto l (rs->vars["dist.root"]); //@@ OVR
+ auto l (rs->vars["dist.root"]);
if (!l || l->empty ())
fail << "unknown root distribution directory" <<
@@ -84,14 +84,14 @@ namespace build2
fail << "root distribution directory " << dist_root
<< " does not exist";
- l = rs->vars["dist.package"]; //@@ OVR
+ l = rs->vars["dist.package"];
if (!l || l->empty ())
fail << "unknown distribution package name" <<
info << "did you forget to set dist.package?";
const string& dist_package (cast<string> (l));
- const path& dist_cmd (cast<path> (rs->vars["dist.cmd"])); // @@ OVR
+ const path& dist_cmd (cast<path> (rs->vars["dist.cmd"]));
// Get the list of operations supported by this project. Skip
// default_id.
@@ -281,7 +281,7 @@ namespace build2
// Archive if requested.
//
- if (auto l = rs->vars["dist.archives"]) // @@ OVR
+ if (auto l = rs->vars["dist.archives"])
{
for (const string& e: cast<strings> (l))
archive (dist_root, dist_package, e);
@@ -425,6 +425,7 @@ namespace build2
}
meta_operation_info dist {
+ dist_id,
"dist",
"distribute",
"distributing",