diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-20 15:39:58 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-25 13:59:48 +0200 |
commit | 702c9f4af93d66d97f01fcb496b3f699e3a83f6a (patch) | |
tree | 274ce9d9c38b879ca37aa8191931906b3e588746 /src/buildtool/execution_api/common/api_bundle.hpp | |
parent | c2817da6d108acc38f17bf29900aa66d71337b34 (diff) | |
download | justbuild-702c9f4af93d66d97f01fcb496b3f699e3a83f6a.tar.gz |
Remove CreateExecutionApi
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 |