diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-05 11:55:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-05 11:55:15 +0200 |
commit | 9fb791e9fad6c63fc1dac49f4d05ae63b8a3db9b (patch) | |
tree | d60322d4382ca5f97b676c5abe2e39524f35eab4 /build/dist/module.cxx | |
parent | f159b1dac68c8714f7ba71ca168e3b695891aad9 (diff) |
Rename build directory/namespace to build2
Diffstat (limited to 'build/dist/module.cxx')
-rw-r--r-- | build/dist/module.cxx | 142 |
1 files changed, 0 insertions, 142 deletions
diff --git a/build/dist/module.cxx b/build/dist/module.cxx deleted file mode 100644 index f39ef18..0000000 --- a/build/dist/module.cxx +++ /dev/null @@ -1,142 +0,0 @@ -// file : build/dist/module.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include <build/dist/module> - -#include <build/scope> -#include <build/file> -#include <build/diagnostics> - -#include <build/config/utility> - -#include <build/dist/rule> -#include <build/dist/operation> - -using namespace std; -using namespace butl; - -namespace build -{ - namespace dist - { - static rule rule_; - - extern "C" void - dist_boot (scope& r, const location&, unique_ptr<module>&) - { - tracer trace ("dist::boot"); - - level5 ([&]{trace << "for " << r.out_path ();}); - - // Register meta-operation. - // - r.meta_operations.insert (dist_id, dist); - } - - extern "C" bool - dist_init (scope& r, - scope&, - const location& l, - unique_ptr<module>&, - bool first, - bool) - { - tracer trace ("dist::init"); - - if (!first) - { - warn (l) << "multiple dist module initializations"; - return true; - } - - const dir_path& out_root (r.out_path ()); - level5 ([&]{trace << "for " << out_root;}); - - // Enter module variables. - // - if (first) - { - auto& v (var_pool); - - v.find ("dist", bool_type); - - v.find ("dist.package", string_type); - - v.find ("dist.root", dir_path_type); - v.find ("config.dist.root", dir_path_type); - - //@@ VAR type - // - v.find ("dist.cmd", string_type); - v.find ("config.dist.cmd", string_type); - - v.find ("dist.archives", strings_type); - v.find ("config.dist.archives", strings_type); - } - - // Register our wildcard rule. Do it explicitly for the alias - // to prevent something like insert<target>(dist_id, test_id) - // taking precedence. - // - r.rules.insert<target> (dist_id, 0, "dist", rule_); - r.rules.insert<alias> (dist_id, 0, "dist.alias", rule_); - - // Configuration. - // - // Note that we don't use any defaults for root -- the location - // must be explicitly specified or we will complain if and when - // we try to dist. - // - using namespace config; - - bool s (specified (r, "config.dist")); - - // dist.root - // - { - value& v (r.assign ("dist.root")); - - if (s) - { - const value& cv (optional_absolute (r, "config.dist.root")); - - if (cv && !cv.empty ()) - v = cv; - } - } - - // dist.cmd - // - { - value& v (r.assign ("dist.cmd")); - - if (s) - { - const value& cv (required (r, "config.dist.cmd", "install").first); - - if (cv && !cv.empty ()) - v = cv; - } - else - v = "install"; - } - - // dist.archives - // - { - value& v (r.assign ("dist.archives")); - - if (s) - { - const value& cv (optional (r, "config.dist.archives")); - - if (cv && !cv.empty ()) - v = cv; - } - } - - return true; - } - } -} |