Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] HowTo replace "Empty project" template in MBS new project wizard

Hi all,

Im working on a plugin to support CMake based projects in CDT (also see 
Bug 350206). The plugin introduces an additional project nature 
"cmakeProjectNature" to be able to offer special actions to CMake projects 
only, like running CMake, cleaning the cache etc.
Unfortunately, I failed to replace the "Empty Project" entry in MBS added 
here: org.eclipse.cdt.managedbuilder.ui.wizards.ManagedBuildWizard.java

As long as I create a new project from a template, my processType 
(org.eclipse.cdt.core.templateProcessTypes) gets called, which adds 
cmakeProjectNature to the new project. But if the user creates an "Empty 
Project" out of the same category (defined by buildProperty 
"buildArtefactType"), the process is not called and therefore does not 
include cmakeProjectNature.

I have two questions: 
- Is this the right way to add project natures (as it depends on a custom 
processType)?
- What is the recommended way to overload/replace the Empty Project 
template for my buildArtefactType?

I see, that autotools work around this by supplying parts of the new 
project wizard themselfs and somehow keep the autotools buildArtefactType 
(org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools) 
out of the MBS new project wizard part. The "Empty Project" entry always 
added in ManagedBuildWizard.java is omitted this way, and another Empty 
Project entry provided by autotools is presented by the autotools wirads 
instead. But this looks unneccessary complicated to me, as I can handle 
all other project templates as desired with my processType. 

best regards 
Martin



Back to the top