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/build_engine/base_maps/expression_map.cpp | |
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/build_engine/base_maps/expression_map.cpp')
-rw-r--r-- | src/buildtool/build_engine/base_maps/expression_map.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/buildtool/build_engine/base_maps/expression_map.cpp b/src/buildtool/build_engine/base_maps/expression_map.cpp index e495fa6b..5b2c0655 100644 --- a/src/buildtool/build_engine/base_maps/expression_map.cpp +++ b/src/buildtool/build_engine/base_maps/expression_map.cpp @@ -23,12 +23,13 @@ namespace BuildMaps::Base { auto CreateExpressionMap(gsl::not_null<ExpressionFileMap*> const& expr_file_map, + gsl::not_null<RepositoryConfig*> const& repo_config, std::size_t jobs) -> ExpressionFunctionMap { - auto expr_func_creator = [expr_file_map](auto ts, - auto setter, - auto logger, - auto subcaller, - auto const& id) { + auto expr_func_creator = [expr_file_map, repo_config](auto ts, + auto setter, + auto logger, + auto subcaller, + auto const& id) { if (not id.IsDefinitionName()) { (*logger)( fmt::format("{} cannot name an expression", id.ToString()), @@ -38,7 +39,8 @@ auto CreateExpressionMap(gsl::not_null<ExpressionFileMap*> const& expr_file_map, expr_file_map->ConsumeAfterKeysReady( ts, {id.ToModule()}, - [setter = std::move(setter), + [repo_config, + setter = std::move(setter), logger, subcaller = std::move(subcaller), id](auto json_values) { @@ -68,7 +70,7 @@ auto CreateExpressionMap(gsl::not_null<ExpressionFileMap*> const& expr_file_map, } auto import_aliases = - reader->ReadEntityAliasesObject("imports"); + reader->ReadEntityAliasesObject("imports", repo_config); if (not import_aliases) { return; } |