ICProjectDescriptionManager mngr =
CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des =
mngr.createProjectDescription(project, false, !onFinish);
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
ManagedProject mProj = new ManagedProject(des);
info.setManagedProject(mProj);
monitor.worked(20);
cfgs = CfgHolder.unique(getCfgItems(false));
cfgs = CfgHolder.reorder(cfgs);
int work = 50 / cfgs.length;
for (int i = 0; i < cfgs.length; i++) {
String s = (cfgs[i].getToolChain() == null) ?
"0" : ((ToolChain)(cfgs[i].getToolChain())).getId(); //$NON-NLS-1$
Configuration cfg = new Configuration(
mProj,
(ToolChain)cfgs[i].getToolChain(),
ManagedBuildManager.calculateChildId(s, null),
cfgs[i].getName());
cfgs[i].setConfiguration(cfg);
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(mProj.getDefaultArtifactName());
CConfigurationData data = cfg.getConfigurationData();
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
monitor.worked(work);
}
mngr.setProjectDescription(project, des);