The proper way to navigate through project configurations/tools in 2.1 [message #146603] |
Tue, 07 June 2005 22:24 |
Tony Allowatt Messages: 2 Registered: July 2009 |
Junior Member |
|
|
I've been working on a plugin that creates a new Managed C++ project
wizard (subclasses NewManagedCCProjectWizard) and performs some
additional tasks in performFinish() such as adding extra include
directories to the project settings.
The way I did this in CDT 2.0 was:
* Get an ITarget[] from ManagedBuildManager.getTargets(project)
* For each ITarget,
* Get an IConfiguration[] from the ITarget
* For each IConfiguration,
* Get the C++ compiler ITool with
IConfiguration.getToolById("cdt.managedbuild.tool.gnu.cpp.compiler ")
* Get the IOptions with ITool.getOptionById and set it
Now I'm trying to port this over to the new 2.1 model, and I've run
into a couple problems. I'm not even sure if I'm doing this the
recommended way, because I haven't seen any documentation or other
newsgroup posts in the archive that might point me in the right
direction. What I do now is:
* Get an IManagedBuildInfo from ManagedBuildManager.getBuildInfo(project)
* Get an IManagedProject from IManagedBuildInfo.getManagedProject()
* Get an IConfiguration[] from the IManagedProject
* For each IConfiguration,
* Try to get the ITool for the compiler with IConfiguation.getTool("...")
Here's the problem -- the id of the tool I want is no longer
"cdt.managedbuild.tool.gnu.cpp.compiler". It has platform-specific
qualifiers attached, so on my Mac, I see that the corresponding tool is
now
" cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.debug.4470 84333 ". My
call to .getTool() now returns null.
What's the recommended way of accessing that tool now? Should I just
iterate through all the ITools in a configuration and grab the one that
starts with "cdt.managedbuild.tool.gnu.cpp.compiler", or is there an
API that I can use that will automatically resolve the correct tool
despite the platform I'm on?
If anyone can point me to some documentation out there that I may have
missed, I'd greatly appreciate it. The Managed Build System
Extensibility document only seems to cover this from a declarative
standpoint, not from the actual API calls to deal with existing
projects.
Thanks,
--
Tony Allowatt
aallowat AT vt DOT edu
|
|
|
Powered by
FUDForum. Page generated in 0.04669 seconds