1
2
3
4
5
6 #ifndef CMAJOR_BUILD_CLIENT_COMMAND_INCLUDED
7 #define CMAJOR_BUILD_CLIENT_COMMAND_INCLUDED
8 #include <cmajor/build/BuildApi.hpp>
9 #include <cmajor/build/Connection.hpp>
10 #include <string>
11 #include <memory>
12
13 namespace cmajor { namespace build {
14
15 class ExecutionContext;
16
17 std::unique_ptr<ExecutionContext> CreateExecutionContext(const std::string& serverName);
18
19 class ClientCommand
20 {
21 public:
22 ClientCommand();
23 virtual ~ClientCommand();
24 virtual void Execute() = 0;
25 };
26
27 class PushProjectClientCommand : public ClientCommand
28 {
29 public:
30 PushProjectClientCommand(const std::string& projectFilePath_, const std::string& serverName_);
31 void Execute() override;
32 private:
33 std::string projectFilePath;
34 std::string serverName;
35 };
36
37 class RemoveProjectClientCommand : public ClientCommand
38 {
39 public:
40 RemoveProjectClientCommand(const std::string& projectFilePath_, const std::string& serverName_);
41 void Execute() override;
42 private:
43 std::string projectFilePath;
44 std::string serverName;
45 };
46
47 class RemoveServerClientCommand : public ClientCommand
48 {
49 public:
50 RemoveServerClientCommand(const std::string& serverName_);
51 void Execute() override;
52 private:
53 std::string serverName;
54 };
55
56 class AddServerClientCommand : public ClientCommand
57 {
58 public:
59 AddServerClientCommand(const std::string& serverName_, const std::string& host_, int port_, const std::string& defaultToolChain_);
60 void Execute() override;
61 private:
62 std::string serverName;
63 std::string host;
64 int port;
65 std::string defaultToolChain;
66 };
67
68 class BuildProjectClientCommand : public ClientCommand
69 {
70 public:
71 BuildProjectClientCommand(const std::string& projectFilePath_, const std::string& serverName_);
72 void Execute() override;
73 private:
74 std::string projectFilePath;
75 std::string serverName;
76 };
77
78 class DebugProjectClientCommand : public ClientCommand
79 {
80 public:
81 DebugProjectClientCommand(const std::string& projectFilePath_, const std::string& serverName_);
82 void Execute() override;
83 private:
84 std::string projectFilePath;
85 std::string serverName;
86 };
87
88 class InstallProjectClientCommand : public ClientCommand
89 {
90 public:
91 InstallProjectClientCommand(const std::string& projectFilePath_, const std::string& directory_, const std::string& serverName_);
92 void Execute() override;
93 private:
94 std::string projectFilePath;
95 std::string directory;
96 std::string serverName;
97 };
98
99 class ShowConfigurationClientCommand : public ClientCommand
100 {
101 public:
102 ShowConfigurationClientCommand();
103 void Execute() override;
104 };
105
106 std::unique_ptr<ClientCommand> ParseClientCommand(const std::string& command);
107
108 } }
109
110 #endif // CMAJOR_BUILD_CLIENT_COMMAND_INCLUDED