[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] HEADS UP: cdt.core patch to deprecate old builder ties in nature and CorePlugin
|
Index: src/org/eclipse/cdt/core/CCorePlugin.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java,v
retrieving revision 1.31
diff -u -r1.31 CCorePlugin.java
--- src/org/eclipse/cdt/core/CCorePlugin.java 12 Sep 2003 18:50:45 -0000 1.31
+++ src/org/eclipse/cdt/core/CCorePlugin.java 16 Sep 2003 21:59:41 -0000
@@ -554,9 +554,9 @@
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 @@
}
// 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;
}
@@ -596,19 +596,7 @@
}
/**
- * 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 @@
* @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 @@
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 @@
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);
- }
+ // 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;
+ // }
- /**
- * Instanciate the class from the extension point "ProcessList"
- * responsable of returning a list of process for this platform.
- * @return
- */
public IProcessList getProcessList() {
IExtensionPoint extension = getDescriptor().getExtensionPoint("ProcessList");
if (extension != null) {
Index: src/org/eclipse/cdt/core/CProjectNature.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java,v
retrieving revision 1.7
diff -u -r1.7 CProjectNature.java
--- src/org/eclipse/cdt/core/CProjectNature.java 16 Jul 2003 15:02:00 -0000 1.7
+++ src/org/eclipse/cdt/core/CProjectNature.java 16 Sep 2003 21:59:42 -0000
@@ -90,37 +90,38 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
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 @@
}
}
+ /**
+ * @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 @@
/**
* Get the correct builderID
+ * @deprecated
*/
public static String getBuilderID() {
Plugin plugin = (Plugin)CCorePlugin.getDefault();
@@ -268,21 +291,12 @@
* @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 @@
* @see IProjectNature#setProject
*/
public void setProject(IProject project) {
- try {
- fProject= project;
- fBuildInfo = StandardBuildManager.getBuildInfo(fProject, true);
- } catch (CoreException e) {
- }
+ fProject= project;
}
}
Index: src/org/eclipse/cdt/core/resources/MakeUtil.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/MakeUtil.java,v
retrieving revision 1.3
diff -u -r1.3 MakeUtil.java
--- src/org/eclipse/cdt/core/resources/MakeUtil.java 16 Jul 2003 14:29:40 -0000 1.3
+++ src/org/eclipse/cdt/core/resources/MakeUtil.java 16 Sep 2003 21:59:42 -0000
@@ -13,6 +13,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
+/**
+ * @deprecated
+ *
+ */
public class MakeUtil {
final static String MAKE_GOALS = "goals";