diff options
Diffstat (limited to 'src/buildtool/execution_api/common/api_bundle.hpp')
-rw-r--r-- | src/buildtool/execution_api/common/api_bundle.hpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp index 09e06901..2f393dba 100644 --- a/src/buildtool/execution_api/common/api_bundle.hpp +++ b/src/buildtool/execution_api/common/api_bundle.hpp @@ -21,29 +21,7 @@ #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<ServerAddress> const& address, - std::optional<gsl::not_null<const RepositoryConfig*>> const& repo_config = - std::nullopt, - std::string const& instance_name = "remote-execution") - -> gsl::not_null<IExecutionApi::Ptr> { - if (address) { - ExecutionConfiguration config; - config.skip_cache_lookup = false; - - return std::make_unique<BazelApi>( - instance_name, address->host, address->port, config); - } - return std::make_unique<LocalApi>(repo_config); -} +#include "src/buildtool/execution_api/common/execution_api.hpp" /// \brief Utility structure for instantiation of local and remote apis at the /// same time. If the remote api cannot be instantiated, it falls back to |