Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT new Project Template Registration(new Project Template does not appear in New>Project dialog)
CDT new Project Template Registration [message #655108] Fri, 18 February 2011 06:03 Go to next message
Branislav  is currently offline Branislav
Messages: 1
Registered: February 2011
Junior Member
Hello

I try to develop custom project wizard for CDT in Eclipse Helios. I have followed instructions in the CDT Plug-in Developer Guide and tried to register the "Symbian" example provided by the guide book. All seems to be ok, I run the Launch an Eclipse application button from the Plugin environment and the Eclipse starts, but my template is not listed in the newProject Wizard for some reason.

Well I am doing obviously something wrong here. Could you please get me back on the road?

The steps I have done to create/register the plugin follows:

1. Create an empty plug-in project.
2.Open the Dependencies page and Added org.eclipse.cdt.core and org.eclipse.cdt.ui plug-ins from the list.
2. In the Extensions page Added org.eclipse.cdt.core.templates
3.Right-click on the newly added extension, and select New > template
4.Specified the id attribute "MPCProjectWizard.template3"
5.Added folder to the project named "Templates". This folder includes tree files "template.cpp","template.h","template.xml"
6.Specify the location of the template XML file, "Templates/template.xml"
7.Specify a filterPattern "|" .
8.Specify the project type "org.eclipse.cdt.build.core.buildArtefactType.exe"
9.Specify the pagesAfterTemplateSelectionProvider, ""
10.launch a runtime workbench and invoke the New Project wizard to check that the template added is listed. The think is that the template is not listed.

As I mentioned There is something obviously wrong how I did this. Please could you correct me.

Your help is highly appreciated.

Here is the list plugin.xml


<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.cdt.core.templates">
<template
filterPattern=".*"
id="MPCProjectWizard.template3"
location="Templates/template.xml"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe ">
</template>
</extension>
</plugin>

and here the example template from guide book
<?xml version="1.0" encoding="ISO-8859-1"?>
<template type="ProjTempl" version="1.0" supplier="Symbian" revision="1.0" author="Bala Torati"
id="MPCProjectWizard.template3" label="Simple EXE" description="A skeletal Symbian OS EXE project. Creates a folder for sources and another for include."
help="help.html">

<property-group id="basics" label="Basic Settings" description="Basic properties of a project" type="PAGES-ONLY" help="help.html">

<property id="uid2"
label="UID 2"
description="UID 2"
default="0x00000000"
type="input"
pattern="0x[0-9a-fA-F]{8}"
hidden="false"
mandatory="true"
persist="true"/>

<property id="uid3"
label="UID 3"
description="UID 3"
default="0x00000000"
type="input"
pattern="0x[0-9a-fA-F]{8}"
hidden="false"
mandatory="false"
persist="true"/>

<property id="vid"
label="Vendor ID"
description="Vendor ID"
default="0x00000000"
type="input"
pattern="0x[0-9a-fA-F]{8}"
hidden="false"
mandatory="true"
persist="true"/>

<property id="author"
label="Author"
description="Name of the author"
type="input"
pattern=".*"
default=""
hidden="false"
persist="true"/>

<property id="copyright"
label="Copyright notice"
description="Your copyright notice"
type="input"
pattern=".*"
default="Your copyright notice"
hidden="false"
persist="true"/>

<property id="targetType"
label="Target Type"
description="Select the target type"
type="select"
default="app"
hidden="false"
mandatory="true"
persist="true">
<item label="APP" value="app"/>
<item label="LIB" value="lib"/>
<item label="DLL" value="dll"/>
<item label="EXE" value="exe"/>
<item label="EXEDLL" value="exedll"/>
</property>
</property-group>

<property-group id="directories" label="Project Directories" description="Generated files will be copied to the specified directories under the project root directory" type="PAGES-ONLY" help="help.html">
<property id="incDir"
label="Include"
description="Directory for C++ header files"
type="input"
default="inc"
pattern="[a-zA-Z0-9]+"
mandatory="true"
persist="true"/>

<property id="sourceDir"
label="Source"
description="Directory for C++ source files"
type="input"
default="src"
pattern="[a-zA-Z0-9]+"
mandatory="true"
persist="true"/>
</property-group>

<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject ">
<simple name="name" value="$(projectName)"/>
<simple name="targetType" value="$(targetType)"/>
<simple name="uid2" value="$(uid2)"/>
<simple name="uid3" value="$(uid3)"/>
<simple name="vid" value="$(vid)"/>
</process>

<process type="org.eclipse.cdt.core.CreateSourceFolder">
<simple name="projectName" value="$(projectName)"/>
<simple name="path" value="$(sourceDir)"/>
</process>

<process type="org.eclipse.cdt.managedbuilder.core.CreateIncludeFolder ">
<simple name="projectName" value="$(projectName)"/>
<simple name="path" value="$(incDir)"/>
</process>

<process type="org.eclipse.cdt.core.AddFiles">
<simple name="projectName" value="$(projectName)"/>
<complex-array name="files">
<element>
<simple name="source" value="inc/Basename.h"/>
<simple name="target" value="$(incDir)/$(baseName).h"/>
<simple name="replaceable" value="true"/>
</element>
<element>
<simple name="source" value="src/Basename.cpp"/>
<simple name="target" value="$(sourceDir)/$(baseName).cpp"/>
<simple name="replaceable" value="true"/>
</element>
</complex-array>
</process>

<process type=" org.eclipse.cdt.managedbuilder.core.AppendToMBSStringListOpt ionValues ">
<simple name="projectName" value= "$(projectName)"/>
<complex-array name="resourcePaths">
<element>
<simple name="id" value=".*linker\.libraries\.libraries.*" />
<simple-array name="values">
<element value="euser.lib" />
</simple-array>
<simple name="path" value="" />
</element>
</complex-array>
</process>
</template>
Re: CDT new Project Template Registration [message #695858 is a reply to message #655108] Tue, 12 July 2011 12:50 Go to previous messageGo to next message
Franco  is currently offline Franco
Messages: 1
Registered: July 2011
Junior Member
Hi

I have the same problem, please can someone give some clarification?


Thanks a lot
Franco
Re: CDT new Project Template Registration [message #893400 is a reply to message #695858] Tue, 03 July 2012 17:37 Go to previous messageGo to next message
Javier Tarres is currently offline Javier Tarres
Messages: 2
Registered: July 2012
Junior Member
I also have same problem.
I have downloaded different versions of eclipse (the last was juno for RCP) with negative results.
Need some help
Thanks in advance
Javier

[Updated on: Tue, 03 July 2012 17:38]

Report message to a moderator

Re: CDT new Project Template Registration [message #936216 is a reply to message #893400] Sun, 07 October 2012 16:31 Go to previous message
Andrei Tyapukhin is currently offline Andrei Tyapukhin
Messages: 1
Registered: October 2012
Junior Member
hi,
not sure that question still be actual for you,
but I've started to learn Eclipse templates for creating own wizards and met similar problems.
I was able to resolve them for myself.
so, try to apply next changes to provided template xml source
1. do not apply [7.Specify a filterPattern "|" .] item -leave filter empty - you will see your wizard in New projects category.
in general it's already enough to see project.

2. remove (or comment out) part of xml related to [<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject ">]
This item could be specific for my proejct, but with this item i faced with error about mismatching targetType

Hope this information will be useful for you.
tried my solution with Eclipse Juno CDT version.
good luck
Previous Topic:Overide the fetching/saving contents of C/H/CPP file
Next Topic:Compiler Visual C++ Builds but no Output Files
Goto Forum:
  


Current Time: Sat Jul 26 05:20:58 EDT 2014

Powered by FUDForum. Page generated in 0.01936 seconds