From b393090c220da61dd1c197adfac42dc47ad74f8a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 29 Jul 2024 11:13:08 +0200 Subject: ApiBundle: Use a creator method instead of constructor This will allow for ApiBundle to be used together with the TestApi implementation of IExecutionApi in tests. Also rename CreateRemote method to MakeRemote in order to remove any semantical confusion. --- src/buildtool/main/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/buildtool/main/main.cpp') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 18caa871..e97b5a27 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -822,9 +822,10 @@ auto main(int argc, char* argv[]) -> int { .retry_config = &retry_config, .exec_config = &remote_exec_config}; - ApiBundle const exec_apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const exec_apis = + ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); return execution_server->Run(&local_context, &remote_context, @@ -888,9 +889,10 @@ auto main(int argc, char* argv[]) -> int { .retry_config = &*retry_config, .exec_config = &*remote_exec_config}; - ApiBundle const serve_apis{&local_context, - &remote_context, - /*repo_config=*/nullptr}; + auto const serve_apis = + ApiBundle::Create(&local_context, + &remote_context, + /*repo_config=*/nullptr); auto serve = ServeApi::Create(*serve_config, &local_context, &remote_context, @@ -988,8 +990,8 @@ auto main(int argc, char* argv[]) -> int { .retry_config = &*retry_config, .exec_config = &*remote_exec_config}; - ApiBundle const main_apis{ - &local_context, &remote_context, &repo_config}; + auto const main_apis = + ApiBundle::Create(&local_context, &remote_context, &repo_config); GraphTraverser const traverser{ {jobs, std::move(arguments.build), -- cgit v1.2.3