diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-04-14 12:20:55 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-04-14 14:37:07 +0200 |
commit | 2fa19d98f7e4024da9dc6c9bb8f0071f966c3ae7 (patch) | |
tree | 83657ce4b5322138a5e53d90d64dc3024dd553f1 /src/other_tools/just_mr/utils.hpp | |
parent | ec4820b68c6c6957cf621f5339164ff28861ef1d (diff) | |
download | justbuild-2fa19d98f7e4024da9dc6c9bb8f0071f966c3ae7.tar.gz |
just-mr support -D option
Make just-mr unconditionally support an option -D that collects a
configuration overlay and forwards it to the invocation of a just
subcommand that supports this option. This syntax-switching facility
makes it easy to embedd dynamic parts of the configuration (like
the head commit to be part of a version string) as those information
can unconditionally be the first argument to just-mr.
Diffstat (limited to 'src/other_tools/just_mr/utils.hpp')
-rw-r--r-- | src/other_tools/just_mr/utils.hpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/other_tools/just_mr/utils.hpp b/src/other_tools/just_mr/utils.hpp index a7d43415..d992a895 100644 --- a/src/other_tools/just_mr/utils.hpp +++ b/src/other_tools/just_mr/utils.hpp @@ -49,18 +49,42 @@ struct JustSubCmdFlags { bool config; bool build_root; bool launch; + bool defines; }; // ordered, so that we have replicability std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ - {"version", {false /*config*/, false /*build_root*/, false /*launch*/}}, - {"describe", {true /*config*/, false /*build_root*/, false /*launch*/}}, - {"analyse", {true /*config*/, true /*build_root*/, false /*launch*/}}, - {"build", {true /*config*/, true /*build_root*/, true /*launch*/}}, - {"install", {true /*config*/, true /*build_root*/, true /*launch*/}}, - {"rebuild", {true /*config*/, true /*build_root*/, true /*launch*/}}, - {"install-cas", {false /*config*/, true /*build_root*/, false /*launch*/}}, - {"gc", {false /*config*/, true /*build_root*/, false /*launch*/}}}; + {"version", + {false /*config*/, + false /*build_root*/, + false /*launch*/, + false /*defines*/}}, + {"describe", + {true /*config*/, + false /*build_root*/, + false /*launch*/, + true /*defines*/}}, + {"analyse", + {true /*config*/, + true /*build_root*/, + false /*launch*/, + true /*defines*/}}, + {"build", + {true /*config*/, true /*build_root*/, true /*launch*/, true /*defines*/}}, + {"install", + {true /*config*/, true /*build_root*/, true /*launch*/, true /*defines*/}}, + {"rebuild", + {true /*config*/, true /*build_root*/, true /*launch*/, true /*defines*/}}, + {"install-cas", + {false /*config*/, + true /*build_root*/, + false /*launch*/, + false /*defines*/}}, + {"gc", + {false /*config*/, + true /*build_root*/, + false /*launch*/, + false /*defines*/}}}; nlohmann::json const kDefaultConfigLocations = nlohmann::json::array( {{{"root", "workspace"}, {"path", "repos.json"}}, |