1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

deprecate ties to old builder from nature and core plugin

This commit is contained in:
David Inglis 2003-09-16 22:07:34 +00:00
parent 9579841bcd
commit 9362cf3ae8
4 changed files with 75 additions and 103 deletions

View file

@ -1,3 +1,11 @@
2003-09-16 David Inglis
Deprecate old make builder
* src/org/eclipse/cdt/core/resources/MakeUtil.java
* src/org/eclipse/cdt/core/CCorePlugin.java
* src/org/eclipse/cdt/core/CProjectNature.java
2003-09-12 Alain Magloire
Patch from Bogdan Gheorghe, it corrected a NPE, when dealing with file extensions.
In a Unix enviroment binaries do not have extensions also some C++ headers

View file

@ -554,9 +554,9 @@ public class CCorePlugin extends Plugin {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
monitor.beginTask("Creating C Project", 3); //$NON-NLS-1$
monitor.beginTask("Creating C Project...", 3); //$NON-NLS-1$
if (!projectHandle.exists()) {
projectHandle.create(description, monitor);
projectHandle.create(description, new SubProgressMonitor(monitor, 1));
}
if (monitor.isCanceled()) {
@ -564,13 +564,13 @@ public class CCorePlugin extends Plugin {
}
// Open first.
projectHandle.open(monitor);
projectHandle.open(new SubProgressMonitor(monitor, 1));
// Add C Nature ... does not add duplicates
mapCProjectOwner(projectHandle, projectID, false);
CProjectNature.addCNature(projectHandle, new SubProgressMonitor(monitor, 1));
} finally {
//monitor.done();
monitor.done();
}
return projectHandle;
}
@ -595,20 +595,8 @@ public class CCorePlugin extends Plugin {
}
}
/**
* Method addDefaultCBuilder adds the default C make builder
* @param projectHandle
* @param monitor
* @exception CoreException
*/
public void addDefaultCBuilder(IProject projectHandle, IProgressMonitor monitor) throws CoreException {
// Set the Default C Builder.
CProjectNature.addCBuildSpec(projectHandle, monitor);
}
/**
* Method to convert a project to a C nature
* & default make builder (Will always add a default builder)
* All checks should have been done externally
* (as in the Conversion Wizards).
* This method blindly does the conversion.
@ -620,26 +608,7 @@ public class CCorePlugin extends Plugin {
* @exception CoreException
*/
public void convertProjectToC(IProject projectHandle, IProgressMonitor monitor, String projectID) throws CoreException {
this.convertProjectToC(projectHandle, monitor, projectID, true);
}
/**
* Method to convert a project to a C nature
* & default make builder (if indicated)
* All checks should have been done externally
* (as in the Conversion Wizards).
* This method blindly does the conversion.
*
* @param project
* @param String targetNature
* @param monitor
* @param projectID
* @param addMakeBuilder
* @exception CoreException
*/
public void convertProjectToC(IProject projectHandle, IProgressMonitor monitor, String projectID, boolean addMakeBuilder)
public void convertProjectToC(IProject projectHandle, IProgressMonitor monitor, String projectID)
throws CoreException {
if ((projectHandle == null) || (monitor == null) || (projectID == null)) {
return;
@ -648,23 +617,19 @@ public class CCorePlugin extends Plugin {
IProjectDescription description = workspace.newProjectDescription(projectHandle.getName());
description.setLocation(projectHandle.getFullPath());
createCProject(description, projectHandle, monitor, projectID);
if (addMakeBuilder) {
addDefaultCBuilder(projectHandle, monitor);
}
}
/**
* Method to convert a project to a C++ nature
* & default make builder(if indicated), if it does not have one already
*
* @param project
* @param String targetNature
* @param monitor
* @param projectID
* @param addMakeBuilder
* @exception CoreException
*/
public void convertProjectToCC(IProject projectHandle, IProgressMonitor monitor, String projectID, boolean addMakeBuilder)
public void convertProjectToCC(IProject projectHandle, IProgressMonitor monitor, String projectID)
throws CoreException {
if ((projectHandle == null) || (monitor == null) || (projectID == null)) {
return;
@ -672,31 +637,16 @@ public class CCorePlugin extends Plugin {
createCProject(projectHandle.getDescription(), projectHandle, monitor, projectID);
// now add C++ nature
convertProjectFromCtoCC(projectHandle, monitor);
if (addMakeBuilder) {
addDefaultCBuilder(projectHandle, monitor);
}
}
/**
* Method to convert a project to a C++ nature
* & default make builder,
* Note: Always adds the default Make builder
*
* @param project
* @param String targetNature
* @param monitor
* @param projectID
* @exception CoreException
*/
public void convertProjectToCC(IProject projectHandle, IProgressMonitor monitor, String projectID) throws CoreException {
this.convertProjectToCC(projectHandle, monitor, projectID, true);
}
/**
* Instanciate the class from the extension point "ProcessList"
* responsable of returning a list of process for this platform.
* @return
*/
// Extract the builder from the .cdtproject.
// public ICBuilder[] getBuilders(IProject project) throws CoreException {
// ICExtension extensions[] = fDescriptorManager.createExtensions(BUILDER_MODEL_ID, project);
// ICBuilder builders[] = new ICBuilder[extensions.length];
// System.arraycopy(extensions, 0, builders, 0, extensions.length);
// return builders;
// }
public IProcessList getProcessList() {
IExtensionPoint extension = getDescriptor().getExtensionPoint("ProcessList");
if (extension != null) {

View file

@ -90,37 +90,38 @@ public class CProjectNature implements IProjectNature {
/**
* Sets the path of the build command executable.
* @depercated
*/
public void setBuildCommand(IPath locationPath, IProgressMonitor monitor) throws CoreException {
String newLocation= locationPath.toString();
String oldLocation= fBuildInfo.getBuildLocation();
if (!newLocation.equals(oldLocation)) {
fBuildInfo.setBuildLocation(newLocation);
}
}
/**
* Gets the path of the build command executable.
* @deprecated
*/
public IPath getBuildCommand() throws CoreException {
if( fBuildInfo == null) {
fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
}
String buildLocation= fBuildInfo.getBuildLocation();
return new Path(buildLocation);
}
/**
* Sets the arguments for the full build.
* @deprecated
*/
public void setFullBuildArguments(String arguments, IProgressMonitor monitor) throws CoreException {
String oldArguments= fBuildInfo.getFullBuildArguments();
if (!arguments.equals(oldArguments)) {
fBuildInfo.setFullBuildArguments(arguments);
}
}
/**
* Gets the arguments for the full build
* @deprecated
*/
public String getFullBuildArguments() throws CoreException {
if( fBuildInfo == null) {
fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
}
String buildArguments= fBuildInfo.getFullBuildArguments();
if (buildArguments == null) {
buildArguments= "";
@ -130,18 +131,19 @@ public class CProjectNature implements IProjectNature {
/**
* Sets the arguments for the incremental build.
* @deprecated
*/
public void setIncrBuildArguments(String arguments, IProgressMonitor monitor) throws CoreException {
String oldArguments= fBuildInfo.getIncrementalBuildArguments();
if (!arguments.equals(oldArguments)) {
fBuildInfo.setIncrementalBuildArguments(arguments);
}
}
/**
* Gets the arguments for the incremental build
* @deprecated
*/
public String getIncrBuildArguments() throws CoreException {
if( fBuildInfo == null) {
fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
}
String buildArguments= fBuildInfo.getIncrementalBuildArguments();
if (buildArguments == null) {
buildArguments= "";
@ -151,32 +153,41 @@ public class CProjectNature implements IProjectNature {
/**
* Sets Stop on Error
* @deprecated
*/
public void setStopOnError(boolean on) throws CoreException {
boolean oldArgument= fBuildInfo.isStopOnError();
if (on != oldArgument) {
fBuildInfo.setStopOnError(on);
}
}
/**
* @deprecated
*/
public void setBuildCommandOverride(boolean on) throws CoreException {
boolean oldArgument= fBuildInfo.isDefaultBuildCmd();
if (on != oldArgument) {
fBuildInfo.setUseDefaultBuildCmd(on);
}
}
/**
* Gets Stop on Error
* @deprecated
*/
public boolean isStopOnError() throws CoreException {
if( fBuildInfo == null) {
fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
}
return fBuildInfo.isStopOnError();
}
/**
* @deprecated
*/
public boolean isDefaultBuildCmd() throws CoreException {
if( fBuildInfo == null) {
fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
}
return fBuildInfo.isDefaultBuildCmd();
}
/**
* @deprecated
*/
public static boolean hasCBuildSpec(IProject project) {
boolean found= false;
try {
@ -193,20 +204,28 @@ public class CProjectNature implements IProjectNature {
return found;
}
/**
* @deprecated
*/
public void addCBuildSpec(IProgressMonitor mon) throws CoreException {
addToBuildSpec(getBuilderID(), mon);
}
/**
* @deprecated
*/
public static void addCBuildSpec(IProject project, IProgressMonitor mon) throws CoreException {
addToBuildSpec(project, getBuilderID(), mon);
}
/**
* @deprecated
*/
public void addToBuildSpec(String builderID, IProgressMonitor mon) throws CoreException {
addToBuildSpec(getProject(), builderID, mon);
}
/**
* Adds a builder to the build spec for the given project.
* @deprecated
*/
public static void addToBuildSpec(IProject project, String builderID, IProgressMonitor mon) throws CoreException {
IProjectDescription description= project.getDescription();
@ -230,12 +249,15 @@ public class CProjectNature implements IProjectNature {
}
}
/**
* @deprecated
*/
public void removeCBuildSpec(IProgressMonitor mon) throws CoreException {
removeFromBuildSpec(getBuilderID(), mon);
}
/**
* Removes the given builder from the build spec for the given project.
* @deprecated
*/
public void removeFromBuildSpec(String builderID, IProgressMonitor mon) throws CoreException {
IProjectDescription description= getProject().getDescription();
@ -254,6 +276,7 @@ public class CProjectNature implements IProjectNature {
/**
* Get the correct builderID
* @deprecated
*/
public static String getBuilderID() {
Plugin plugin = (Plugin)CCorePlugin.getDefault();
@ -268,21 +291,12 @@ public class CProjectNature implements IProjectNature {
* @see IProjectNature#configure
*/
public void configure() throws CoreException {
addToBuildSpec(getBuilderID(), null);
IStandardBuildInfo info = BuildInfoFactory.create();
fBuildInfo.setBuildLocation(info.getBuildLocation());
fBuildInfo.setFullBuildArguments("");
fBuildInfo.setIncrementalBuildArguments("");
}
/**
* @see IProjectNature#deconfigure
*/
public void deconfigure() throws CoreException {
removeFromBuildSpec(getBuilderID(), null);
fBuildInfo.setBuildLocation(null);
fBuildInfo.setFullBuildArguments(null);
fBuildInfo.setIncrementalBuildArguments(null);
}
/**
@ -296,11 +310,7 @@ public class CProjectNature implements IProjectNature {
* @see IProjectNature#setProject
*/
public void setProject(IProject project) {
try {
fProject= project;
fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
} catch (CoreException e) {
}
fProject= project;
}
}

View file

@ -13,6 +13,10 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
/**
* @deprecated
*
*/
public class MakeUtil {
final static String MAKE_GOALS = "goals";