| [cdt-dev] CoreModel.setProjectDescription() vs ManagedBuildManager.saveBuildInfo() |
|
Hi all, Oleg recently posted some code fragment on
how to set the build command in a project. It used CoreModel.setProjectDescription
to save the changes. I just stumbled upon ManagedBuildManager.saveBuildInfo()
which seems to work as well, and is more straightforward. Which one is the
preferred way, and how are they different? Using ManagedBuildManager:
It appears that I can go via
projectdescriptions as well, at least the following works too: IProject project = ...; ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project); IConfiguration configuration = ManagedBuildManager.getConfigurationForDescription(projectDescription.getActiveConfiguration()); configuration.setBuildCommand("gmake"); configuration.setBuildArguments("-f
Makefile.mine"); CoreModel.getDefault().setProjectDescription(project,
projectDescription); Can someone cast some light please how these
two ways differ, and which one is better / preferred? Regards, Andras ------ Andras Varga CTO Simulcraft Inc www.omnest.com
/ www.omnetpp.org From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Krasilnikov, Oleg Marko, In brief, procedure looks like follows: IProject project = ...; // I hope you have
it ICProjectDescription prjd = ...; // I hope
you have it ICConfigurationDescription cfgd = ...; //
I hope you have it // change your fields IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd); IBuilder bldr = cfg.getEditableBuilder(); String command = ...; // command without
parameters String arguments = ...; // in
Property page, user's line is split to cmd and args. boolean cleanState = ...; bldr.setCommand(command); bldr.setArguments(arguments); bldr.setCleanBuildEnable(cleanState); // to save your changes, you need do this
(normally called when <OK>/<Apply> pressed) : CoreModel.getDefault().setProjectDescription(project, prjd); You can find some samples of config
setting in CDT Property pages UI. They are located in 2 places: org.eclipse.cdt.managedbuilder.ui.properties
(for MBS-specific settings) org.eclipse.cdt.ui.newui (for CDT core
settings). All classes representing Property pages
context have "*Tab" name (ex.: ErrorParsTab.java) In your case, changing build command
is performed in org.eclipse.cdt.managedbuilder.ui.properties/BuilderSettingsTab.java, and clean build enabling is made
on neighbour tab: org.eclipse.cdt.managedbuilder.ui.properties/BuildBehaviourTab.java, ----------------------------------- From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Tomljenovic Marko (G2/PJ-PMT2) Hello
guys, I
am trying to configure a Standard Make CDT (4.0.2) project programmatically. I
have managed to create a new configuration but now I am stuck on setting the
different settings (e.g. build command, enable clean build, ...) I
am really searching for quite a while and I cannot find the solution!
Pls
hlp Greetings
Marko T. --------------------------------------------------------------------Closed Joint Stock Company Intel A/ORegistered legal address: 125252, Chapayevsky Per, 14.This e-mail and any attachments may contain confidential material forthe sole use of the intended recipient(s). Any review or distributionby others is strictly prohibited. If you are not the intendedrecipient, please contact the sender and delete all copies. |