Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How can I do a persistent modification to an AbstractBuildCommandParser-instance?
How can I do a persistent modification to an AbstractBuildCommandParser-instance? [message #1780745] Fri, 26 January 2018 15:02
Thomas Runge is currently offline Thomas RungeFriend
Messages: 1
Registered: January 2018
Junior Member
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?
Previous Topic:Whats the state of CMake Build Support ?
Next Topic:CDT linker error with cmake-generated project
Goto Forum:
  


Current Time: Sun Feb 18 03:38:13 GMT 2018

Powered by FUDForum. Page generated in 0.01813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software