summaryrefslogtreecommitdiff
path: root/src/buildtool/main/main.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-29 11:13:08 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-30 12:10:06 +0200
commitb393090c220da61dd1c197adfac42dc47ad74f8a (patch)
tree72fb8ea9e5a9a4f9c01017c0601720b98909e3a8 /src/buildtool/main/main.cpp
parent6089297787902f9a38a678e2ffdf639e779a1594 (diff)
downloadjustbuild-b393090c220da61dd1c197adfac42dc47ad74f8a.tar.gz
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.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r--src/buildtool/main/main.cpp18
1 files changed, 10 insertions, 8 deletions
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),