Skip to content

Commit 65a78c4

Browse files
committed
Add GetPacksInfo and ValidateComponents requests
1 parent 0de4c2a commit 65a78c4

9 files changed

Lines changed: 323 additions & 72 deletions

File tree

tools/projmgr/include/ProjMgrParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ struct MiscItem {
7575
* pack name
7676
* pack path
7777
* type filter
78+
* origin file
7879
*/
7980
struct PackItem {
8081
std::string pack;
8182
std::string path;
8283
TypeFilter type;
84+
std::string origin;
8385
};
8486

8587
/**

tools/projmgr/include/ProjMgrRpcServer.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,23 @@ class ProjMgrRpcServer {
4242
*/
4343
ProjMgr& GetManager() { return m_manager; };
4444

45+
void SetDebug(bool debug) { m_debug = debug; }
46+
4547
/**
4648
* @brief set m_shutdown flag
4749
* @param boolean value
4850
*/
49-
void SetShutdown(bool value) { m_shutdown = value; };
51+
void SetShutdown(bool value) { m_shutdown = value; }
5052

5153
/**
5254
* @brief set m_contextLength flag
5355
* @param boolean value
5456
*/
55-
void SetContentLengthHeader(bool value) { m_contextLength = value; };
57+
void SetContentLengthHeader(bool value) { m_contextLength = value; }
5658

5759
protected:
5860
ProjMgr& m_manager;
61+
bool m_debug = false;
5962
bool m_shutdown = false;
6063
bool m_contextLength = false;
6164
const std::string GetRequestFromStdinWithLength(void);

tools/projmgr/include/ProjMgrWorker.h

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,13 @@ struct ToolchainItem {
9494
/**
9595
* @brief package item containing
9696
* pack information pack,
97-
* path to pack path
97+
* path to pack path,
98+
* origin file,
9899
*/
99100
struct PackageItem {
100101
PackInfo pack;
101102
std::string path;
103+
std::string origin;
102104
};
103105

104106
/**
@@ -242,6 +244,30 @@ struct ContextTypesItem {
242244
BoolMap missingTargetTypes;
243245
};
244246

247+
/**
248+
* @brief validation condition item containing
249+
* expression (accept/deny/require ...)
250+
* related aggregates
251+
*/
252+
struct ValidationCondition {
253+
std::string expression;
254+
StrSet aggregates;
255+
};
256+
257+
/**
258+
* @brief validation result containing
259+
* result according to enum ConditionResult
260+
* component/api identifier
261+
* direct related aggregates
262+
* conditions (expressions and related identifiers)
263+
*/
264+
struct ValidationResult {
265+
RteItem::ConditionResult result;
266+
std::string id;
267+
StrSet aggregates;
268+
std::vector<ValidationCondition> conditions;
269+
};
270+
245271
/**
246272
* @brief project context item containing
247273
* pointer to csolution,
@@ -336,7 +362,7 @@ struct ContextItem {
336362
std::map<std::string, std::pair<RteApi*, std::vector<std::string>>> apis;
337363
std::map<std::string, SelectedComponentItem> bootstrapComponents;
338364
StrMap bootstrapMap;
339-
std::vector<std::tuple<RteItem::ConditionResult, std::string, std::set<std::string>, std::set<std::string>>> validationResults;
365+
std::vector<ValidationResult> validationResults;
340366
std::map<std::string, std::map<std::string, RteFileInstance*>> configFiles;
341367
std::map<std::string, std::string> plmStatus;
342368
std::map<std::string, std::vector<ComponentFileItem>> componentFiles;

tools/projmgr/src/ProjMgr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ int ProjMgr::ParseCommandLine(int argc, char** argv) {
220220
m_worker.SetCbuild2Cmake(!m_cbuildgen);
221221
ProjMgrLogger::m_quiet = parseResult.count("quiet");
222222
m_rpcServer.SetContentLengthHeader(parseResult.count("content-length"));
223+
m_rpcServer.SetDebug(m_debug);
223224

224225
vector<string> positionalArguments;
225226
if (parseResult.count("positional")) {

0 commit comments

Comments
 (0)