+ self._writeHwFiles(sources_dir, hwdir, edit)
+ # Destination configurations files
+ cfgdir = self._createCfgFilesDir(prjdir, edit)
+ # Set properly the autoenabled parameters
+ self._setupAutoenabledParameters()
+ # Copy all the configuration files
+ self._writeCfgFiles(sources_dir, cfgdir)
+ if not edit:
+ # Destination user mk file (only on project creation)
+ self._writeUserMkFile(os.path.join(prjdir, os.path.basename(prjdir) + ".mk"))
+ # Destination wizard mk file
+ self._writeWizardMkFile(prjdir + "/" + os.path.basename(prjdir) + "_wiz.mk")
+ # Destination main.c file
+ if not edit:
+ self._writeMainFile(prjdir + "/main.c")
+ # Files for selected plugins
+ relevants_files = {}
+ for plugin in self.infos["OUTPUT"]:
+ module = loadPlugin(plugin)
+ relevants_files[plugin] = module.createProject(self)
+ self.infos["RELEVANT_FILES"] = relevants_files
+
+ def _writeVersionFile(self, filename):
+ version_file = open(os.path.join(const.DATA_DIR, "vtemplates/VERSION"), "r").read()
+ open(filename, "w").write(versionFileGenerator(self, version_file))
+
+ def _writeProjectFile(self, filename):
+ f = open(filename, "w")
+ f.write(projectFileGenerator(self))
+ f.close()
+
+ def _writeMakefile(self, filename):
+ makefile = open(os.path.join(const.DATA_DIR, "mktemplates/Makefile"), 'r').read()
+ makefile = makefileGenerator(self, makefile)
+ open(filename, "w").write(makefile)
+
+ def _writeUserMkFile(self, filename):
+ makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template.mk"), "r").read()
+ # Deadly performances loss was here :(
+ makefile = userMkGenerator(self, makefile)
+ open(filename, "w").write(makefile)
+
+ def _writeWizardMkFile(self, filename):
+ makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template_wiz.mk"), "r").read()
+ makefile = mkGenerator(self, makefile)
+ open(filename, "w").write(makefile)
+
+ def _writeMainFile(self, filename):
+ main = open(os.path.join(const.DATA_DIR, "srctemplates/main.c"), "r").read()
+ open(filename, "w").write(main)
+
+ def _writeHwFiles(self, source_dir, destination_dir, edit=False):