From 0bfe4e8c4d3f33a60143e804a0c91cb87e03625e Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 10 Jun 2024 12:42:37 +0200 Subject: Move creation of TargetCacheKey description to TargetCache ...to use corresponding Storage for storing auxiliary information. --- src/buildtool/storage/target_cache.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/buildtool/storage/target_cache.hpp') diff --git a/src/buildtool/storage/target_cache.hpp b/src/buildtool/storage/target_cache.hpp index e54c2e42..b20b71e3 100644 --- a/src/buildtool/storage/target_cache.hpp +++ b/src/buildtool/storage/target_cache.hpp @@ -22,6 +22,8 @@ #include "gsl/gsl" #include "nlohmann/json.hpp" +#include "src/buildtool/build_engine/base_maps/entity_name_data.hpp" +#include "src/buildtool/build_engine/expression/configuration.hpp" #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/file_system/file_storage.hpp" #include "src/buildtool/file_system/object_type.hpp" @@ -93,6 +95,15 @@ class TargetCache { TargetCacheEntry const& value, ArtifactDownloader const& downloader) const noexcept -> bool; + /// \brief Calculate TargetCacheKey based on auxiliary information. + /// Doesn't create a TargetCacheEntry in the TargetCache. + /// \return TargetCacheKey on success. + [[nodiscard]] auto ComputeKey( + std::string const& repo_key, + BuildMaps::Base::NamedTarget const& target_name, + Configuration const& effective_config) const noexcept + -> std::optional; + /// \brief Read existing entry and object info from the target cache. /// \param key The target-cache key to read the entry from. /// \param shard Optional explicit shard, if the default is not intended. -- cgit v1.2.3