diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-01 17:44:23 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-11 14:52:07 +0200 |
commit | 2bc6d309c00161b2315b9f98645810699fff3126 (patch) | |
tree | 8185d375463e79b39485448920fa68cca2a206a2 /src/buildtool/common/action_description.hpp | |
parent | abae1d3c8032fec872bda44de7f7d754654cf201 (diff) | |
download | justbuild-2bc6d309c00161b2315b9f98645810699fff3126.tar.gz |
Use HashFunction::Type to deserialize ArtifactDescription
Diffstat (limited to 'src/buildtool/common/action_description.hpp')
-rw-r--r-- | src/buildtool/common/action_description.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildtool/common/action_description.hpp b/src/buildtool/common/action_description.hpp index 2ae7ad8a..f4756688 100644 --- a/src/buildtool/common/action_description.hpp +++ b/src/buildtool/common/action_description.hpp @@ -26,6 +26,7 @@ #include "nlohmann/json.hpp" #include "src/buildtool/common/action.hpp" #include "src/buildtool/common/artifact_description.hpp" +#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/utils/cpp/json.hpp" @@ -45,7 +46,8 @@ class ActionDescription { action_{std::move(action)}, inputs_{std::move(inputs)} {} - [[nodiscard]] static auto FromJson(std::string const& id, + [[nodiscard]] static auto FromJson(HashFunction::Type hash_type, + std::string const& id, nlohmann::json const& desc) noexcept -> std::optional<ActionDescription::Ptr> { try { @@ -119,7 +121,8 @@ class ActionDescription { inputs_t inputs{}; for (auto const& [path, input_desc] : input.items()) { - auto artifact = ArtifactDescription::FromJson(input_desc); + auto artifact = + ArtifactDescription::FromJson(hash_type, input_desc); if (not artifact) { return std::nullopt; } |