Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Problem adding new tool and file extension into MBS

Thanks - I will raise a bugzilla enhancement, but in the meantime will use a
workaround!

---
Derek  

> -----Original Message-----
> From: Treggiari, Leo [mailto:leo.treggiari@xxxxxxxxx] 
> Sent: 06 December 2005 03:49
> To: dmsubs@xxxxxxxxxxxxx; CDT General developers list.
> Subject: RE: [cdt-dev] Problem adding new tool and file 
> extension into MBS
> 
> Hi Derek,
> 
> It appears that the "New Source" dialog is for creating a 
> C/C++ source file and there is no way to extend it.  This is 
> the code that it looks like gets invoked:
> 
> public static boolean isValidSourceUnitName(IProject project, String
> name) {
> 	IContentType contentType = CCorePlugin.getContentType(project,
> name);
> 	if (contentType != null) {
> 		String id = contentType.getId();
> 		if (CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)) {
> 			return true;
> 		} else if
> (CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)) {
> 			return true;
> 		} else if
> (CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(id)) {
> 			return true;
> 		}
> 	}
> 	return false;
> }
> 
> You can have your users ignore the warning, or use New -> 
> File, or try to add your own New -> xlate Source File menu 
> item in your plugin.
> 
> You can also add a bugzilla enhancement request if you want.
> 
> Leo
> 
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of dmsubs
> Sent: Monday, December 05, 2005 1:05 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Problem adding new tool and file extension into MBS
> 
> Hi,
> 
> I'm having a problem while trying to add a new tool and file 
> extension to the MBS as part of a Managed Make C project. 
> 
> The tool is called 'xlate' and it converts a .xc file to a .c 
> source file that can then be built with the standard C tools 
> (compiler/linker). It is similar in concept to yacc/bison.
> 
> The problem is that having created a project, if I try to 
> create a source file with a .xc extension, I get the error 
> "File name is discouraged.
> File
> extension does not correspond to known source file types.". 
> 
> What have I missed in my plugin?
> 
> I am using Eclipse 3.1.1 and CDT 3.0.1. I am developing the 
> plug-in with the PDE. To create the integration, I have 
> followed the Example Tool Integration example in the Managed 
> Build System Extensibility document provided with 3.0.1. I 
> have then tried to modify it by adding a new tool called 
> xlate and it's associated inputType and outputType, which 
> generates the following
> plugin.xml:
> 
> <tool
>   command="xlate"
>   id="example.toolchain.xlate"
>   isAbstract="false"
>   name="Translator"
>   natureFilter="both" >
>   <inputType
>  
> dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.i
> nternal.De
> faul
> tIndexerDependencyCalculator"
>       dependencyContentType="org.eclipse.cdt.core.cHeader"
>       id="example.toolchain.xlate.input"
>       name="Translator Input"
>       primaryInput="true"
>       sources="xc"/>
>   <outputType
>       id="example.toolchain.xlate.output"
>       name="TranslatorOutput"
>       outputContentType="org.eclipse.cdt.core.cSource"
>       outputs="c"
>       primaryOutput="true"/>
> </tool>
> 
> I am then defining content-type, which generates the 
> following in plugin.xml <extension 
> point="org.eclipse.core.runtime.contentTypes">
>       <content-type
>             base-type="org.eclipse.core.runtime.text"
>             file-extensions="xc"
>             id="xlateC"
>             name="xlateC"
>             priority="high"/>
>    </extension>
> 
> 
> ---
> Derek 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top