mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Put in a hack to force any projects using the New C Project Wizard to be simple makefile projects.
This commit is contained in:
parent
ba02f49a64
commit
c60e1cf2ad
2 changed files with 35 additions and 4 deletions
|
@ -72,7 +72,8 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.3.0,4.0.0)",
|
|||
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)",
|
||||
org.eclipse.cdt.refactoring;bundle-version="[4.0.0,5.0.0)",
|
||||
org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)",
|
||||
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)"
|
||||
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
|
||||
org.eclipse.cdt.managedbuilder.core
|
||||
Eclipse-LazyStart: true
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||
Import-Package: com.ibm.icu.text
|
||||
|
|
|
@ -16,9 +16,6 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
|
@ -48,6 +45,19 @@ import org.eclipse.ui.ide.IDE;
|
|||
import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
|
||||
import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
|
||||
|
||||
/**
|
||||
* C Project wizard that creates a new project resource in
|
||||
|
@ -326,6 +336,26 @@ public abstract class NewCProjectWizard extends BasicNewResourceWizard implement
|
|||
description.setLocation(newPath);
|
||||
|
||||
newProject = CCorePlugin.getDefault().createCProject(description, newProjectHandle, monitor, getProjectID());
|
||||
|
||||
// Create the build info for this project
|
||||
CoreModel coreModel = CoreModel.getDefault();
|
||||
ICProjectDescription des = coreModel.getProjectDescription(newProject);
|
||||
des = coreModel.createProjectDescription(newProject, true);
|
||||
ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(newProject);
|
||||
ManagedProject mProj = new ManagedProject(des);
|
||||
info.setManagedProject(mProj);
|
||||
|
||||
String s = "0"; //$NON-NLS-1$
|
||||
String name = "default"; //$NON-NLS-1$
|
||||
Configuration cfg = new Configuration(mProj, null, ManagedBuildManager.calculateChildId(s, null), name);
|
||||
IBuilder bld = cfg.getEditableBuilder();
|
||||
if (bld != null)
|
||||
bld.setManagedBuildOn(false);
|
||||
cfg.setArtifactName(newProject.getName());
|
||||
CConfigurationData data = cfg.getConfigurationData();
|
||||
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||
coreModel.setProjectDescription(newProject, des);
|
||||
|
||||
return newProject;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue