IConfiguration config = projectConfigs[i];
IResourceConfiguration resourceConfig = null;
resourceConfig = config.getResourceConfiguration(path);
ITool[] tools = resourceConfig.getTools();
for (int j = 0; j < tools.length; j++) {
modified |= setOption(id, value, resourceConfig,
tools[j].getOptions(), tools[j], settingsMode);
}
"path" is the project relative file that you want to set the options for
This peice of code is looking for particular option id's across all applicable tools, but hopefully this will provide some help to get you going. Feel free to ask more question.
Doug writes:
> What I would do is stick breakpoints in places and see how the UI does it.
I have been doing that. I set a breakpoint in org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.setOption(IResourceInfo, IHoldsOptions, IOption, String) and it triggers when I open the Properties dialog for a file, expand "C/C++ Build", select "Settings", and then "Miscellaneous" in the Tool Settings tab. I can see the arguments, and presumably if I can call setOption with the same arguments I'll get the same results in the .cproject file. But I haven't been able to figure out how to do that. Do you have any suggestions for how I figure out where those objects are created so I can set breakpoints there?
> I’m not sure anyone here these days knows the answer.
I'm sorry to hear that. I guess the engineers who wrote that code no longer work on CDT?
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev