summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/main/main.cpp3
-rw-r--r--src/buildtool/profile/TARGETS2
-rw-r--r--src/buildtool/profile/profile.cpp18
-rw-r--r--src/buildtool/profile/profile.hpp2
4 files changed, 25 insertions, 0 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 896d0545..c071b27c 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -941,6 +941,9 @@ auto main(int argc, char* argv[]) -> int {
}
return kExitBuildEnvironment;
}
+ if (profile != nullptr) {
+ profile->SetRemoteExecutionConfig(*remote_exec_config);
+ }
// Set up storage for client-side operation. This needs to have all the
// correct remote endpoint info in order to instantiate the
diff --git a/src/buildtool/profile/TARGETS b/src/buildtool/profile/TARGETS
index 318ed075..713e2c89 100644
--- a/src/buildtool/profile/TARGETS
+++ b/src/buildtool/profile/TARGETS
@@ -6,12 +6,14 @@
, "deps":
[ ["@", "json", "", "json"]
, ["src/buildtool/execution_api/common", "common"]
+ , ["src/buildtool/execution_api/remote", "config"]
, ["src/buildtool/main", "cli"]
]
, "private-deps":
[ ["@", "gsl", "", "gsl"]
, ["src/buildtool/common", "cli"]
, ["src/buildtool/common", "common"]
+ , ["src/buildtool/common/remote", "remote_common"]
, ["src/utils/cpp", "expected"]
]
, "stage": ["src", "buildtool", "profile"]
diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp
index f37629f1..1407ddbd 100644
--- a/src/buildtool/profile/profile.cpp
+++ b/src/buildtool/profile/profile.cpp
@@ -20,6 +20,7 @@
#include "gsl/gsl"
#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/common/cli.hpp"
+#include "src/buildtool/common/remote/remote_common.hpp"
#include "src/utils/cpp/expected.hpp"
void Profile::Write(int exit_code) {
@@ -156,3 +157,20 @@ void Profile::NoteAnalysisError(std::string const& error_message) {
std::unique_lock lock{mutex_};
analysis_errors_.emplace_back(error_message);
}
+
+void Profile::SetRemoteExecutionConfig(RemoteExecutionConfig const& config) {
+ auto remote = nlohmann::json::object();
+ if (config.remote_address) {
+ remote["address"] = config.remote_address->ToJson();
+ }
+ remote["properties"] = config.platform_properties;
+ auto dispatch = nlohmann::json::array();
+ for (auto const& dispatch_entry : config.dispatch) {
+ auto entry = nlohmann::json::array();
+ entry.emplace_back(dispatch_entry.first);
+ entry.emplace_back(dispatch_entry.second.ToJson());
+ dispatch.emplace_back(entry);
+ }
+ remote["dispatch"] = dispatch;
+ profile_["remote"] = remote;
+}
diff --git a/src/buildtool/profile/profile.hpp b/src/buildtool/profile/profile.hpp
index d172ae85..a16d9996 100644
--- a/src/buildtool/profile/profile.hpp
+++ b/src/buildtool/profile/profile.hpp
@@ -25,6 +25,7 @@
#include "nlohmann/json.hpp"
#include "src/buildtool/execution_api/common/execution_response.hpp"
+#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/main/cli.hpp"
class Profile {
@@ -36,6 +37,7 @@ class Profile {
}
void Write(int exit_code);
+ void SetRemoteExecutionConfig(RemoteExecutionConfig const&);
void SetTarget(nlohmann::json target);
void SetConfiguration(nlohmann::json configuration);
void NoteActionCompleted(std::string const& id,