Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Trouble getting template engine to work

I want to make some simple projects to show up in the new project list,
similar to the "Hello World" C project.

I've read thru the help for the template engine in the ISV docs.
It's misleading because it appears that some of the packages and names of
things changed after it was committed.
I think I finally got these names right, and created a patch in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=203553

Can someone confirm that my changes are correct?  They at least let me
create the extension that looks basically right.

I used a template that was a copy of the HelloWorldCAnsiProject that is in
the org.eclipse.cdt.managedbuilder.gnu.ui plug-in, just gives it a
different name.
When I run, however, I don't see any changes to the new project wizard page
of projects.
Here is my extension information:
   <extension
         point="org.eclipse.cdt.core.templates":>
      <template
            filterPattern=" "
            id=
"org.eclipse.ptp.pldt.projects.HelloMPIWorldCProject"      // this is
<projectID>.HelloMPIWorldCProject
            location="templates/HelloMPIWorldCproject/template.xml"
            projectType="org.eclipse.cdt.build.projectType.exe">
      </template>
   </extension>.

The template.xml is a copy of  HelloWorldCAnsiProject's  template.xml
except for the initial tag, which is as follows.
I believe the only changed value of importance is the
id="HelloMPIWorldCProject" which matches the id in the extension above.
<template type="ProjTempl" version="1.0" supplier="Eclipse.org"
revision="1.0" author="Beth Tibbitts (IBM Research)"
            copyright="blah blah "
            id="HelloMPIWorldCProject"
label="%HelloWorld.CAnsitemplate.label"
description="%HelloWorld.CAnsitemplate.description"
             help="help.html">
The rest of that directory from org.eclipse.cdt.managedbuilder.gnu.ui's
HelloWorldCAnsiProject  directory is reproduced too.

How are the IDs supposed to match up? I thought the template ID should
probably mach the template.xml's id attribute but the example for
HelloWorldCAnsiProject doesn't.

What did I omit?  Are any templateAssociations required like in
org.eclipse.cdt.managedbuilder.gnu.ui ?

Eventually I want to add an extra wizard page when the user selects this
template.
I already have the wizard page which is an extension of MBSCustomPage.
They both extend IWizardPage.
I assume that would get referenced from the
pagesAfterTemplateSelectionProvider.
Hopefully I can reuse most of my MBSCustomPage.  It adds values to e.g.
include path and changes the build command.

Help! Any help in getting started would be appreciated.

...Beth

Beth Tibbitts  (859) 243-4981  (TL 545-4981)
High Productivity Tools / Parallel Tools  http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address:  IBM Corp., 455 Park Place, Lexington, KY 40511



Back to the top