Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66659 Details for
Bug 184593
[Template Engine] Need a way to add tool-chain associations to existing templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for changing the common identifier from location to id.
patch.txt (text/plain), 18.88 KB, created by
Bala Torati
on 2007-05-10 08:57:14 EDT
(
hide
)
Description:
Patch for changing the common identifier from location to id.
Filename:
MIME Type:
Creator:
Bala Torati
Created:
2007-05-10 08:57:14 EDT
Size:
18.88 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core >Index: templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateInfo.java >--- templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java 26 Apr 2007 17:07:27 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo.java 10 May 2007 12:44:31 -0000 >@@ -27,10 +27,12 @@ > private String pagesProvider; > private boolean isCategory; > private String icon; >+ private String templateId; > >- public TemplateInfo(String projectTypeId, String filterPattern, String templatePath, >+ public TemplateInfo(String templateId, String projectTypeId, String filterPattern, String templatePath, > String pluginId, Set toolChainIdSet, String usageDescription, > String pagesProvider, boolean isCategory) { >+ this.templateId = templateId; > this.filterPattern = filterPattern; > this.templatePath = templatePath; > this.pluginId = pluginId; >@@ -50,6 +52,14 @@ > } > > /** >+ * Returns the Template ID >+ * @return String contains the template id. >+ */ >+ public String getTemplateId() { >+ return templateId; >+ } >+ >+ /** > * Returns the Template path as String. > * @return String containing the path. > */ >@@ -90,6 +100,10 @@ > return (String[]) toolChainIdSet.toArray(new String[toolChainIdSet.size()]); > } > >+ public void setToolChainSet(Set toolChainIdSet) { >+ this.toolChainIdSet = toolChainIdSet; >+ } >+ > /** > * @return the isCategory > */ >Index: templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java,v >retrieving revision 1.1 >diff -u -r1.1 TemplateEngine.java >--- templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java 26 Apr 2007 17:07:27 -0000 1.1 >+++ templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java 10 May 2007 12:44:31 -0000 >@@ -13,6 +13,7 @@ > import java.io.IOException; > import java.net.URL; > import java.util.ArrayList; >+import java.util.Arrays; > import java.util.HashMap; > import java.util.HashSet; > import java.util.Iterator; >@@ -40,6 +41,7 @@ > public class TemplateEngine { > > public static String TEMPLATES_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".templates"; //$NON-NLS-1$ >+ public static String ADD_TOOLCHAINS_TO_TEMPLATE_EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".addToolChainsToTemplate"; //$NON-NLS-1$ > > /** > * static reference to the Singleton TemplateEngine instance. >@@ -190,6 +192,7 @@ > * extension point "templates" > */ > private void initializeTemplateInfoMap() { >+ String templateId = null; > String location = null; > String pluginId = null; > String projectType = null; >@@ -205,6 +208,7 @@ > pluginId = extension.getNamespaceIdentifier(); // Plugin-id of the extending plugin. > for(int j=0; j<configElements.length; j++) { > IConfigurationElement config = configElements[j]; >+ templateId = config.getAttribute(TemplateEngineHelper.ID); > location = config.getAttribute(TemplateEngineHelper.LOCATION); > projectType = config.getAttribute(TemplateEngineHelper.PROJECT_TYPE); > filterPattern = config.getAttribute(TemplateEngineHelper.FILTER_PATTERN); >@@ -218,7 +222,7 @@ > toolChainIdSet.add(toolChainConfigs[k].getAttribute(TemplateEngineHelper.ID)); > } > >- TemplateInfo templateInfo = new TemplateInfo(projectType, filterPattern, location, >+ TemplateInfo templateInfo = new TemplateInfo(templateId, projectType, filterPattern, location, > pluginId, toolChainIdSet, > usage, extraPagesProvider, isCategory); > if (!templateInfoMap.containsKey(projectType)) { >@@ -227,8 +231,38 @@ > ((List/*<TemplateInfo>*/)templateInfoMap.get(projectType)).add(templateInfo); > } > } >+ // Check for tool Chains added to the templates outside template info definition >+ addToolChainsToTemplates(); > } > >+ private void addToolChainsToTemplates() { >+ String templateId = null; >+ TemplateInfo[] templateInfos = getTemplateInfos(); >+ >+ IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint(ADD_TOOLCHAINS_TO_TEMPLATE_EXTENSION_ID).getExtensions(); >+ for(int i=0; i<extensions.length; i++) { >+ IExtension extension = extensions[i]; >+ IConfigurationElement[] configElements = extension.getConfigurationElements(); >+ for(int j=0; j<configElements.length; j++) { >+ IConfigurationElement config = configElements[j]; >+ templateId = config.getAttribute(TemplateEngineHelper.ID); >+ >+ IConfigurationElement[] toolChainConfigs = config.getChildren(TemplateEngineHelper.TOOL_CHAIN); >+ Set toolChainIdSet = new HashSet(); >+ for (int k=0; k < toolChainConfigs.length; k++) { >+ toolChainIdSet.add(toolChainConfigs[k].getAttribute(TemplateEngineHelper.ID)); >+ } >+ >+ for (int k=0; k < templateInfos.length; k++) { >+ if (templateInfos[k].getTemplateId().equals(templateId)) { >+ toolChainIdSet.addAll(Arrays.asList(templateInfos[k].getToolChainIds())); >+ templateInfos[k].setToolChainSet(toolChainIdSet); >+ } >+ } >+ } >+ } >+ } >+ > /** > * Gets an array of template info objects matching the criteria passed as params. > */ >Index: schema/templates.exsd >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/schema/templates.exsd,v >retrieving revision 1.1 >diff -u -r1.1 templates.exsd >--- schema/templates.exsd 26 Apr 2007 17:07:27 -0000 1.1 >+++ schema/templates.exsd 10 May 2007 12:44:31 -0000 >@@ -108,6 +108,13 @@ > </documentation> > </annotation> > </attribute> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> > </complexType> > </element> > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/plugin.xml,v >retrieving revision 1.110 >diff -u -r1.110 plugin.xml >--- plugin.xml 26 Apr 2007 17:07:27 -0000 1.110 >+++ plugin.xml 10 May 2007 12:44:31 -0000 >@@ -629,6 +629,7 @@ > <extension-point id="templates" name="Templates Extension point" > schema="schema/templates.exsd"/> > <extension-point id="templateProcessTypes" name="Process Types Extension point" schema="schema/templateProcessTypes.exsd"/> >+ <extension-point id="addToolChainsToTemplate" name="Add Tool Chains To Templates" schema="schema/addToolChainsToTemplate.exsd"/> > > <extension > point="org.eclipse.cdt.core.templateProcessTypes"> >Index: schema/addToolChainsToTemplate.exsd >=================================================================== >RCS file: schema/addToolChainsToTemplate.exsd >diff -N schema/addToolChainsToTemplate.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/addToolChainsToTemplate.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,131 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.cdt.core"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.cdt.core" id="addToolChainsToTemplate" name="Add ToolChains to Template"/> >+ </appInfo> >+ <documentation> >+ This extension point facilitates adding new toolchains generated from a different plugin to already defined template without modifying template definition. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <documentation> >+ Extension point added to Template Engine plugin. Any plugin, which intends to contribute XML templates to Temaplate Engine has to extend this extension point, and add template element. >+ </documentation> >+ </annotation> >+ <complexType> >+ <sequence> >+ <sequence> >+ <element ref="template" minOccurs="0" maxOccurs="unbounded"/> >+ </sequence> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ Id for the extension in the extender plugin. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="toolChain"> >+ <complexType> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="template"> >+ <complexType> >+ <sequence> >+ <element ref="toolChain" minOccurs="0" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ This extension point was added in CDT 4.0 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="implementation"/> >+ </appInfo> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2007 Symbian Software Limited and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+ >+Contributors: >+Symbian - Initial API and implementation >+ </documentation> >+ </annotation> >+ >+</schema> >#P org.eclipse.cdt.managedbuilder.gnu.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml,v >retrieving revision 1.25 >diff -u -r1.25 plugin.xml >--- plugin.xml 28 Apr 2007 12:29:10 -0000 1.25 >+++ plugin.xml 10 May 2007 12:44:32 -0000 >@@ -3733,6 +3733,7 @@ > > <extension point="org.eclipse.cdt.core.templates"> > <template >+ id="org.eclipse.cdt.managedbuilder.gnu.ui.templates.HelloWorldCCProject" > filterPattern=".*" > location="templates/projecttemplates/HelloWorldCCProject/template.xml" > projectType="org.eclipse.cdt.build.core.buildArtefactType.exe"> >@@ -3743,6 +3744,7 @@ > <toolChain id="cdt.managedbuild.toolchain.gnu.solaris.base"/> > </template> > <template >+ id="org.eclipse.cdt.managedbuilder.gnu.ui.templates.HelloWorldCAnsiProject" > filterPattern=".*" > location="templates/projecttemplates/HelloWorldCAnsiProject/template.xml" > projectType="org.eclipse.cdt.build.core.buildArtefactType.exe"> >@@ -3753,6 +3755,7 @@ > <toolChain id="cdt.managedbuild.toolchain.gnu.solaris.base"/> > </template> > <template >+ id="org.eclipse.cdt.managedbuilder.gnu.ui.templates.EmptyProject" > filterPattern=".*" > location="templates/projecttemplates/EmptyProject/template.xml" > projectType="org.eclipse.cdt.build.core.buildArtefactType.exe"> >#P org.eclipse.cdt.core.tests >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/plugin.xml,v >retrieving revision 1.45 >diff -u -r1.45 plugin.xml >--- plugin.xml 26 Apr 2007 17:07:14 -0000 1.45 >+++ plugin.xml 10 May 2007 12:44:33 -0000 >@@ -65,12 +65,14 @@ > <extension > point="org.eclipse.cdt.core.templates"> > <template >+ id="org.eclipse.cdt.core.tests.templates.AddFile" > filterPattern=".*AddFile" > isCategory="true" > location="testdata/AddFile.xml" > projectType="org.eclipse.cdt.core.tests.projectType"> > </template> > <template >+ id="org.eclipse.cdt.core.tests.templates.AddFiles" > filterPattern=".*AddFiles" > location="testdata/AddFiles.xml" > projectType="org.eclipse.cdt.core.tests.projectType"> >@@ -78,30 +80,49 @@ > <toolChain id="org.eclipse.cdt.core.tests.toolChain2"/> > </template> > <template >+ id="org.eclipse.cdt.core.tests.templates.AddLink" > filterPattern=".*AddLink" > location="testdata/AddLink.xml" > projectType="org.eclipse.cdt.core.tests.projectType"> > </template> > <template >+ id="org.eclipse.cdt.core.tests.templates.Append" > filterPattern=".*Append" > location="testdata/Append.xml" > projectType="org.eclipse.cdt.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.core.tests.templates.AppendCreate" > filterPattern=".*AppendCreate" > location="testdata/AppendCreate.xml" > projectType="org.eclipse.cdt.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.core.tests.templates.Copy" > filterPattern=".*Copy" > location="testdata/Copy.xml" > projectType="org.eclipse.cdt.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.core.tests.templates.CreateResourceIdentifier" > filterPattern=".*CreateResourceIdentifier" > location="testdata/CreateResourceIdentifier.xml" > projectType="org.eclipse.cdt.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.core.tests.templates.CreateSourceFolder" > filterPattern=".*CreateSourceFolder" > location="testdata/CreateSourceFolder.xml" > projectType="org.eclipse.cdt.core.tests.projectType"/> > </extension> >+ <extension >+ point="org.eclipse.cdt.core.addToolChainsToTemplate"> >+ <template >+ id="org.eclipse.cdt.core.tests.templates.AddFile"> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain3"/> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain4"/> >+ </template> >+ <template >+ id="org.eclipse.cdt.core.tests.templates.AddFiles"> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain5"/> >+ <toolChain id="org.eclipse.cdt.core.tests.toolChain6"/> >+ </template> >+ </extension> > > </plugin> >#P org.eclipse.cdt.managedbuilder.core.tests >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml,v >retrieving revision 1.54 >diff -u -r1.54 plugin.xml >--- plugin.xml 28 Apr 2007 18:08:26 -0000 1.54 >+++ plugin.xml 10 May 2007 12:44:35 -0000 >@@ -6657,34 +6657,42 @@ > <extension > point="org.eclipse.cdt.core.templates"> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.AppendToMBSStringOptionValue" > filterPattern=".*AppendToMBSStringOptionValue" > location="testdata/AppendToMBSStringOptionValue.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.AppendToMBSStringListOptionValues" > filterPattern=".*AppendToMBSStringListOptionValues" > location="testdata/AppendToMBSStringListOptionValues.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.CreateIncludeFolder" > filterPattern=".*CreateIncludeFolder" > location="testdata/CreateIncludeFolder.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.ExcludeResources" > filterPattern=".*ExcludeResources" > location="testdata/ExcludeResources.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.NewManagedProject" > filterPattern=".*NewManagedProject" > location="testdata/NewManagedProject.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.SetMBSBooleanOptionValue" > filterPattern=".*SetMBSBooleanOptionValue" > location="testdata/SetMBSBooleanOptionValue.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.SetMBSStringOptionValue" > filterPattern=".*SetMBSStringOptionValue" > location="testdata/SetMBSStringOptionValue.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/> > <template >+ id="org.eclipse.cdt.managedbuilder.core.tests.templates.SetMBSStringListOptionValues" > filterPattern=".*SetMBSStringListOptionValues" > location="testdata/SetMBSStringListOptionValues.xml" > projectType="org.eclipse.cdt.managedbuilder.core.tests.projectType"/>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 184593
:
66659
|
66664