diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-24 11:31:42 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-27 15:03:20 +0100 |
commit | cf04253130030bc28866d10aa1f8fe1353643d42 (patch) | |
tree | ef7049624771866455105a8dab7b001840139701 /src/buildtool/common/repository_config.hpp | |
parent | bc09302c2772c979c45ecc716c36e4a70bb484ac (diff) | |
download | justbuild-cf04253130030bc28866d10aa1f8fe1353643d42.tar.gz |
Refactoring RepositoryConfig
With the introduction of 'just serve', export targets can now be
built also independently from one another based on their
corresponding minimal repository configuration, as stored in the
target cache key.
In this context, this commit changes the RepositoryConfig usage
from one global (static) instance to pointers passed as necessary
throughout the code.
Diffstat (limited to 'src/buildtool/common/repository_config.hpp')
-rw-r--r-- | src/buildtool/common/repository_config.hpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/buildtool/common/repository_config.hpp b/src/buildtool/common/repository_config.hpp index d4152467..de5d4225 100644 --- a/src/buildtool/common/repository_config.hpp +++ b/src/buildtool/common/repository_config.hpp @@ -17,6 +17,7 @@ #include <filesystem> #include <map> +#include <memory> #include <string> #include <unordered_map> @@ -43,11 +44,6 @@ class RepositoryConfig { -> std::optional<nlohmann::json>; }; - [[nodiscard]] static auto Instance() noexcept -> RepositoryConfig& { - static RepositoryConfig instance{}; - return instance; - } - void SetInfo(std::string const& repo, RepositoryInfo&& info) { repos_[repo].base_desc = info.BaseContentDescription(); repos_[repo].info = std::move(info); |