aboutsummaryrefslogtreecommitdiff
path: root/libbbot/manifest.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-03-15 22:02:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-03-26 10:40:12 +0300
commit7ec5a2ef1ac80d2a3b1715e75ac4e507330de4e6 (patch)
tree46bc96a1f0e3381c644c03ad79d5539952d4d0db /libbbot/manifest.hxx
parentf131b3e4654ab5a70fb65930967ca02f7ca506f7 (diff)
Add support for interactive-{mode,login} task request and interactive task manifest values
Diffstat (limited to 'libbbot/manifest.hxx')
-rw-r--r--libbbot/manifest.hxx69
1 files changed, 57 insertions, 12 deletions
diff --git a/libbbot/manifest.hxx b/libbbot/manifest.hxx
index daee743..c3bb6ce 100644
--- a/libbbot/manifest.hxx
+++ b/libbbot/manifest.hxx
@@ -62,14 +62,40 @@ namespace bbot
using machine_header_manifests = std::vector<machine_header_manifest>;
+ // Agent's capability to perform (non-)interactive builds.
+ //
+ enum class interactive_mode: std::uint8_t
+ {
+ false_,
+ true_,
+ both
+ };
+
+ LIBBBOT_EXPORT std::string
+ to_string (interactive_mode);
+
+ LIBBBOT_EXPORT interactive_mode
+ to_interactive_mode (const std::string&); // May throw invalid_argument.
+
+ inline std::ostream&
+ operator<< (std::ostream& os, interactive_mode m)
+ {
+ return os << to_string (m);
+ }
+
class LIBBBOT_EXPORT task_request_manifest
{
public:
+ using interactive_mode_type = bbot::interactive_mode;
+
std::string agent;
std::string toolchain_name;
butl::standard_version toolchain_version;
+ butl::optional<interactive_mode_type> interactive_mode;
+ butl::optional<std::string> interactive_login;
+
// Agent's public key SHA256 fingerprint.
//
// @@ How the fingerpring for openssl public key will be produced? Seems
@@ -82,16 +108,31 @@ namespace bbot
machine_header_manifests machines;
- task_request_manifest (std::string a,
- std::string n,
- butl::standard_version v,
- butl::optional<std::string> f,
- machine_header_manifests m)
- : agent (std::move (a)),
- toolchain_name (std::move (n)),
- toolchain_version (std::move (v)),
- fingerprint (std::move (f)),
- machines (std::move (m)) {}
+ // Return the effective interactive build mode. If the mode is not
+ // explicitly specified, then false is assumed.
+ //
+ interactive_mode_type
+ effective_interactive_mode () const noexcept
+ {
+ return interactive_mode
+ ? *interactive_mode
+ : interactive_mode_type::false_;
+ }
+
+ task_request_manifest (std::string ag,
+ std::string tn,
+ butl::standard_version tv,
+ butl::optional<interactive_mode_type> im,
+ butl::optional<std::string> il,
+ butl::optional<std::string> fp,
+ machine_header_manifests ms)
+ : agent (std::move (ag)),
+ toolchain_name (std::move (tn)),
+ toolchain_version (std::move (tv)),
+ interactive_mode (std::move (im)),
+ interactive_login (std::move (il)),
+ fingerprint (std::move (fp)),
+ machines (std::move (ms)) {}
public:
task_request_manifest () = default; // VC export.
@@ -146,6 +187,8 @@ namespace bbot
//
strings warning_regex;
+ butl::optional<std::string> interactive; // Interactive build breakpoint.
+
strings
unquoted_config () const;
@@ -161,7 +204,8 @@ namespace bbot
butl::target_triplet tg,
butl::optional<std::string> en,
strings cf,
- strings wr)
+ strings wr,
+ butl::optional<std::string> ir)
: name (std::move (nm)),
version (std::move (vr)),
repository (std::move (rl)),
@@ -171,7 +215,8 @@ namespace bbot
target (std::move (tg)),
environment (std::move (en)),
config (std::move (cf)),
- warning_regex (std::move (wr)){}
+ warning_regex (std::move (wr)),
+ interactive (std::move (ir)) {}
public:
task_manifest () = default; // VC export.