19
19
namespace {
20
20
21
21
constexpr const char *const kGenerateTaskName = " Generate" ;
22
+ constexpr const char *const kProjectRootDirName = " project_root_dir" ;
23
+ constexpr const char *const kProjectBuildDirName = " project_build_dir" ;
24
+ constexpr const char *const kCurrentRootDirName = " current_root_dir" ;
25
+ constexpr const char *const kCurrentBuildDirName = " current_build_dir" ;
22
26
23
27
} // namespace
24
28
@@ -42,24 +46,21 @@ CustomGenerator::Get(const std::string &file_identifier) const {
42
46
}
43
47
44
48
void CustomGenerator::AddGenInfo (
45
- const std::string &id, const fs_unordered_set &inputs,
46
- const fs_unordered_set &outputs, const GenerateCb &generate_cb,
49
+ const std::string &id, const std::unordered_set<std::string> &inputs,
50
+ const std::unordered_set<std::string> &outputs,
51
+ const GenerateCb &generate_cb,
47
52
std::shared_ptr<CustomBlobHandler> blob_handler) {
48
53
env::assert_fatal (user_.gen_info_map .find (id) == user_.gen_info_map .end (),
49
54
fmt::format (" Duplicate id {} detected" , id));
50
55
ASSERT_FATAL (generate_cb, " Invalid callback provided" );
51
56
52
57
UserGenInfo schema;
53
58
for (const auto &i : inputs) {
54
- fs::path input =
55
- internal::Path::CreateNewPath (command_.Construct (path_as_string (i)))
56
- .GetPathname ();
59
+ fs::path input = string_as_path (command_.Construct (i));
57
60
schema.inputs .emplace (std::move (input));
58
61
}
59
62
for (const auto &o : outputs) {
60
- fs::path output =
61
- internal::Path::CreateNewPath (command_.Construct (path_as_string (o)))
62
- .GetPathname ();
63
+ fs::path output = string_as_path (command_.Construct (o));
63
64
schema.outputs .emplace (std::move (output));
64
65
}
65
66
schema.generate_cb = generate_cb;
@@ -109,10 +110,10 @@ void CustomGenerator::Initialize() {
109
110
//
110
111
fs::create_directories (env_.GetTargetBuildDir ());
111
112
command_.AddDefaultArguments ({
112
- {" project_root_dir " , path_as_string (Project::GetRootDir ())},
113
- {" project_build_dir " , path_as_string (Project::GetBuildDir ())},
114
- {" gen_root_dir " , path_as_string (env_.GetTargetRootDir ())},
115
- {" gen_build_dir " , path_as_string (env_.GetTargetBuildDir ())},
113
+ {kProjectRootDirName , path_as_string (Project::GetRootDir ())},
114
+ {kProjectBuildDirName , path_as_string (Project::GetBuildDir ())},
115
+ {kCurrentRootDirName , path_as_string (env_.GetTargetRootDir ())},
116
+ {kCurrentBuildDirName , path_as_string (env_.GetTargetBuildDir ())},
116
117
});
117
118
118
119
//
0 commit comments