summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/setup_utils.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-09-24 10:04:03 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-09-24 11:13:14 +0200
commitf0d5b0423de0eb72cda0b5624ac28d72bf65cffd (patch)
tree3d5dae98188f81b07266aa81a450f5c87e9d7f29 /src/other_tools/just_mr/setup_utils.hpp
parent1f99796d6f808f006dff6dc6576910bef493e244 (diff)
downloadjustbuild-f0d5b0423de0eb72cda0b5624ac28d72bf65cffd.tar.gz
Repository setup: Warn about unknown keys
Warn if a repository definition contains unknown keys (that are therefore ignored), as this often indicates a typo in the repository specification. However, for some common naming of extensions (currently: "bootstrap") keep the warning at a level below the default for reporting.
Diffstat (limited to 'src/other_tools/just_mr/setup_utils.hpp')
-rw-r--r--src/other_tools/just_mr/setup_utils.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/setup_utils.hpp b/src/other_tools/just_mr/setup_utils.hpp
index 66691441..e29df4a6 100644
--- a/src/other_tools/just_mr/setup_utils.hpp
+++ b/src/other_tools/just_mr/setup_utils.hpp
@@ -18,6 +18,7 @@
#include <filesystem>
#include <memory>
#include <optional>
+#include <set>
#include <string>
#include <vector>
@@ -35,6 +36,22 @@ std::vector<std::string> const kAltDirs = {"target_root",
"rule_root",
"expression_root"};
+auto const kRepositoryExpectedFields =
+ std::unordered_set<std::string>{"bindings",
+ "expression_file_name",
+ "expression_root",
+ "repository",
+ "rule_file_name",
+ "rule_root",
+ "target_file_name",
+ "target_root"};
+
+// Substrings in repository field names that indicate commonly-used
+// additional keys not used by just-mr but deliberately added by the
+// author of the repository configuration.
+auto const kRepositoryPossibleFieldTrunks =
+ std::vector<std::string>{"bootstrap", "doc", "extra"};
+
namespace JustMR {
struct SetupRepos {