From an eclipse CDT plugin, I want to automatically apply some modification to the "Compiler command pattern"-value of the "CDT GCC Build Output Parser" instance that is used in a project.
I was able to modify the corresponding setting via some code similar to the following snippet:
IProject project; // this is the given instance of my project
ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project, true);
ICConfigurationDescription defaultConfDesc = projectDescription.getDefaultSettingConfiguration();
List<ILanguageSettingsProvider> settingProviders = ((ILanguageSettingsProvidersKeeper) defaultConfDesc).getLanguageSettingProviders();
for (ILanguageSettingsProvider provider : settingProviders) {
// find the "CDT GCC Build Output Parsers" in all the enabled providers
if (provider.getName().equals("CDT GCC Build Output Parser")) {
AbstractBuildCommandParser bopParser = (AbstractBuildCommandParser) LanguageSettingsManager.getRawProvider(provider);
// Set "Compiler command Pattern" to some special value
bopParser.setCompilerPattern("arm-none-eabi-gcc.exe");
My problem now is that the new value set by the setCompilerPattern() call does not get stored persistently.
Do I have to do any additional thing besides calling setCompilerPattern() to make eclipse CDT aware of the setting update?
I am also a little confused about the getLanguageSettingProviders()-call shown above: Every call to getLanguageSettingProviders() seem to return new ILanguageSettingsProvider-copies. My assumption was that as long as I am referring to the same ICConfigurationDescription, getLanguageSettingProviders() would return the same list of ILanguageSettingProvider-instances.?
Anyone who is able to spot what I'm doing incorrectly?