77#ifndef PROJMGRWORKER_H
88#define PROJMGRWORKER_H
99
10+ #include " ProjMgrExtGenerator.h"
1011#include " ProjMgrKernel.h"
1112#include " ProjMgrParser.h"
1213#include " ProjMgrUtils.h"
@@ -252,6 +253,7 @@ struct ContextTypesItem {
252253 * output type,
253254 * device selection,
254255 * board selection,
256+ * device item struct,
255257 * list of package requirements,
256258 * map of required pdsc files and optionally its local path
257259 * list of component requirements,
@@ -269,6 +271,7 @@ struct ContextTypesItem {
269271 * valid connections,
270272 * linker options,
271273 * map of variables,
274+ * external generator directory,
272275 * boolean processed precedences
273276*/
274277struct ContextItem {
@@ -289,6 +292,7 @@ struct ContextItem {
289292 OutputTypes outputTypes;
290293 std::string device;
291294 std::string board;
295+ DeviceItem deviceItem;
292296 std::vector<PackageItem> packRequirements;
293297 std::map<std::string, std::pair<std::string, std::string>> pdscFiles;
294298 std::vector<PackInfo>missingPacks;
@@ -310,6 +314,7 @@ struct ContextItem {
310314 std::vector<ConnectionsCollectionVec> validConnections;
311315 LinkerContextItem linker;
312316 std::map<std::string, std::string> variables;
317+ StrMap extGenDir;
313318 bool precedences;
314319};
315320
@@ -362,28 +367,22 @@ class ProjMgrWorker {
362367 /* *
363368 * @brief class constructor
364369 */
365- ProjMgrWorker (void );
370+ ProjMgrWorker (ProjMgrParser* parser, ProjMgrExtGenerator* extGenerator );
366371
367372 /* *
368373 * @brief class destructor
369374 */
370375 ~ProjMgrWorker (void );
371376
372- /* *
373- * @brief set parser
374- * @param pointer to parser
375- */
376- void SetParser (ProjMgrParser* parser);
377-
378377 /* *
379378 * @brief process context
380379 * @param reference to context
381- * @param loadGpdsc boolean automatically load gpdsc , default true
380+ * @param loadGenFiles boolean automatically load generated files , default true
382381 * @param resolveDependencies boolean automatically resolve dependencies, default true
383382 * @param updateRteFiles boolean update RTE files, default true
384383 * @return true if executed successfully
385384 */
386- bool ProcessContext (ContextItem& context, bool loadGpdsc = true , bool resolveDependencies = true , bool updateRteFiles = true );
385+ bool ProcessContext (ContextItem& context, bool loadGenFiles = true , bool resolveDependencies = true , bool updateRteFiles = true );
387386
388387 /* *
389388 * @brief list available packs
@@ -554,6 +553,8 @@ class ProjMgrWorker {
554553 */
555554 bool ExecuteGenerator (std::string& generatorId);
556555
556+ bool ExecuteExtGenerator (std::string& generatorId);
557+
557558 /* *
558559 * @brief initialize model
559560 * @return true if executed successfully
@@ -605,10 +606,14 @@ class ProjMgrWorker {
605606 */
606607 void PrintMissingFilters (void );
607608
609+ bool ProcessGlobalGenerators (ContextItem* selectedContext, const std::string& generatorId,
610+ std::string& projectType, StrVec& siblings);
611+
608612protected:
609613 ProjMgrParser* m_parser = nullptr ;
610614 ProjMgrKernel* m_kernel = nullptr ;
611615 RteGlobalModel* m_model = nullptr ;
616+ ProjMgrExtGenerator* m_extGenerator = nullptr ;
612617 std::list<RtePackage*> m_loadedPacks;
613618 std::vector<ToolchainItem> m_toolchains;
614619 StrVec m_toolchainConfigFiles;
@@ -640,7 +645,7 @@ class ProjMgrWorker {
640645 bool GetProjectSetup (ContextItem& context);
641646 bool InitializeTarget (ContextItem& context);
642647 bool SetTargetAttributes (ContextItem& context, std::map<std::string, std::string>& attributes);
643- bool ProcessPrecedences (ContextItem& context);
648+ bool ProcessPrecedences (ContextItem& context, bool rerun = false );
644649 bool ProcessPrecedence (StringCollection& item);
645650 bool ProcessCompilerPrecedence (StringCollection& item, bool acceptRedefinition = false );
646651 bool ProcessDevice (ContextItem& context);
@@ -722,10 +727,13 @@ class ProjMgrWorker {
722727 void UpdatePartialReferencedContext (ContextItem& context, std::string& contextName);
723728 void ExpandAccessSequence (const ContextItem& context, const ContextItem& refContext, const std::string& sequence, std::string& item, bool withHeadingDot);
724729 bool GetGeneratorDir (const RteGenerator* generator, ContextItem& context, const std::string& layer, std::string& genDir);
730+ bool GetGeneratorDir (const std::string& generatorId, ContextItem& context, const std::string& layer, std::string& genDir);
731+ bool GetExtGeneratorDir (const std::string& generatorId, ContextItem& context, const std::string& layer, std::string& genDir);
725732 bool ParseContextLayers (ContextItem& context);
726733 bool AddPackRequirements (ContextItem& context, const std::vector<PackItem> packRequirements);
727734 void CheckTypeFilterSpelling (const TypeFilter& typeFilter);
728735 void CheckCompilerFilterSpelling (const std::string& compiler);
736+ bool ProcessGeneratedLayers (ContextItem& context);
729737};
730738
731739#endif // PROJMGRWORKER_H
0 commit comments