Please see my FAQ at http://cdt-devel-faq.wikidot.com.
Andras
From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Shaiju P Nair
Sent: Monday, December 17, 2007
7:44 AM
To: CDT
General developers list.
Cc: cdt-dev-bounces@xxxxxxxxxxx
Subject: Re: [cdt-dev] How to
create a Std make project ?
But this does not
solve my problem. My problem is not about creating the cproject . It gets
created. But when I set build command , binary parser etc information
,those
things are not getting saved ( both programatically and using the cdt UI).
On
Dec 17, 2007 10:39 AM, 安立君 <lijun@xxxxxxxxxxxxxxx> wrote:
dear Shaiju,
void
createCProject(IProject project){
IWorkspace workspace =
ResourcesPlugin.getWorkspace();
IProjectDescription
description = workspace
.newProjectDescription(project.getName());
NullProgressMonitor Monitor =
new NullProgressMonitor();
IProject newProject =
CCorePlugin.getDefault ().createCProject(
description, newProjectHandle, Monitor, getProjectID());
// Add the managed build
nature and builder
try {
addNature(new SubProgressMonitor(Monitor, 2), newProject);
} catch (CoreException e) {
e.printStackTrace();
}
// for c++ project
if (cfg.getCPPProject()) {
CCProjectNature.addCCNature(newProject, Monitor);
}
// Add the ManagedProject to the project
...
ManagedBuildManager.saveBuildInfo(newProject,
true);
Best regards
Lijun
------------------------------------------------------------------
SUNNORTH TECHNOLOGY CO.,LTD.
Hello
I am
trying to create std
make project programatically
.
I created the IProject and placed necessary natures for it, then I
want to create cproject file. I am trying to do that the follwing way, it creates
the cproject file but it does not have the intented information in it
like the
build command, binary parser etc. Once the project got
created I tried to set those using the CDT UI. I
typed in the build command , I can see that in UI but the cproject
is not getting updated . Is there anything wrong with the way
in which I create the project ?
void
createCProject(IProject project){
ICProjectDescription des =
CoreModel.getDefault().createProjectDescription(project, true);
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
ManagedProject mProj = new ManagedProject(des);
info.setManagedProject(mProj);
Configuration cfg = new Configuration(mProj, null,
ManagedBuildManager.calculateChildId("0", null),
"Default");
IBuilder bld = cfg.getEditableBuilder();
if (bld != null) {
if(bld.isInternalBuilder()){
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration
(false);
IBuilder prefBuilder = prefCfg.getBuilder();
cfg.changeBuilder (prefBuilder, ManagedBuildManager.calculateChildId(cfg.getId(),
null), prefBuilder.getName());
bld = cfg.getEditableBuilder();
bld.setBuildPath(null);
}
bld.setManagedBuildOn(false);
}
cfg.setArtifactName((project.getName().trim()));//
bld.setCommand("elf-make");
String
binErrParserIds[] ={"com.parser.elf"};//need to remove hard code
cfg.setErrorParserList(binErrParserIds);
CoreModel.getDefault().setProjectDescription(project, des);
}
Thanks
Shaiju.P
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
|