Please Help me with CDT_CONTAINER and setRawPathEntries [message #225310] |
Thu, 16 October 2008 13:30  |
Eclipse User |
|
|
|
Originally posted by: martin.meinstein.at
Hi,
I want to add an user defined CDT_CONTAINER to raw path entries. After i
add the container with setRawPathEntries, it was not in the array when i
call getRawPathEntries(), all other entries i set are in the container,
only my CDT_CONTAINER isn't.
Thanks for your help.
Best Regards
Martin
|
|
|
|
Re: Please Help me with CDT_CONTAINER and setRawPathEntries [message #225340 is a reply to message #225327] |
Fri, 17 October 2008 03:45   |
Eclipse User |
|
|
|
Originally posted by: martin.meinstein.at
Hi,
I already debugged the problem is that it seems the CDT_CONTAINER is an
very old feature and not supported anymore in the project configuration
file.
But is there another way to EASILY provide dynamic include paths and
macro definitions additional to standard managed make project
configuration. In short words, i want the default system includes and
macros provided by the default managed make project and Additionally my
own macros and and include paths, Without saving them in any eclipse
configuration file, that's the point.
Best Regards
Martin Reisenhofer
Anton Leherbauer schrieb:
> Martin Reisenhofer wrote:
>> Hi,
>>
>> I want to add an user defined CDT_CONTAINER to raw path entries. After
>> i add the container with setRawPathEntries, it was not in the array
>> when i call getRawPathEntries(), all other entries i set are in the
>> container, only my CDT_CONTAINER isn't.
>>
>> Thanks for your help.
>>
>> Best Regards
>>
>> Martin
>
> I am sorry, I cannot help you.
> Your best chance is to file a bug, debug the issue and provide a patch.
>
> Regards,
> Toni
|
|
|
Re: Please Help me with CDT_CONTAINER and setRawPathEntries [message #225362 is a reply to message #225340] |
Fri, 17 October 2008 05:29   |
Eclipse User |
|
|
|
Originally posted by: jamesblackburn+eclipse.mac.com
Martin Reisenhofer wrote:
> But is there another way to EASILY provide dynamic include paths and
> macro definitions additional to standard managed make project
> configuration. In short words, i want the default system includes and
> macros provided by the default managed make project and Additionally my
> own macros and and include paths, Without saving them in any eclipse
> configuration file, that's the point.
Ahh... You should have asked that question initially ;) -- as Toni said
the features which aren't used heavily by anyone, especially some of the
undocumented features in cdt.core, are a bit of a minefield.
You can provide macros / includes by:
1) Use the org.eclipse.cdt.core.externalSettingsProvider extension
point, give it an ID
2) Create a 'provider' element pointing at a class that extends
CExternalSettingProvider
3) Register the class on your CDT projects by adding your
settingsProvider ID to the configuration descriptions list of settings
providers:
externalSettingsProviders = new
LinkedHashSet<String> (Arrays.asList(ICConfigurationDescription.getExternalSetting sProviderIds()));
extSettings.add(ID)
ICConfigurationDescription.setExternalSettingsProviderIds(ex ternalSettingsProviders.toArray(new
String[0]));
4) You will get a call-back on:
public CExternalSetting[] getSettings(IProject project,
ICConfigurationDescription cfgd) {
5) which allows you to return appropriate macros and includes for the
given configuration desc.
6) CDT will cache this response, when there is a configuration change
which may require a change to your settings, you should call:
cfgd.updateExternalSettingsProviders(new String[] {ID});
This may seem more heavyweight that a simple XML contribution, but it
does give you fine grained control on the settings you return for a
given configuration, as well as control on when your settings are updated.
You'll probably find yourself adding custom option value handlers
anyway, and these along with whatever logic you use to create your
project is provides easy hooks to register and update your externally
provided settings.
It's greatly frustrating that these extension points aren't documented /
explained -- you could file a bug on this and we could try to formalize
the above!
Hope this helps
James
|
|
|
Re: Please Help me with CDT_CONTAINER and setRawPathEntries [message #225777 is a reply to message #225362] |
Thu, 23 October 2008 03:20  |
Eclipse User |
|
|
|
Originally posted by: martin.meinstein.at
Dear James,
Thanks of the Description of the ExternalSettingsProvider, at the
beginning of my Application i tried it with the external settings
provider, but i don't have success. But know i have an example to use
it, thanks a lot... :)
Best Regards
Martin
James Blackburn schrieb:
> Martin Reisenhofer wrote:
>> But is there another way to EASILY provide dynamic include paths and
>> macro definitions additional to standard managed make project
>> configuration. In short words, i want the default system includes and
>> macros provided by the default managed make project and Additionally
>> my own macros and and include paths, Without saving them in any
>> eclipse configuration file, that's the point.
>
>
> Ahh... You should have asked that question initially ;) -- as Toni said
> the features which aren't used heavily by anyone, especially some of the
> undocumented features in cdt.core, are a bit of a minefield.
>
> You can provide macros / includes by:
>
> 1) Use the org.eclipse.cdt.core.externalSettingsProvider extension
> point, give it an ID
> 2) Create a 'provider' element pointing at a class that extends
> CExternalSettingProvider
> 3) Register the class on your CDT projects by adding your
> settingsProvider ID to the configuration descriptions list of settings
> providers:
>
> externalSettingsProviders = new
> LinkedHashSet<String> (Arrays.asList(ICConfigurationDescription.getExternalSetting sProviderIds()));
>
> extSettings.add(ID)
> ICConfigurationDescription.setExternalSettingsProviderIds(ex ternalSettingsProviders.toArray(new
> String[0]));
>
> 4) You will get a call-back on:
> public CExternalSetting[] getSettings(IProject project,
> ICConfigurationDescription cfgd) {
> 5) which allows you to return appropriate macros and includes for the
> given configuration desc.
> 6) CDT will cache this response, when there is a configuration change
> which may require a change to your settings, you should call:
> cfgd.updateExternalSettingsProviders(new String[] {ID});
>
> This may seem more heavyweight that a simple XML contribution, but it
> does give you fine grained control on the settings you return for a
> given configuration, as well as control on when your settings are updated.
>
> You'll probably find yourself adding custom option value handlers
> anyway, and these along with whatever logic you use to create your
> project is provides easy hooks to register and update your externally
> provided settings.
>
> It's greatly frustrating that these extension points aren't documented /
> explained -- you could file a bug on this and we could try to formalize
> the above!
>
> Hope this helps
>
> James
|
|
|
Powered by
FUDForum. Page generated in 0.02327 seconds