PhoenixGenerator  3.4.0
Generate code from template files and projects in C++, Rust, Python and wrapped C++ to Python
Loading...
Searching...
No Matches
simple_project_generator.cpp
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : LGPL-3.0-only
5****************************************/
6
7#include <ctime>
8
9#include "directory_replace_placeholder.h"
11#include "parserClassConfig.h"
12#include "gitlab_doc.h"
13
14//C++ Trait Backend
15#include "CppTraitFromString.h"
16#include "CppTraitSetter.h"
17#include "CppTraitGetter.h"
18#include "CppTraitCopy.h"
19#include "CppTraitTypeStream.h"
20#include "CppTraitDataStream.h"
22#include "CppTraitCheckStream.h"
23
25
26//Wrapper Trait Backend
31
32//Nanobind Trait Backend
34#include "NanobindTraitMethod.h"
41
42//Rust Trait Backend
45
46//C++ Generator
47#include "generator_class_cpp.h"
48//Wrapper Generator
50//Nanobind Generator
51#include "nanobind_generator.h"
52//Rust Generator
54
56
58
61bool isPhoenixDependency(const PString & packageName){
62 return (packageName.isSameBegining("Phoenix") || packageName.isSameBegining("phoenix"));
63}
64
66
69PString generateCmakeFindBody(const ProjectConfig & projectConfig){
70 PString cmakeFindBody;
71 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
72 const PPackageAttribute & pkgAttr = depIt->second;
73 if(!isPhoenixDependency(pkgAttr.getName())){
74 if(!pkgAttr.getCmakeFind().empty()){
75 cmakeFindBody += "find_package("+pkgAttr.getCmakeFind()+")";
76 }
77 }
78 }
79 return cmakeFindBody;
80}
81
83
86PString generatePhoenixPullExtraModule(const ProjectConfig & projectConfig){
87 PString phoenixPullExtraModule;
88 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
89 const PPackageAttribute & pkgAttr = depIt->second;
90 if(isPhoenixDependency(pkgAttr.getName())){
91 phoenixPullExtraModule += "pull_extra_module(\""+pkgAttr.getName()+"\" \""+pkgAttr.getUrl()+"\")\n";
92 }
93 }
94 return phoenixPullExtraModule;
95}
96
98
101PString generatePhoenixFindModule(const ProjectConfig & projectConfig){
102 PString phoenixFindModule;
103 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
104 const PPackageAttribute & pkgAttr = depIt->second;
105 if(isPhoenixDependency(pkgAttr.getName())){
106 phoenixFindModule += " "+pkgAttr.getName();
107 }
108 }
109 return phoenixFindModule;
110}
111
113
116PString generatePhoenixGlobalDep(const ProjectConfig & projectConfig){
117 PString phoenixGlobalDep;
118 phoenixGlobalDep += "set(" + projectConfig.name.toUpper() + "_TEST_DEPENDENCIES\n";
119 phoenixGlobalDep += "\t" + projectConfig.name.toSnakeCase() + "\n";
120 for(PackageMap::const_reverse_iterator depIt = projectConfig.mapDependencies.rbegin(); depIt != projectConfig.mapDependencies.rend(); ++depIt){
121 const PPackageAttribute & pkgAttr = depIt->second;
122 if(isPhoenixDependency(pkgAttr.getName())){
123 phoenixGlobalDep += "\t"+pkgAttr.getCmakeLib()+"\n";
124 }
125 }
126 phoenixGlobalDep += ")";
127 return phoenixGlobalDep;
128}
129
131
134PString generateTargetLinkBody(const ProjectConfig & projectConfig){
135 PString targetLinkBody;
136 targetLinkBody += "target_link_libraries("+projectConfig.name.toSnakeCase()+" ";
137 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
138 const PPackageAttribute & pkgAttr = depIt->second;
139 if(!isPhoenixDependency(pkgAttr.getName())){
140 targetLinkBody += pkgAttr.getCmakeLib()+" ";
141 }
142 }
143 // Add Phoenix dependencies (to ensure proper linking even if phoenix_create_find should handle it)
144 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
145 const PPackageAttribute & pkgAttr = depIt->second;
146 if(isPhoenixDependency(pkgAttr.getName())){
147 targetLinkBody += pkgAttr.getCmakeLib()+" ";
148 }
149 }
150 targetLinkBody += ")\n";
151 return targetLinkBody;
152}
153
155
158PString generatePixiBody(const ProjectConfig & projectConfig){
159 PString pixiBody;
160 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
161 const PPackageAttribute & pkgAttr = depIt->second;
162 PString pixi_name = pkgAttr.getPixiName().toLower();
163 PString min_version = pkgAttr.getMinVersion();
164 PString max_version = pkgAttr.getMaxVersion();
165 if(pixi_name == "") continue;
166 else if(min_version.empty() && max_version.empty()){
167 pixiBody += pixi_name + " = \"*\"\n";
168 }else if(max_version.empty()){
169 pixiBody += pixi_name + " = \"" + min_version + "\"\n";
170 }else{
171 pixiBody += pixi_name + " = \"" + min_version;
172 if(!min_version.empty() && !max_version.empty()) pixiBody += ",";
173 pixiBody += max_version + "\"\n";
174 }
175 }
176 return pixiBody;
177}
178
180
183PString generateMarkdownDepList(const ProjectConfig & projectConfig){
184 PString packageMdList;
185 for(PackageMap::const_iterator depIt = projectConfig.mapDependencies.begin(); depIt != projectConfig.mapDependencies.end(); ++depIt){
186 const PPackageAttribute & pkgAttr = depIt->second;
187 if(isPhoenixDependency(pkgAttr.getName())){
188 packageMdList += "- ["+pkgAttr.getName()+"]("+pkgAttr.getUrl()+")\n";
189 }
190 }
191 return packageMdList;
192}
193
195
198PString generateAuthorListPixi(const ProjectConfig & projectConfig){
199 PString authorListPixi;
200 authorListPixi += "authors = [\n";
201 for(ProjectMembersMap::const_iterator it = projectConfig.authorMap.begin(); it != projectConfig.authorMap.end(); ++it){
202 const PProjectMembers & author = it->second;
203 authorListPixi += " \"" + author.getFirstName() + " " + author.getLastName() + " <" + author.getEmail() + ">\",\n";
204 }
205 authorListPixi += "]\n";
206 return authorListPixi;
207}
208
210
215PString generateNanobindCmakeSources(const ProjectConfig & projectConfig, const PVecPath & vecClassConfigFile, const GeneratorMode & mode){
216 PString nanobindSources;
217 nanobindSources += "# We are now ready to compile the actual extension module\n";
218
219 for(const PPath & classConfigFile : vecClassConfigFile){
220 PPath baseFileName = classConfigFile.getFileName().eraseExtension();
221 PString bindingSource = baseFileName + "_binding.cpp";
222 PString fileModuleName = baseFileName.toLower();
223
224 nanobindSources += "nanobind_add_module(\n";
225 nanobindSources += "\t" + fileModuleName + " # Name of the module\n";
226 nanobindSources += "\tSTABLE_ABI # Compatible Python 3.12+ stable ABI\n";
227 nanobindSources += "\tNB_STATIC # Static linking\n";
228 nanobindSources += "\tLTO # Link-time optimization\n";
229 nanobindSources += "\t" + bindingSource + " # Source file\n";
230 nanobindSources += ")\n";
231 nanobindSources += "target_link_libraries(" + fileModuleName + " PRIVATE " + projectConfig.name.toSnakeCase() + ")\n";
232 nanobindSources += "install(TARGETS " + fileModuleName + " LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES} ARCHIVE DESTINATION ${PYTHON_SITE_PACKAGES})\n\n";
233 }
234
235 return nanobindSources;
236}
237
239
242PString generateRustModuleDeclarations(const PVecPath & vecClassConfigFile){
243 PString decls;
244 for(const PPath & classConfigFile : vecClassConfigFile){
245 decls += "pub mod " + classConfigFile.getFileName().eraseExtension().toSnakeCase() + ";\n";
246 }
247 return decls;
248}
249
251
264PMapString generateReplacementMap(const ProjectConfig & projectConfig, const GeneratorMode & mode, const PString & cmakeFindBody, const PString & phoenixPullExtraModule,
265 const PString & phoenixFindModule, const PString & phoenixGlobalDep, const PString & targetLinkBody,
266 const PString & pixiBody, const PString & markdownDepList, const PString & authorListPixi, const PString & nanobindCMakeSources,
267 const PString & rustModuleDeclarations)
268{
269 PMapString mapReplace;
271 mapReplace["xxxnanobind_sourcesxxx"] = nanobindCMakeSources; //nanobind cmake sources
272 }
273 if(mode.type == ProjectType::RUST){
274 mapReplace["XXXRustModuleDeclarationsXXX"] = rustModuleDeclarations; //rust module declarations for lib.rs
275 }
276 mapReplace["XXXProjectNameXXX"] = projectConfig.name; //project name
277 mapReplace["XXXPROJECT_NAMEXXX"] = projectConfig.name.toUpper(); //project name uppercase
278 mapReplace["xxxproject_namexxx"] = projectConfig.name.toSnakeCase(); //project library
279 mapReplace["XXXProjectNameDescriptionXXX"] = projectConfig.description; //description
280 mapReplace["XXXProjectNameUrlXXX"] = projectConfig.url; //project url
281 mapReplace["XXXProjectVersionXXX"] = projectConfig.version; //project version
282 mapReplace["XXXProjectNameHomepageUrlXXX"] = projectConfig.url; //project doc url (TODO add it or deduce it from the project url for gitlab)
283 mapReplace["XXXProjectNameRunnerTagXXX"] = projectConfig.runnerTag; //Project CI runner tag
284 mapReplace["XXXProjectFindPackageDependenciesXXX"] = cmakeFindBody; //project find_package
285 mapReplace["XXXProjectPhoenixDependenciesXXX"] = phoenixPullExtraModule; //project pull_extra_module
286 mapReplace["XXXProjectNameCMakeFindDependenciesXXX"] = phoenixFindModule; //project dependencies of phoenix_create_find
287 mapReplace["XXXProjectDependenciesCMakeVarXXX"] = phoenixGlobalDep; //cmake variable to hold test dependencies
288 mapReplace["XXXProjectNameTargetLinkLibDependenciesXXX"] = targetLinkBody; //full target_link_library command of generated lib
289 mapReplace["XXXCxxWorkflowUrlXXX"] = projectConfig.ciToolkitUrl+"@"+projectConfig.ciToolkitVersion; //Url and version of the CI workflow
290 mapReplace["XXXGitlabPagesUrlXXX"] = getGitlabDocUrl(projectConfig.url); //group to which the project belongs to
291 mapReplace["xxxphoenixprojectpixipackagenamexxx"] = projectConfig.name.toLower(); //name of the pixi package
292 mapReplace["xxxprojectnamepixiextradependenciesxxx"] = pixiBody; //extra pixi dependencies
293 mapReplace["XXXProjectNameMarkdownListDependenciesXXX"] = markdownDepList; //markdown list of Phoenix dependencies
294 mapReplace["XXXProjectAuthorListPixiXXX"] = authorListPixi; //author list for pixi.toml
295 return mapReplace;
296}
297
299
302PMapString generateAllReplacementData(const ProjectConfig & projectConfig, const GeneratorMode & mode, const PVecPath & vecClassConfigFile){
303 // Generate various bodies using dedicated functions
304 PString cmakeFindBody = generateCmakeFindBody(projectConfig);
305 PString phoenixPullExtraModule = generatePhoenixPullExtraModule(projectConfig);
306 PString phoenixFindModule = generatePhoenixFindModule(projectConfig);
307 PString phoenixGlobalDep = generatePhoenixGlobalDep(projectConfig);
308 PString targetLinkBody = generateTargetLinkBody(projectConfig);
309 PString pixiBody = generatePixiBody(projectConfig);
310 PString markdownDepList = generateMarkdownDepList(projectConfig);
311 PString authorListPixi = generateAuthorListPixi(projectConfig);
312 PString nanobindCMakeSources;
314 nanobindCMakeSources = generateNanobindCmakeSources(projectConfig, vecClassConfigFile, mode);
315 }
316 PString rustModuleDeclarations;
317 if(mode.type == ProjectType::RUST){
318 rustModuleDeclarations = generateRustModuleDeclarations(vecClassConfigFile);
319 }
320
321 time_t timestamp;
322 PString dateStr = ctime(&(timestamp = time(nullptr)));
323 dateStr = dateStr.eraseLastChar("\n"); // Remove the trailing \n
324
325 // Generate the replacement map
326 return generateReplacementMap(projectConfig, mode, cmakeFindBody, phoenixPullExtraModule,
327 phoenixFindModule, phoenixGlobalDep, targetLinkBody,
328 pixiBody, markdownDepList, authorListPixi, nanobindCMakeSources, rustModuleDeclarations);
329}
330
332
337bool simple_project_load_config(ProjectParam & param, const PPath & pdataDir, const PVecPath & vecClassConfigFile){
338 bool b(true);
339 for(const PPath & classConfigFile : vecClassConfigFile){
340 PDataConfig dataConfig;
341 dataConfig.getFileName() = classConfigFile;
342 if(!parserClassConfig(dataConfig.getVecClassConfig(), dataConfig.getVecInclude(), classConfigFile)){
343 std::cerr << "simple_project_load_config : can't load file '" << classConfigFile << "'" << std::endl;
344 b = false; //Best effort strategy
345 }
346 param.vecDataConfig.push_back(dataConfig);
347
348 PPath destFile = pdataDir / classConfigFile.getFileName();
349 PString fileContent = classConfigFile.loadFileContent();
350 if(!destFile.saveFileContent(fileContent)){
351 std::cerr << "simple_project_load_config : cannot copy pdata file to project pdata directory '"<<destFile<<"'" << std::endl;
352 b = false; //Best effort strategy
353 }
354 }
355 return b;
356}
357
359
362bool generateCppClassesFull(const ProjectParam & projectParam){
363 PTraitBackendManager manager;
365 manager.addTraitBackend<CppTraitCopy>();
372 return generator_class_full(manager, projectParam);
373}
374
376
386
388
402
403
405
408bool generateRustClassesFull(const ProjectParam & projectParam){
409 ProjectParam updatedParam(projectParam);
410 updatedParam.mode.moduleName = updatedParam.name.toLower(); //Cargo crate name, matches xxxphoenixprojectpixipackagenamexxx
413 return generator_rust_class_full(manager, updatedParam);
414}
415
417
421 ProjectParam output(projectParam);
422 PVecDataConfig & vecConfig = output.vecDataConfig;
423 for(PVecDataConfig::iterator itConfig(vecConfig.begin()); itConfig != vecConfig.end(); ++itConfig){
424 PVecClassConfig & vecClass = itConfig->getVecClassConfig();
425 for(PVecClassConfig::iterator itClass(vecClass.begin()); itClass != vecClass.end(); ++itClass){
426 PVecClassAttribute & vecAttr = itClass->getListAttribute();
427 for(PVecClassAttribute::iterator itAttr(vecAttr.begin()); itAttr != vecAttr.end(); ++itAttr){
428 PString name = itAttr->getType();
429 itAttr->setType(name.replace("PPath", "std::string").replace("PString", "std::string"));
430 }
431 }
432 }
433 return output;
434}
435
437
441 switch(projectParam.mode.type){
442 case ProjectType::CPP:
443 return generateCppClassesFull(projectParam);
445 return generateWrapperClassesFull(projectParam);
447 {
448 ProjectParam strip(stripNanobindUnsupportedType(projectParam));
450 }
452 return generateRustClassesFull(projectParam);
453 default:
454 return false;
455 }
456}
457
459
465bool simple_project_generator(const PPath & descriptionFile, const PVecPath & vecClassConfigFile, const PString & projectType,
466 const GeneratorMode & mode)
467{
468 //First, let's read the toml config of the project
469 ProjectConfig projectConfig;
470 if(!project_generator_loadConfig(projectConfig, descriptionFile)){
471 std::cerr << "simple_project_generator : cannot parse project description file '"<<descriptionFile<<"'" << std::endl;
472 return false;
473 }
474 //Then look in the config files if the packages exists
475 if(!project_generator_loadPackageInfo(projectConfig)){
476 std::cerr << "simple_project_generator : cannot find package info of project '"<<projectConfig.name<<"'" << std::endl;
477 return false;
478 }
479 // Generate replacement data
480 PMapString mapReplace = generateAllReplacementData(projectConfig, mode, vecClassConfigFile);
481 PPath inputConfigPlaceholderDir = PPath::getProgramPrefix() / PPath("share") / PPath("PhoenixGenerator") / PPath("Projects") / PPath(projectType), outputPath("./");
482 if(!directory_replace_placeholder(outputPath, inputConfigPlaceholderDir, mapReplace)){
483 std::cerr << "simple_project_generator : cannot replace placeholder in project generation '"<<projectConfig.name<<"'" << std::endl;
484 return false;
485 }
486 PPath mainPath = PPath(".") / PPath(projectConfig.name);
487 PPath srcPath = mainPath / PPath("src"), pdataDir = mainPath / PPath("pdata");
488 if(!pdataDir.createDirectory()){
489 std::cerr << "simple_project_generator : cannot create pdata directory '"<<pdataDir<<"'" << std::endl;
490 return false;
491 }
492 ProjectParam param;
493 param.mode = mode;
494 param.name = projectConfig.name;
495 param.version = projectConfig.version;
496 param.outputProjectDir = mainPath;
497 param.outputSourceDir = srcPath;
499 param.outputTestDir = mainPath / PPath("TESTS");
500 }else if(param.mode.type == ProjectType::WRAPPER || param.mode.type == ProjectType::RUST){
501 param.outputTestDir = mainPath / PPath("tests");
502 }
503
504 if(!simple_project_load_config(param, pdataDir, vecClassConfigFile)){
505 std::cerr << "simple_project_generator : cannot load config to generate project in '"<<srcPath<<"'" << std::endl;
506 return false;
507 }
509 std::cerr << "simple_project_generator : cannot generate sources in '"<<srcPath<<"'" << std::endl;
510 return false;
511 }
512 // Generate class generator script
513 if(!generateClassGeneratorScript(vecClassConfigFile, pdataDir, param.mode)){
514 std::cerr << "simple_project_generator : cannot generate class generator script in pdata directory '"<<pdataDir<<"'" << std::endl;
515 return false;
516 }
517 return true;
518}
519
520
std::vector< PDataConfig > PVecDataConfig
Definition PDataConfig.h:48
std::vector< PClassAttribute > PVecClassAttribute
Definition PDataConfig.h:13
std::vector< PClassConfig > PVecClassConfig
Definition PDataConfig.h:14
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
Class generator for Nanobind property trait.
Class generator for Nanobind property trait.
Class generator for Nanobind property trait.
Class generator for Nanobind property trait.
Class generator for Nanobind property trait.
Class generator for Nanobind property trait.
Class generator for Nanobind property trait.
Class to describe a basic class.
Definition PDataConfig.h:17
const PVecClassConfig & getVecClassConfig() const
Get the vector of all config class of the current pdata file.
const PPath & getFileName() const
Get the file name of the current PDataConfig.
const PVecPath & getVecInclude() const
Get the vector of all include files of the current pdata file.
Manager of the Trait backends.
void addTraitBackend()
Add a trait backend into the PTraitBackendManager.
Describes a package attributes.
const PString & getName() const
Gets the name of the PPackageAttribute.
const PString & getMaxVersion() const
Gets the maxVersion of the PPackageAttribute.
const PString & getUrl() const
Gets the url of the PPackageAttribute.
const PString & getCmakeFind() const
Gets the cmakeFind of the PPackageAttribute.
const PString & getCmakeLib() const
Gets the cmakeLib of the PPackageAttribute.
const PString & getMinVersion() const
Gets the minVersion of the PPackageAttribute.
const PString & getPixiName() const
Gets the pixiName of the PPackageAttribute.
Describes a package attributes.
const PString & getFirstName() const
Gets the firstName of the PProjectMembers.
const PString & getLastName() const
Gets the lastName of the PProjectMembers.
const PString & getEmail() const
Gets the email of the PProjectMembers.
Manager of the Rust trait backends.
void addTraitBackend()
Add a trait backend into the PRustTraitBackendManager.
Manager of the Trait backends.
void addTraitBackend()
Add a trait backend into the PTraitBackendManager.
Manager of the Trait backends.
void addTraitBackend()
Add a trait backend into the PWrapperTraitBackendManager.
Rust trait generating getters and setters for every attribute.
Class generator for setter trait.
Class generator for setter trait.
Class generator for setter trait.
bool generator_class_full(const PTraitBackendManager &manager, const ProjectParam &projectParam)
Generate the full sources and related unit tests from configuration.
bool generator_rust_class_full(const PRustTraitBackendManager &manager, const ProjectParam &projectParam)
Generate the full Rust sources (and related integration tests) from configuration.
PString getGitlabDocUrl(const PString &projectUrl)
Get the documentation url of the given project url if possible.
bool generator_nanobind_full(const PNanobindTraitBackendManager &manager, const ProjectParam &projectParam)
Generate the full sources and related unit tests from configuration.
bool parserClassConfig(std::vector< PClassConfig > &listClassConfig, PVecPath &listInclude, const PPath &fileName)
Parser list class config.
bool project_generator_loadPackageInfo(ProjectConfig &config)
This function should load the package info file from share/PhoenixGenerator/Packages and retrieve the...
bool project_generator_loadConfig(ProjectConfig &config, const PPath &descriptionFile)
Load the project configuration.
bool generateClassGeneratorScript(const PVecPath &vecClassConfigFile, const PPath &scriptDir, const GeneratorMode &mode)
Generate a bash script to re generate all the classes from their pdata configuration files.
PMapString generateAllReplacementData(const ProjectConfig &projectConfig, const GeneratorMode &mode, const PVecPath &vecClassConfigFile)
Generate all replacement data for project generation.
bool simple_project_load_config(ProjectParam &param, const PPath &pdataDir, const PVecPath &vecClassConfigFile)
Load configuration pdata of generated sources.
PString generateAuthorListPixi(const ProjectConfig &projectConfig)
Generate author list for Pixi.
PString generateCmakeFindBody(const ProjectConfig &projectConfig)
Generate CMake find_package commands for non-Phoenix dependencies.
bool simple_project_generate_source(const ProjectParam &projectParam)
Save generated sources of project.
bool generateNanobindClassesFull(const ProjectParam &projectParam)
Generate nanobind wrapper classes.
ProjectParam stripNanobindUnsupportedType(const ProjectParam &projectParam)
Create a ProjectParam with PString and PPath converted into std::string.
PString generateNanobindCmakeSources(const ProjectConfig &projectConfig, const PVecPath &vecClassConfigFile, const GeneratorMode &mode)
Generate the nanobind cmake sources list.
bool generateCppClassesFull(const ProjectParam &projectParam)
Generate C++ classes with all standard traits.
bool isPhoenixDependency(const PString &packageName)
Check if a package is a Phoenix dependency.
PString generatePhoenixFindModule(const ProjectConfig &projectConfig)
Generate Phoenix find module list.
PMapString generateReplacementMap(const ProjectConfig &projectConfig, const GeneratorMode &mode, const PString &cmakeFindBody, const PString &phoenixPullExtraModule, const PString &phoenixFindModule, const PString &phoenixGlobalDep, const PString &targetLinkBody, const PString &pixiBody, const PString &markdownDepList, const PString &authorListPixi, const PString &nanobindCMakeSources, const PString &rustModuleDeclarations)
Generate the replacement map for placeholders.
bool generateRustClassesFull(const ProjectParam &projectParam)
Generate rust classes.
PString generateMarkdownDepList(const ProjectConfig &projectConfig)
Generate markdown list of Phoenix dependencies.
PString generatePhoenixPullExtraModule(const ProjectConfig &projectConfig)
Generate Phoenix pull_extra_module commands.
PString generateRustModuleDeclarations(const PVecPath &vecClassConfigFile)
Generate the Rust module declarations to be written into lib.rs.
PString generatePixiBody(const ProjectConfig &projectConfig)
Generate Pixi dependencies.
bool generateWrapperClassesFull(const ProjectParam &projectParam)
Generate wrapper classes.
bool simple_project_generator(const PPath &descriptionFile, const PVecPath &vecClassConfigFile, const PString &projectType, const GeneratorMode &mode)
Create a simple project from a configuration.
PString generateTargetLinkBody(const ProjectConfig &projectConfig)
Generate target_link_libraries command.
PString generatePhoenixGlobalDep(const ProjectConfig &projectConfig)
Generate Phoenix global dependencies variable.
All the genertor modes.
PString moduleName
Name of the wrapper python module.
ProjectType::ProjectType type
Type of the project to be generated.
Configuration of the project.
PString description
Description of the project.
PString name
Name of the project.
PackageMap mapDependencies
Map of all dependencies of the project with structure PPackageAttribute values.
ProjectMembersMap authorMap
Map of authors of the project.
PString runnerTag
Specific runner tag if needed (could be MUST_big_runner).
PString ciToolkitUrl
CI toolkit url.
PString ciToolkitVersion
Version of the Phoenix CI toolkit component (optional, defaults to 3.0.4).
PString url
Project url.
PString version
Project version.
Set of parameters to generate a project.
PPath outputProjectDir
Output path of the full project.
GeneratorMode mode
Mode to be used to generate the project.
PString version
Version of the project.
PPath outputTestDir
Output path of the unit tests.
PVecDataConfig vecDataConfig
Configuration of classes to be generated.
PString name
Name of the project.
PPath outputSourceDir
Output path of the sources.
bool wrapper_generator_class_full(const PWrapperTraitBackendManager &manager, const ProjectParam &projectParam)
Generate the full sources and related unit tests from configuration.