From cf04253130030bc28866d10aa1f8fe1353643d42 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 24 Nov 2023 11:31:42 +0100 Subject: 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. --- src/buildtool/execution_api/common/create_execution_api.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/buildtool/execution_api/common/create_execution_api.hpp') diff --git a/src/buildtool/execution_api/common/create_execution_api.hpp b/src/buildtool/execution_api/common/create_execution_api.hpp index 02fcee4b..c62d0f17 100644 --- a/src/buildtool/execution_api/common/create_execution_api.hpp +++ b/src/buildtool/execution_api/common/create_execution_api.hpp @@ -20,15 +20,19 @@ #include "gsl/gsl" #include "src/buildtool/common/remote/remote_common.hpp" +#include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" /// \brief Utility function to instantiate either a Local or Bazel Execution /// API. /// \param address if provided, a BazelApi is instantiated +/// \param repo_config repository configuration to be used by GitApi calls /// \param instance_name only used in the construction of the BazelApi object [[nodiscard]] static inline auto CreateExecutionApi( std::optional const& address, + std::optional> const& repo_config = + std::nullopt, std::string const& instance_name = "remote-execution") -> gsl::not_null { if (address) { @@ -38,7 +42,7 @@ return std::make_unique( instance_name, address->host, address->port, config); } - return std::make_unique(); + return std::make_unique(repo_config); } #endif -- cgit v1.2.3