Hi Xavier,
That works very well thank you !
I’ve another issue :
I need to add a new Wizard page and some operations (files copy for example) but the wizard page is based on
- Nature, no it’s a cnature and I want to keep it
- Project type, no it’s a org.eclipse.cdt.build.core.buildArtefactType.exe
- Toolchain, I’ve already define toolchain and I want to use it
So how can I discriminate my project to add the new wizard only if it’s chosen ?
Thank you !
Chris
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Xavier Raynaud
Sent: Thursday, September 26, 2013 2:44 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] How can I make a new projectType under Executable directory ?
Hi Christelle,
It is described here:
http://help.eclipse.org/kepler/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_core_templates.html?cp=13_1_1_13
You have to use "org.eclipse.cdt.core.templates" extention point:
Example:
<extension point="org.eclipse.cdt.core.templates">
<template
filterPattern=".*gcc"
id="com.st.christelle.burguera.template"
location="$nl$/templates/christelle.burguera/template.xml"
projectType="org.eclipse.cdt.build.core.buildArtefactType.exe">
</template>
</extension>
Example of content for "templates/christelle.burguera/template.xml":
<?xml version="1.0" encoding="ISO-8859-1"?>
<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Christelle Burguera"
copyright="Copyright (c) 2013 Christelle Burguera"
id="com.st.christelle.burguera.template" label="Christelle Burguera project" description="A simple application."
help="help.html">
<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
<simple name="name" value="$(projectName)" />
<simple name="artifactExtension" value="exe" />
<simple name="isCProject" value="true" />
</process>
<process type="org.eclipse.cdt.core.AddFiles">
<simple name="projectName" value="$(projectName)"/>
<complex-array name="files">
<element>
<simple name="source" value="example.c"/>
<simple name="target" value="$(projectName).c"/>
<simple name="replaceable" value="true"/>
</element>
<element>
<simple name="source" value="launchConfig.launch"/>
<simple name="target" value="$(projectName).launch"/>
<simple name="replaceable" value="true"/>
</element>
</complex-array>
</process>
<!-- if you want to add misc flags to gcc
<process type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringOptionValue">
<simple name="projectName" value="$(projectName)"/>
<complex-array name="resourcePaths">
<element>
<simple name="id" value="gnu.c.compiler.option.misc.other"/>
<simple name="value" value=" -mymiscflag "/>
<simple name="path" value=""/>
</element>
</complex-array>
</process>
-->
<!-- if you want to add misc flags to ld
<process type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringOptionValue">
<simple name="projectName" value="$(projectName)"/>
<complex-array name="resourcePaths">
<element>
<simple name="id" value="gnu.c.link.option.ldflags"/>
<simple name="value" value=" -mymiscflag "/>
<simple name="path" value=""/>
</element>
</complex-array>
</process>
-->
<process type="org.eclipse.cdt.managedbuilder.core.GenerateMakefileWithBuildDescription">
<simple name="projectName" value="$(projectName)" />
</process>
<!-- if you want to add misc flags to ld
<process type="org.eclipse.cdt.ui.OpenFiles">
<simple name="projectName" value="$(projectName)" />
<complex-array name="files">
<element>
<simple name="target" value="$(projectName).c"/>
</element>
</complex-array>
</process>
</template>
Finally, you may want to associate a particular toolchain with this project.
To do that, see http://help.eclipse.org/kepler/topic/org.eclipse.cdt.doc.isv/reference/extension-points/org_eclipse_cdt_core_templateAssociations.html?cp=13_1_1_11
Xavier Raynaud
On 09/26/2013 01:59 PM, Christelle BURGUERA wrote:
Hi All !
I want to add an executable “homemade” project under C Projet Wizard.
When you create a “New C Project” you have a list of Project Type :
+ Executable
Empty Project
Hello World ANSI C Project
+ Shared Library …
I need to add my projectType under Executable :
+ Executable
Empty Project
Hello World ANSI C Project
MyProjectType
+ Shared Library …
I tried to add an extension point org.eclipse.cdt.managedbuilder.core.buildDefinitions with a projectType define with a buildArtefactType = org.eclipse.cdt.build.core.buildArtefactType.exe, a configuration, a toolchain…
The project works well BUT the projectType I create is badly located
+ Executable
Empty Project
Hello World ANSI C Project
+ Shared Library
+ Static Library
MyProjectType
+ Makefile project
MyProjectType has an icon not directory like Executable and neither a projectType like Empty Project, but an other icon…. See the attachment.
Is somebody has an idea ?
Thank you !
Chris
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev