diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/execution_api/remote/TARGETS | 2 | ||||
-rw-r--r-- | src/buildtool/execution_api/remote/config.hpp | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/remote/TARGETS b/src/buildtool/execution_api/remote/TARGETS index 5a462481..2d08ff8e 100644 --- a/src/buildtool/execution_api/remote/TARGETS +++ b/src/buildtool/execution_api/remote/TARGETS @@ -70,7 +70,9 @@ , "deps": [ ["src/buildtool/logging", "logging"] , ["src/utils/cpp", "type_safe_arithmetic"] + , ["@", "fmt", "", "fmt"] , ["@", "gsl", "", "gsl"] + , ["@", "json", "", "json"] ] , "stage": ["src", "buildtool", "execution_api", "remote"] } diff --git a/src/buildtool/execution_api/remote/config.hpp b/src/buildtool/execution_api/remote/config.hpp index b10c3b23..0b028035 100644 --- a/src/buildtool/execution_api/remote/config.hpp +++ b/src/buildtool/execution_api/remote/config.hpp @@ -23,6 +23,9 @@ #include <string> #include <utility> +#include <fmt/core.h> +#include <nlohmann/json.hpp> + #include "gsl/gsl" #include "src/buildtool/logging/logger.hpp" #include "src/utils/cpp/type_safe_arithmetic.hpp" @@ -61,6 +64,10 @@ class RemoteExecutionConfig { struct ServerAddress { std::string host{}; Port port{}; + + [[nodiscard]] auto ToJson() const noexcept -> nlohmann::json { + return nlohmann::json{fmt::format("{}:{}", host, port)}; + } }; // Obtain global instance |