Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2004-01-13 16:25:35 -0500
committerDavid Inglis2004-01-13 16:25:35 -0500
commit74f6ab27e866f3eefb54f964953aae105c61c77b (patch)
tree1277ac7d92a4cf85814beadbed4871ed011b9f52 /core/org.eclipse.cdt.core
parent613c100d78aa914aa05278dc52ec469d3ecd1cf8 (diff)
downloadorg.eclipse.cdt-74f6ab27e866f3eefb54f964953aae105c61c77b.tar.gz
org.eclipse.cdt-74f6ab27e866f3eefb54f964953aae105c61c77b.tar.xz
org.eclipse.cdt-74f6ab27e866f3eefb54f964953aae105c61c77b.zip
- removal of deprecated 1.2 methods/classes
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/.classpath1
-rw-r--r--core/org.eclipse.cdt.core/build.properties21
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java261
-rw-r--r--core/org.eclipse.cdt.core/plugin.properties5
-rw-r--r--core/org.eclipse.cdt.core/plugin.xml64
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/BuildInfoFactory.java293
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java2
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java299
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IStandardBuildInfo.java38
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/MakeUtil.java181
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CBuilder.java286
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeBuilder.java52
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeProject.java27
13 files changed, 63 insertions, 1467 deletions
diff --git a/core/org.eclipse.cdt.core/.classpath b/core/org.eclipse.cdt.core/.classpath
index dd175003f6..5234ce9036 100644
--- a/core/org.eclipse.cdt.core/.classpath
+++ b/core/org.eclipse.cdt.core/.classpath
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="build"/>
<classpathentry kind="src" path="index"/>
<classpathentry kind="src" path="model"/>
<classpathentry kind="src" path="src"/>
diff --git a/core/org.eclipse.cdt.core/build.properties b/core/org.eclipse.cdt.core/build.properties
index cdada4ac27..6801ee61f2 100644
--- a/core/org.eclipse.cdt.core/build.properties
+++ b/core/org.eclipse.cdt.core/build.properties
@@ -2,11 +2,25 @@ bin.includes = plugin.xml,\
plugin.properties,\
about.html,\
cdtparser.jar,\
- cdtcore.jar
+ cdtcore.jar,\
+ .options
jars.compile.order = cdtparser.jar,\
cdtcore.jar
src.includes = about.html,\
- schema/
+ schema/,\
+ ChangeLog,\
+ build.properties,\
+ utils/,\
+ src/,\
+ search/,\
+ plugin.xml,\
+ plugin.properties,\
+ parser/,\
+ model/,\
+ index/,\
+ doc/,\
+ dependency/,\
+ .options
javadoc.packages = org.eclipse.cdt.core.*,\
org.eclipse.cdt.core.index.*,\
org.eclipse.cdt.core.model.*,\
@@ -14,8 +28,7 @@ javadoc.packages = org.eclipse.cdt.core.*,\
org.eclipse.cdt.utils.*,\
org.eclipse.cdt.utils.elf.*,\
org.eclipse.cdt.utils.spawner.*
-source.cdtcore.jar = build/,\
- index/,\
+source.cdtcore.jar = index/,\
model/,\
src/,\
utils/,\
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java
deleted file mode 100644
index dbe6f33638..0000000000
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java
+++ /dev/null
@@ -1,261 +0,0 @@
-package org.eclipse.cdt.core.build.standard;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import org.eclipse.cdt.core.AbstractCExtension;
-import org.eclipse.cdt.core.BuildInfoFactory;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ICDescriptor;
-import org.eclipse.cdt.core.parser.IScannerInfo;
-import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
-import org.eclipse.cdt.core.parser.IScannerInfoProvider;
-import org.eclipse.cdt.core.resources.IStandardBuildInfo;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**********************************************************************
- * Copyright (c) 2002,2003 Rational Software Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- *
- * Contributors:
- * IBM Rational Software - Initial API and implementation
-***********************************************************************/
-
-public class StandardBuildManager extends AbstractCExtension implements IScannerInfoProvider {
- // Name we will use to store build property with the project
- private static final QualifiedName buildInfoProperty
- = new QualifiedName(CCorePlugin.PLUGIN_ID, "standardBuildInfo");
- private static final String ID = CCorePlugin.PLUGIN_ID + ".standardBuildInfo";
- // This is the id of the IScannerInfoProvider extension point entry
- public static final String INTERFACE_IDENTITY = CCorePlugin.PLUGIN_ID + "." + "StandardBuildManager";
-
- // Listeners interested in build model changes
- private static Map buildModelListeners;
-
- /**
- * @param project
- * @return
- */
- private static IStandardBuildInfo findBuildInfo(IResource resource, boolean create) throws CoreException {
- IStandardBuildInfo buildInfo = null;
- // See if there's already one associated with the resource for this session
- try {
- buildInfo = (IStandardBuildInfo)resource.getSessionProperty(buildInfoProperty);
- } catch (CoreException e) {
- }
-
- // Try to load one for the project
- if (buildInfo == null && resource instanceof IProject) {
- buildInfo = loadBuildInfo((IProject)resource);
- }
-
- // There is nothing persisted for the session, or saved in a file so
- // create a build info object
- if (buildInfo == null && create) {
- buildInfo = BuildInfoFactory.create((IProject)resource);
- try {
- ((IProject)resource).setSessionProperty(buildInfoProperty, buildInfo);
- } catch (CoreException e) {
- buildInfo = null;
- }
- }
- return buildInfo;
- }
-
- public static IStandardBuildInfo getBuildInfo(IProject project) throws CoreException {
- return findBuildInfo(project, false);
- }
-
- public static IStandardBuildInfo getBuildInfo(IProject project, boolean create) throws CoreException {
- return findBuildInfo(project, create);
- }
-
- /*
- * @return
- */
- private static synchronized Map getBuildModelListeners() {
- if (buildModelListeners == null) {
- buildModelListeners = new HashMap();
- }
- return buildModelListeners;
- }
-
- public static void setPreprocessorSymbols(IProject project, String[] symbols)
- throws CoreException
- {
- // Get the information for the project
- IStandardBuildInfo info = getBuildInfo(project);
- // Set the new information
- if (info != null) {
- String[] oldSymbols = info.getPreprocessorSymbols();
- if (!Arrays.equals(oldSymbols, symbols)) {
- info.setPreprocessorSymbols(symbols);
- // Alert the listeners
- setScannerInfoDirty(project, info);
- }
- }
- }
-
- public static void setIncludePaths(IProject project, String[] paths)
- throws CoreException
- {
- // Get the build info for the project
- IStandardBuildInfo info = getBuildInfo(project);
- if (info != null) {
- String[] oldPaths = info.getIncludePaths();
- if (!Arrays.equals(oldPaths, paths)) {
- info.setIncludePaths(paths);
- setScannerInfoDirty(project, info);
- }
- }
- }
-
- /**
- * @param project
- * @param info
- */
- private static void setScannerInfoDirty(IProject project, IStandardBuildInfo info) {
- // Call in the cavalry
- List listeners = (List) getBuildModelListeners().get(project);
- if (listeners == null) {
- return;
- }
- ListIterator iter = listeners.listIterator();
- while (iter.hasNext()) {
- ((IScannerInfoChangeListener)iter.next()).changeNotification(project, (IScannerInfo) info);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource)
- */
- public IScannerInfo getScannerInformation(IResource resource) {
- IStandardBuildInfo info;
- try {
- info = getBuildInfo((IProject)resource);
- } catch (CoreException e) {
- return null;
- }
- return (IScannerInfo)info;
- }
-
- /*
- * Loads the build file and parses the nodes for build information. The
- * information is then associated with the resource for the duration of
- * the session.
- */
- private static IStandardBuildInfo loadBuildInfo(IProject project) throws CoreException {
- ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project);
- IStandardBuildInfo buildInfo = BuildInfoFactory.create(project, descriptor.getProjectData(ID));
- project.setSessionProperty(buildInfoProperty, buildInfo);
- return buildInfo;
- }
-
- /**
- * The build model manager for standard builds only caches the build
- * information for a resource on a per-session basis. This method
- * allows clients of the build model manager to programmatically
- * remove the association between the resource and the information
- * while the reource is still open or in the workspace. The Eclipse core
- * will take care of removing it if a resource is closed or deleted.
- *
- * @param resource
- */
- public static void removeBuildInfo(IResource resource) {
- try {
- resource.setSessionProperty(buildInfoProperty, null);
- } catch (CoreException e) {
- }
- }
-
- /**
- * Persists build-specific information in the build file. Build
- * information for standard make projects consists of preprocessor
- * symbols and includes paths. Other project-related information is
- * stored in the persistent properties of the project.
- *
- * @param project
- */
- public static void saveBuildInfo(IProject project) throws CoreException {
- ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project);
-
- Element rootElement = descriptor.getProjectData(ID);
-
- // Clear out all current children
- // Note: Probably would be a better idea to merge in the data
- Node child = rootElement.getFirstChild();
- while (child != null) {
- rootElement.removeChild(child);
- child = rootElement.getFirstChild();
- }
-
- // Save the build info
- IStandardBuildInfo buildInfo = getBuildInfo(project);
- if (buildInfo != null)
- buildInfo.serialize(rootElement.getOwnerDocument(), rootElement);
- descriptor.saveProjectData();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#subscribe(org.eclipse.core.resources.IResource, org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
- */
- public synchronized void subscribe(IResource resource, IScannerInfoChangeListener listener) {
- IResource project = null;
- if (resource instanceof IProject) {
- project = resource;
- } else if (resource instanceof IFile) {
- project = ((IFile)resource).getProject();
- } else {
- return;
- }
- // Get listeners for this resource
- Map map = getBuildModelListeners();
- List list = (List) map.get(project);
- if (list == null) {
- // Create a new list
- list = new ArrayList();
- }
- if (!list.contains(listener)) {
- // Add the new listener for the resource
- list.add(listener);
- map.put(project, list);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#unsubscribe(org.eclipse.core.resources.IResource, org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
- */
- public synchronized void unsubscribe(IResource resource, IScannerInfoChangeListener listener) {
- IResource project = null;
- if (resource instanceof IProject) {
- project = resource;
- } else if (resource instanceof IFile) {
- project = ((IFile)resource).getProject();
- } else {
- return;
- }
- // Remove the listener
- Map map = getBuildModelListeners();
- List list = (List) map.get(project);
- if (list != null && !list.isEmpty()) {
- // The list is not empty so try to remove listener
- list.remove(listener);
- map.put(project, list);
- }
- }
-
-}
diff --git a/core/org.eclipse.cdt.core/plugin.properties b/core/org.eclipse.cdt.core/plugin.properties
index 8f28b993ab..5a55fb0d6e 100644
--- a/core/org.eclipse.cdt.core/plugin.properties
+++ b/core/org.eclipse.cdt.core/plugin.properties
@@ -8,12 +8,7 @@ CProblemMarker.name=C Problem
CBuildCommand.name=C Builder Command
CBuildConsole.name=C Builder Console
CProject.name=C Project
-CBuilder.name=C Build Model
ProcessList.name=Process List
ErrorParser.name=Error Parser
-makeproject.name=Make Project
-genericmake.name=Generic Make
-makebuildmodel.name=Make Builder
-
CTaskName=C/C++ Task
diff --git a/core/org.eclipse.cdt.core/plugin.xml b/core/org.eclipse.cdt.core/plugin.xml
index 16642e7ddd..42655d2a60 100644
--- a/core/org.eclipse.cdt.core/plugin.xml
+++ b/core/org.eclipse.cdt.core/plugin.xml
@@ -25,14 +25,6 @@
<extension-point id="CProject" name="%CProject.name"/>
<!-- =================================================================================== -->
-<!-- Extension Point:(Deprecated, to be removed) -->
-<!-- =================================================================================== -->
- <extension-point id="CBuildModel" name="%CBuilder.name"/>
-<!-- =================================================================================== -->
-<!-- Extension Point:(Deprecated, to be removed) Default command for the MakeBuilder -->
-<!-- =================================================================================== -->
- <extension-point id="CBuildCommand" name="%CBuildCommand.name"/>
-<!-- =================================================================================== -->
<!-- Extension Point:(work in progress) IConsole, customize a C Build console output -->
<!-- =================================================================================== -->
<extension-point id="CBuildConsole" name="%CBuildConsole.name"/>
@@ -137,19 +129,6 @@
</errorparser>
</extension>
<!-- =================================================================================== -->
-<!-- Eclipse Builder provided by the CDT, to be removed to the MakePlugin -->
-<!-- =================================================================================== -->
- <extension
- id="cbuilder"
- name="C Builder"
- point="org.eclipse.core.resources.builders">
- <builder>
- <run
- class="org.eclipse.cdt.internal.core.CBuilder">
- </run>
- </builder>
- </extension>
-<!-- =================================================================================== -->
<!-- CDT customized problem markers: C Problem markers -->
<!-- =================================================================================== -->
<extension
@@ -190,37 +169,6 @@
</runtime>
</extension>
<!-- =================================================================================== -->
-<!-- Deprecated Make default command, will be removed. -->
-<!-- =================================================================================== -->
- <extension
- point="org.eclipse.cdt.core.CBuildCommand">
- <buildcommand
- command="make">
- </buildcommand>
- </extension>
-<!-- =================================================================================== -->
-<!-- Deprecated Make owner, will be removed. -->
-<!-- =================================================================================== -->
- <extension
- id="make"
- name="%makeproject.name"
- point="org.eclipse.cdt.core.CProject">
- <cproject
- class="org.eclipse.cdt.internal.core.make.MakeProject">
- </cproject>
- </extension>
-<!-- =================================================================================== -->
-<!-- Deprecated Make builder, will be removed. -->
-<!-- =================================================================================== -->
- <extension
- id="makeBuilder"
- name="%makebuildmodel.name"
- point="org.eclipse.cdt.core.CBuildModel">
- <run
- class="org.eclipse.cdt.internal.core.make.MakeBuilder">
- </run>
- </extension>
-<!-- =================================================================================== -->
<!-- Some well known C file extensions override for the team plugins -->
<!-- =================================================================================== -->
<extension
@@ -309,18 +257,6 @@
</ignore>
</extension>
<!-- =================================================================================== -->
-<!-- Extension Point(Note:Temporary): IScannerInfoProvider for the standard Builder -->
-<!-- =================================================================================== -->
- <extension
- id="StandardBuildManager"
- point="org.eclipse.cdt.core.ScannerInfoProvider">
- <cextension>
- <run
- class="org.eclipse.cdt.core.build.standard.StandardBuildManager">
- </run>
- </cextension>
- </extension>
-<!-- =================================================================================== -->
<!-- =================================================================================== -->
<extension
id="task"
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/BuildInfoFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/BuildInfoFactory.java
deleted file mode 100644
index 76310bd998..0000000000
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/BuildInfoFactory.java
+++ /dev/null
@@ -1,293 +0,0 @@
-package org.eclipse.cdt.core;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import org.eclipse.cdt.core.parser.IScannerInfo;
-import org.eclipse.cdt.core.resources.IStandardBuildInfo;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.QualifiedName;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class BuildInfoFactory {
- public static final String LOCATION = "buildLocation";
- public static final String FULL_ARGUMENTS = "buildFullArguments";
- public static final String INCREMENTAL_ARGUMENTS = "buildIncrementalArguments";
- public static final String STOP_ON_ERROR = "stopOnError";
-// public static final String CLEAR_CONSOLE = "clearConsole";
- public static final String DEFAULT_BUILD_CMD = "useDefaultBuildCmd";
- public static final String PROJECT_NAME = "projectName";
- public static final String INCLUDE_PATH = "includePath";
- public static final String PATH = "path";
- public static final String DEFINED_SYMBOL = "definedSymbol";
- public static final String SYMBOL = "symbol";
-
- public static abstract class Store implements IStandardBuildInfo, IScannerInfo {
- // List of include paths
- protected List pathList;
- protected List symbolList;
-
- public String getBuildLocation() {
- if ( isDefaultBuildCmd() ) {
- Plugin plugin = CCorePlugin.getDefault();
- if (plugin != null) {
- IExtensionPoint extension = plugin.getDescriptor().getExtensionPoint("CBuildCommand");
- if (extension != null) {
- IExtension[] extensions = extension.getExtensions();
- for(int i = 0; i < extensions.length; i++){
- IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
- for(int j = 0; j < configElements.length; j++){
- String command = configElements[j].getAttribute("command"); //$NON-NLS-1$
- if (command != null)
- return command;
- }
- }
- }
- }
- return "make";
- }
- return getString(LOCATION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
- */
- public Map getDefinedSymbols() {
- // Return the defined symbols for the default configuration
- HashMap symbols = new HashMap();
- String[] symbolList = getPreprocessorSymbols();
- for (int i = 0; i < symbolList.length; ++i) {
- String symbol = symbolList[i];
- if (symbol.length() == 0) {
- continue;
- }
- String key = new String();
- String value = new String();
- int index = symbol.indexOf("=");
- if (index != -1) {
- key = symbol.substring(0, index).trim();
- value = symbol.substring(index + 1).trim();
- } else {
- key = symbol.trim();
- }
- symbols.put(key, value);
- }
- return symbols;
- }
-
- public String getFullBuildArguments() {
- return getString(FULL_ARGUMENTS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
- */
- public String[] getIncludePaths() {
- return (String[]) getPathList().toArray(new String[getPathList().size()]);
- }
-
- public String getIncrementalBuildArguments() {
- return getString(INCREMENTAL_ARGUMENTS);
- }
-
- public boolean isStopOnError() {
- return getBoolean(STOP_ON_ERROR);
- }
-
- public void setBuildLocation(String location) {
- putValue(LOCATION, location);
- }
-
- public void setPreprocessorSymbols(String[] symbols) {
- // Clear out any existing symbols and add the new stuff
- getSymbolList().clear();
- getSymbolList().addAll(Arrays.asList(symbols));
- }
-
- public void setFullBuildArguments(String arguments) {
- putValue(FULL_ARGUMENTS, arguments);
- }
-
- public void setIncludePaths(String[] paths) {
- // Clear the existing list and add the paths
- getPathList().clear();
- getPathList().addAll(Arrays.asList(paths));
- }
-
- public void setIncrementalBuildArguments(String arguments) {
- putValue(INCREMENTAL_ARGUMENTS, arguments);
- }
-
- public void setStopOnError(boolean on) {
- putValue(STOP_ON_ERROR, new Boolean(on).toString());
- }
-
- public boolean isDefaultBuildCmd() {
- if ( getString(DEFAULT_BUILD_CMD) == null ) { // if no property then default to true
- return true;
- }
- return getBoolean(DEFAULT_BUILD_CMD);
- }
-
- public void setUseDefaultBuildCmd(boolean on) {
- putValue(DEFAULT_BUILD_CMD, new Boolean(on).toString());
- }
-
-// public boolean isClearBuildConsole() {
-// return getBoolean(CLEAR_CONSOLE);
-// }
-
- public boolean getBoolean(String property) {
- return Boolean.valueOf(getString(property)).booleanValue();
- }
-
- public void putValue(String name, String value) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.resources.IBuildInfo#serialize(org.w3c.dom.Document, org.w3c.dom.Element)
- */
- public void serialize(Document doc, Element rootElement) {
- // Serialize the include paths
- ListIterator iter = getPathList().listIterator();
- while (iter.hasNext()){
- Element pathElement = doc.createElement(INCLUDE_PATH);
- pathElement.setAttribute(PATH, (String)iter.next());
- rootElement.appendChild(pathElement);
- }
- // Now do the same for the symbols
- iter = getSymbolList().listIterator();
- while (iter.hasNext()) {
- Element symbolElement = doc.createElement(DEFINED_SYMBOL);
- symbolElement.setAttribute(SYMBOL, (String)iter.next());
- rootElement.appendChild(symbolElement);
- }
- }
-
- protected List getPathList() {
- if (pathList == null) {
- pathList = new ArrayList();
- }
- return pathList;
- }
-
- public String getString(String property) {
- return null;
- }
-
- public String[] getPreprocessorSymbols() {
- return (String[]) getSymbolList().toArray(new String[getSymbolList().size()]);
- }
-
- protected List getSymbolList() {
- if (symbolList == null) {
- symbolList = new ArrayList();
- }
- return symbolList;
- }
-
- }
-
- public static class Preference extends Store {
- Preferences prefs;
-
- public Preference() {
- prefs = CCorePlugin.getDefault().getPluginPreferences();
- }
-
- public void putValue(String name, String value) {
- prefs.setValue(name, value);
- }
-
- public String getString(String property) {
- return prefs.getString(property);
- }
-
- public void setDefault(String name, String def) {
- prefs.setDefault(name, def);
- }
- }
-
- public static class Property extends Store {
- private IResource resource;
-
- public Property(IResource resource) {
- this.resource = resource;
- }
-
- public void putValue(String name, String value) {
- QualifiedName qName = new QualifiedName(CCorePlugin.PLUGIN_ID, name);
- try {
- resource.setPersistentProperty(qName, value);
- } catch (CoreException e) {
- }
- }
-
- public String getString(String property) {
- QualifiedName qName = new QualifiedName(CCorePlugin.PLUGIN_ID, property);
- try {
- return resource.getPersistentProperty(qName);
- } catch (CoreException e) {
- }
- return null;
- }
-
- public void setDefault(String name, String def) {
- }
-
-
-// public boolean isClearBuildConsole() {
-// return (new Preference()).isClearBuildConsole();
-// }
- }
-
- public static IStandardBuildInfo create() {
- return new BuildInfoFactory.Preference();
- }
-
- public static IStandardBuildInfo create(IProject project) {
- return new BuildInfoFactory.Property(project);
- }
-
- /**
- * @param project
- * @param element
- * @return
- */
- public static IStandardBuildInfo create(IProject project, Element element) {
- // Create a new info property object
- Property buildProperties = new Property(project);
- Node child = element.getFirstChild();
- while (child != null) {
- if (child.getNodeName().equals(INCLUDE_PATH)) {
- // Add the path to the property list
- buildProperties.getPathList().add(((Element)child).getAttribute(PATH));
- } else if (child.getNodeName().equals(DEFINED_SYMBOL)) {
- // Add the symbol to the symbol list
- buildProperties.getSymbolList().add(((Element)child).getAttribute(SYMBOL));
- }
- child = child.getNextSibling();
- }
- return (IStandardBuildInfo)buildProperties;
- }
-}
-
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java
index b8d73394a0..8f9cbe4fe5 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java
@@ -11,8 +11,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-
-
public class CCProjectNature extends CProjectNature {
public static final String CC_NATURE_ID= CCorePlugin.PLUGIN_ID + ".ccnature";
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java
index 6b82e33161..8d30811b92 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java
@@ -1,44 +1,31 @@
package org.eclipse.cdt.core;
/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
+ * (c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
*/
-
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.cdt.core.build.standard.StandardBuildManager;
-import org.eclipse.cdt.core.resources.IStandardBuildInfo;
-import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Plugin;
-
-
public class CProjectNature implements IProjectNature {
- public static final String BUILDER_NAME= "cbuilder";
- public static final String BUILDER_ID= CCorePlugin.PLUGIN_ID + "." + BUILDER_NAME;
- public static final String C_NATURE_ID= CCorePlugin.PLUGIN_ID + ".cnature";
+ public static final String C_NATURE_ID = CCorePlugin.PLUGIN_ID + ".cnature";
- private IProject fProject;
- private IStandardBuildInfo fBuildInfo;
+ private IProject fProject;
- public CProjectNature() {
- }
+ public CProjectNature() {
+ }
- public CProjectNature(IProject project) {
+ public CProjectNature(IProject project) {
setProject(project);
- }
+ }
public static void addCNature(IProject project, IProgressMonitor mon) throws CoreException {
addNature(project, C_NATURE_ID, mon);
@@ -47,26 +34,29 @@ public class CProjectNature implements IProjectNature {
public static void removeCNature(IProject project, IProgressMonitor mon) throws CoreException {
removeNature(project, C_NATURE_ID, mon);
}
-
+
/**
* Utility method for adding a nature to a project.
*
- * @param proj the project to add the nature
- * @param natureId the id of the nature to assign to the project
- * @param monitor a progress monitor to indicate the duration of the operation, or
- * <code>null</code> if progress reporting is not required.
- *
+ * @param proj
+ * the project to add the nature
+ * @param natureId
+ * the id of the nature to assign to the project
+ * @param monitor
+ * a progress monitor to indicate the duration of the operation,
+ * or <code>null</code> if progress reporting is not required.
+ *
*/
public static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
IProjectDescription description = project.getDescription();
- String[] prevNatures= description.getNatureIds();
- for (int i= 0; i < prevNatures.length; i++) {
+ String[] prevNatures = description.getNatureIds();
+ for (int i = 0; i < prevNatures.length; i++) {
if (natureId.equals(prevNatures[i]))
return;
}
- String[] newNatures= new String[prevNatures.length + 1];
+ String[] newNatures = new String[prevNatures.length + 1];
System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length]= natureId;
+ newNatures[prevNatures.length] = natureId;
description.setNatureIds(newNatures);
project.setDescription(description, monitor);
}
@@ -74,243 +64,46 @@ public class CProjectNature implements IProjectNature {
/**
* Utility method for removing a project nature from a project.
*
- * @param proj the project to remove the nature from
- * @param natureId the nature id to remove
- * @param monitor a progress monitor to indicate the duration of the operation, or
- * <code>null</code> if progress reporting is not required.
+ * @param proj
+ * the project to remove the nature from
+ * @param natureId
+ * the nature id to remove
+ * @param monitor
+ * a progress monitor to indicate the duration of the operation,
+ * or <code>null</code> if progress reporting is not required.
*/
public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
IProjectDescription description = project.getDescription();
- String[] prevNatures= description.getNatureIds();
+ String[] prevNatures = description.getNatureIds();
List newNatures = new ArrayList(Arrays.asList(prevNatures));
newNatures.remove(natureId);
- description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()]));
+ description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()]));
project.setDescription(description, monitor);
}
- /**
- * Sets the path of the build command executable.
- * @depercated
- */
- public void setBuildCommand(IPath locationPath, IProgressMonitor monitor) throws CoreException {
- }
-
- /**
- * 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 {
- }
-
- /**
- * 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= "";
- }
- return buildArguments;
- }
-
- /**
- * Sets the arguments for the incremental build.
- * @deprecated
- */
- public void setIncrBuildArguments(String arguments, IProgressMonitor monitor) throws CoreException {
- }
-
- /**
- * 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= "";
- }
- return buildArguments;
- }
-
- /**
- * Sets Stop on Error
- * @deprecated
- */
- public void setStopOnError(boolean on) throws CoreException {
- }
-
/**
- * @deprecated
- */
- public void setBuildCommandOverride(boolean on) throws CoreException {
- }
-
- /**
- * 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 {
- IProjectDescription description = project.getDescription();
- ICommand[] commands= description.getBuildSpec();
- for (int i= 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(BUILDER_ID)) {
- found= true;
- break;
- }
- }
- } catch (CoreException e) {
- }
- return found;
- }
-
- /**
- * @deprecated
- */
- public void addCBuildSpec(IProgressMonitor mon) throws CoreException {
- }
-
- /**
- * @deprecated
- */
- public static void addCBuildSpec(IProject project, IProgressMonitor mon) throws CoreException {
- }
-
- /**
- * @deprecated
- */
- public void addToBuildSpec(String builderID, IProgressMonitor mon) throws CoreException {
- addToBuildSpec(getProject(), builderID, mon);
+ * @see IProjectNature#configure
+ */
+ public void configure() throws CoreException {
}
- /**
- * 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();
- ICommand[] commands= description.getBuildSpec();
- boolean found= false;
- for (int i= 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(builderID)) {
- found= true;
- break;
- }
- }
- if (!found) {
- ICommand command= description.newCommand();
- command.setBuilderName(builderID);
- ICommand[] newCommands= new ICommand[commands.length + 1];
- // Add it before other builders. See 1FWJK7I: ITPJCORE:WIN2000
- System.arraycopy(commands, 0, newCommands, 1, commands.length);
- newCommands[0]= command;
- description.setBuildSpec(newCommands);
- project.setDescription(description, mon);
- }
+ /**
+ * @see IProjectNature#deconfigure
+ */
+ public void deconfigure() throws CoreException {
}
/**
- * @deprecated
- */
- public void removeCBuildSpec(IProgressMonitor mon) throws CoreException {
+ * @see IProjectNature#getProject
+ */
+ public IProject getProject() {
+ return fProject;
}
- /**
- * 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();
- ICommand[] commands= description.getBuildSpec();
- for (int i= 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(builderID)) {
- ICommand[] newCommands= new ICommand[commands.length - 1];
- System.arraycopy(commands, 0, newCommands, 0, i);
- System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
- description.setBuildSpec(newCommands);
- break;
- }
- }
- getProject().setDescription(description, mon);
+ /**
+ * @see IProjectNature#setProject
+ */
+ public void setProject(IProject project) {
+ fProject = project;
}
-
- /**
- * Get the correct builderID
- * @deprecated
- */
- public static String getBuilderID() {
- Plugin plugin = (Plugin)CCorePlugin.getDefault();
- IPluginDescriptor descriptor = plugin.getDescriptor();
- if (descriptor.getExtension(BUILDER_NAME) != null) {
- return descriptor.getUniqueIdentifier() + "." + BUILDER_NAME;
- }
- return BUILDER_ID;
- }
-
- /**
- * @see IProjectNature#configure
- */
- public void configure() throws CoreException {
- }
-
- /**
- * @see IProjectNature#deconfigure
- */
- public void deconfigure() throws CoreException {
- }
-
- /**
- * @see IProjectNature#getProject
- */
- public IProject getProject() {
- return fProject;
- }
-
- /**
- * @see IProjectNature#setProject
- */
- public void setProject(IProject project) {
- fProject= project;
- }
-
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IStandardBuildInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IStandardBuildInfo.java
deleted file mode 100644
index 80e3aa5309..0000000000
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IStandardBuildInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.cdt.core.resources;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-public interface IStandardBuildInfo {
- String getBuildLocation();
- public String[] getPreprocessorSymbols();
- String getFullBuildArguments();
- public String[] getIncludePaths();
- String getIncrementalBuildArguments();
- boolean isStopOnError();
-
- void setBuildLocation(String location);
- public void setPreprocessorSymbols(String[] symbols);
- void setFullBuildArguments(String arguments);
- public void setIncludePaths(String[] paths);
- void setIncrementalBuildArguments(String arguments);
- void setStopOnError(boolean on);
-
-// boolean isClearBuildConsole();
-
- boolean isDefaultBuildCmd();
- void setUseDefaultBuildCmd(boolean on);
-
- /**
- * @param doc
- * @param rootElement
- */
- void serialize(Document doc, Element rootElement);
-}
-
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/MakeUtil.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/MakeUtil.java
deleted file mode 100644
index 6a2766d560..0000000000
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/MakeUtil.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package org.eclipse.cdt.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-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";
- final static String MAKE_DIR = "buildir";
- final static String TARGET_ID = "org.eclipse.cdt.make";
-
- public static String[] decodeTargets(String property) {
- BufferedReader reader = new BufferedReader(new StringReader(property));
- ArrayList l = new ArrayList(5);
- try {
- String line = reader.readLine();
- while (line != null && !"".equals(line)) {
- l.add(line);
- line = reader.readLine();
- }
- } catch (IOException e) {
- // this should not happen, we're reading from a string.
- }
- String[] result = new String[l.size()];
- return (String[]) l.toArray(result);
- }
-
- public static String encodeTargets(String[] targets) {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < targets.length; i++) {
- if (targets[i] != null) {
- buf.append(targets[i]);
- buf.append("\n");
- }
- }
- return (buf.length() == 0) ? null : buf.toString();
- }
-
- public static QualifiedName getQualifiedNameTarget() {
- return new QualifiedName(TARGET_ID, MAKE_GOALS);
- }
-
- public static QualifiedName getQualifiedNameDir() {
- return new QualifiedName(TARGET_ID, MAKE_DIR);
- }
-
- public static String getSessionTarget(IResource resource) {
- try {
- String property = (String) resource.getSessionProperty(getQualifiedNameTarget());
- if (property != null)
- return property;
- } catch (CoreException e) {
- }
- return new String();
- }
-
- public static void setSessionTarget(IResource resource, String target) {
- try {
- resource.setSessionProperty(getQualifiedNameTarget(), target);
- } catch (CoreException e) {
- }
- }
-
- public static void removeSessionTarget(IResource resource) {
- setSessionTarget(resource, null);
- }
-
- public static String getSessionBuildDir(IResource resource) {
- try {
- String dir = (String) resource.getSessionProperty(getQualifiedNameDir());
- if (dir != null)
- return dir;
- } catch (CoreException e) {
- }
- return new String();
- }
-
- public static void setSessionBuildDir(IResource resource, String dir) {
- try {
- resource.setSessionProperty(getQualifiedNameDir(), dir);
- } catch (CoreException e) {
- }
- }
-
- public static void removeSessionBuildDir(IResource resource) {
- setSessionBuildDir(resource, null);
- }
-
- public static String[] getPersistentTargets(IResource resource) {
- try {
- String property = resource.getPersistentProperty(getQualifiedNameTarget());
- if (property != null)
- return decodeTargets(property);
- } catch (CoreException e) {
- }
- return new String[0];
- }
-
- public static void setPersistentTargets(IResource resource, String[] targets) {
- String property = null;
- if (targets != null)
- property = encodeTargets(targets);
- //System.out.println ("PROPERTY " + property);
- try {
- resource.setPersistentProperty(getQualifiedNameTarget(), property);
- } catch (CoreException e) {
- }
- }
-
- public static void addPersistentTarget(IResource resource, String target) {
- String[] targets = MakeUtil.getPersistentTargets(resource);
- for (int i = 0; i < targets.length; i++) {
- if (targets[i].equals(target)) {
- return;
- }
- }
- String[] newTargets = new String[targets.length + 1];
- System.arraycopy(targets, 0, newTargets, 0, targets.length);
- newTargets[targets.length] = target;
- MakeUtil.setPersistentTargets(resource, newTargets);
- }
-
- public static void removePersistentTarget(IResource resource, String target) {
- String[] targets = MakeUtil.getPersistentTargets(resource);
- String[] newTargets = new String[targets.length];
- for (int i = 0; i < targets.length; i++) {
- if (!targets[i].equals(target)) {
- newTargets[i] = targets[i];
- }
- }
- MakeUtil.setPersistentTargets(resource, newTargets);
- }
-
- /**
- * Replace a tag on a resource. Functionally equivalent to
- * removePersistantTag(resource, oldtarget)
- * addPersistantTag(resource, newtarget)
- * If the oldtarget doesn't exist, the newtarget is added.
- * If the newtarget is null, the oldtarget is removed.
- * @param resource The resource the tag applies to
- * @param oldtarget The oldtarget tag
- * @param newtarget The newtarget tag to replace the old target tag or null. If
- * newtarget is null then this call is the same as removePersistantTarget(resource, oldtarget)
- */
- public static void replacePersistentTarget(IResource resource, String oldtarget, String newtarget) {
- if (newtarget == null) {
- removePersistentTarget(resource, oldtarget);
- return;
- }
-
- String[] targets = getPersistentTargets(resource);
- for (int i = 0; i < targets.length; i++) {
- if (targets[i].equals(oldtarget)) {
- targets[i] = newtarget;
- setPersistentTargets(resource, targets);
- return;
- }
- }
-
- //The target wasn't found, create a new one
- addPersistentTarget(resource, newtarget);
- }
-
- private MakeUtil() {
- }
-
-}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CBuilder.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CBuilder.java
deleted file mode 100644
index 516030dfbd..0000000000
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CBuilder.java
+++ /dev/null
@@ -1,286 +0,0 @@
-package org.eclipse.cdt.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CProjectNature;
-import org.eclipse.cdt.core.CommandLauncher;
-import org.eclipse.cdt.core.ConsoleOutputStream;
-import org.eclipse.cdt.core.ErrorParserManager;
-import org.eclipse.cdt.core.model.ICModelMarker;
-import org.eclipse.cdt.core.resources.ACBuilder;
-import org.eclipse.cdt.core.resources.IConsole;
-import org.eclipse.cdt.core.resources.MakeUtil;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-public class CBuilder extends ACBuilder {
-
- private static final String BUILD_ERROR = "CBuilder.build_error";
-
- public CBuilder() {
- }
-
- public IPath getWorkingDirectory() {
- IProject currProject = getProject();
- IPath workingDirectory = new Path(MakeUtil.getSessionBuildDir((IResource) currProject));
- if (workingDirectory.isEmpty())
- workingDirectory = currProject.getLocation();
- return workingDirectory;
- }
-
- public class MyResourceDeltaVisitor implements IResourceDeltaVisitor {
- boolean bContinue;
-
- public boolean visit(IResourceDelta delta) throws CoreException {
- IResource resource = delta.getResource();
- if (resource != null && resource.getProject() == getProject()) {
- bContinue = true;
- return false;
- }
- return true;
- }
- public boolean shouldBuild() {
- return bContinue;
- }
- }
- /**
- * @see IncrementalProjectBuilder#build
- */
- protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
- boolean bPerformBuild = true;
- if (kind == IncrementalProjectBuilder.AUTO_BUILD) {
- MyResourceDeltaVisitor vis = new MyResourceDeltaVisitor();
- IResourceDelta delta = getDelta(getProject());
- if (delta != null ) {
- delta.accept(vis);
- bPerformBuild = vis.shouldBuild();
- } else
- bPerformBuild = false;
- }
- if ( bPerformBuild ) {
- boolean isClean = invokeMake((kind == IncrementalProjectBuilder.FULL_BUILD), monitor);
- if (isClean) {
- forgetLastBuiltState();
- }
- }
- checkCancel(monitor);
- return getProject().getReferencedProjects();
- }
-
- private boolean invokeMake(boolean fullBuild, IProgressMonitor monitor) {
- boolean isClean = false;
- IProject currProject = getProject();
- SubProgressMonitor subMonitor = null;
-
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- monitor.beginTask("Invoking the C Builder: " + currProject.getName(), IProgressMonitor.UNKNOWN);
-
- try {
- CProjectNature nature = (CProjectNature) currProject.getNature(CProjectNature.C_NATURE_ID);
- IPath makepath = nature.getBuildCommand();
- if (!makepath.isEmpty()) {
- IConsole console = CCorePlugin.getDefault().getConsole();
- console.start(currProject);
-
- ConsoleOutputStream cos = console.getOutputStream();
-
- // remove all markers for this project
- removeAllMarkers(currProject);
-
- IPath workingDirectory = getWorkingDirectory();
- String[] userArgs = parseArguments(fullBuild, nature.getIncrBuildArguments());
- if (userArgs.length != 0 && userArgs[userArgs.length - 1].equals("clean"))
- isClean = true;
- // Before launching give visual cues via the monitor
- subMonitor = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
- subMonitor.subTask("Invoking Command: " + makepath.toString());
-
- String errMsg = null;
- CommandLauncher launcher = new CommandLauncher();
- // Print the command for visual interaction.
- launcher.showCommand(true);
-
- // Set the environmennt, some scripts may need the CWD var to be set.
- Properties props = launcher.getEnvironment();
- props.put("CWD", workingDirectory.toOSString());
- props.put("PWD", workingDirectory.toOSString());
- String[] env = null;
- ArrayList envList = new ArrayList();
- Enumeration names = props.propertyNames();
- if (names != null) {
- while (names.hasMoreElements()) {
- String key = (String) names.nextElement();
- envList.add(key + "=" + props.getProperty(key));
- }
- env = (String[]) envList.toArray(new String[envList.size()]);
- }
- ErrorParserManager epm = new ErrorParserManager(this);
- epm.setOutputStream(cos);
- OutputStream stdout = epm.getOutputStream();
- OutputStream stderr = epm.getOutputStream();
-
- Process p = launcher.execute(makepath, userArgs, env, workingDirectory);
- if (p != null) {
- try {
- // Close the input of the Process explicitely.
- // We will never write to it.
- p.getOutputStream().close();
- } catch (IOException e) {
- }
- if (launcher.waitAndRead(stdout, stderr, subMonitor) != CommandLauncher.OK)
- errMsg = launcher.getErrorMessage();
-
- subMonitor.setTaskName("Refresh From Local");
-
- try {
- // do not allow the cancel of the refresh, since the builder is external
- // to Eclipse files may have been created/modified and we will be out-of-sync
- // The caveat is for hugue projects, it may take sometimes at every build.
- currProject.refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (CoreException e) {
- }
-
- subMonitor = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
- subMonitor.subTask("Parsing");
- } else {
- errMsg = launcher.getErrorMessage();
- }
-
- if (errMsg != null) {
- String errorDesc = CCorePlugin.getFormattedString(BUILD_ERROR, makepath.toString());
- StringBuffer buf = new StringBuffer(errorDesc);
- buf.append(System.getProperty("line.separator", "\n"));
- buf.append("(").append(errMsg).append(")");
- cos.write(buf.toString().getBytes());
- cos.flush();
- }
-
- stdout.close();
- stderr.close();
-
- epm.reportProblems();
-
- subMonitor.done();
- }
- } catch (Exception e) {
- CCorePlugin.log(e);
- }
- monitor.done();
- return (isClean);
- }
-
- /**
- * Check whether the build has been canceled.
- */
- public void checkCancel(IProgressMonitor monitor) {
- if (monitor != null && monitor.isCanceled())
- throw new OperationCanceledException();
- }
-
- private String[] parseArguments(boolean fullBuild, String override_args) {
- ArrayList list = new ArrayList();
- IProject currProject = getProject();
- try {
- CProjectNature nature = (CProjectNature) currProject.getNature(CProjectNature.C_NATURE_ID);
- if (nature.isDefaultBuildCmd()) {
- if (!nature.isStopOnError()) {
- list.add("-k");
- }
- }
- else {
- String[] ovrd_args = makeArray(nature.getFullBuildArguments());
- list.addAll(Arrays.asList(ovrd_args));
- }
- }
- catch (CoreException e) {
- }
-
- String sessionTarget = MakeUtil.getSessionTarget((IResource) currProject);
- String[] targets = makeArray(sessionTarget);
- for (int i = 0; i < targets.length; i++) {
- list.add(targets[i]);
- }
-
- // Lets try this: if FULL_BUILD; we run "clean all"
- if (fullBuild && targets.length == 0) {
- list.add("clean");
- list.add("all");
- }
-
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- // Turn the string into an array.
- String[] makeArray(String string) {
- string.trim();
- char[] array = string.toCharArray();
- ArrayList aList = new ArrayList();
- StringBuffer buffer = new StringBuffer();
- boolean inComment = false;
- for (int i = 0; i < array.length; i++) {
- char c = array[i];
- if (array[i] == '"' || array[i] == '\'') {
- if (i > 0 && array[i - 1] == '\\') {
- inComment = false;
- }
- else {
- inComment = !inComment;
- }
- }
- if (c == ' ' && !inComment) {
- aList.add(buffer.toString());
- buffer = new StringBuffer();
- }
- else {
- buffer.append(c);
- }
- }
- if (buffer.length() > 0)
- aList.add(buffer.toString());
- return (String[]) aList.toArray(new String[aList.size()]);
- }
-
- //private void clearConsole(final IDocument doc) {
- // Display.getDefault().syncExec(new Runnable() {
- // public void run() {
- // doc.set("");
- // }
- // });
- //}
-
- private void removeAllMarkers(IProject currProject) throws CoreException {
- IWorkspace workspace = currProject.getWorkspace();
-
- // remove all markers
- IMarker[] markers = currProject.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
- if (markers != null) {
- workspace.deleteMarkers(markers);
- }
- }
-}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeBuilder.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeBuilder.java
deleted file mode 100644
index 6eda8ba346..0000000000
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeBuilder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * (c) Copyright QNX Software System Ltd. 2002.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.internal.core.make;
-
-import org.eclipse.cdt.core.AbstractCExtension;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.core.runtime.IPath;
-
-public class MakeBuilder extends AbstractCExtension /*implements ICBuilder */ {
-
- public IPath[] getIncludePaths() {
- return new IPath[0];
- }
-
- public void setIncludePaths(IPath[] incPaths) {
- }
-
- public IPath[] getLibraryPaths() {
- return new IPath[0];
- }
-
- public void setLibraryPaths(IPath[] libPaths) {
- }
-
- public String[] getLibraries() {
- return new String[0];
- }
-
- public void setLibraries(String[] libs) {
- }
-
-// public IOptimization getOptimization() {
-// return null;
-// }
-//
-// public IProject[] build(CIncrementalBuilder cbuilder) {
-// ICExtensionReference ref = getExtensionReference();
-// System.out.println("MakeBuilder!!!!\n Command is:" + ref.getExtensionData("command"));
-// return null;
-// }
-//
-// public void setOptimization(IOptimization o) {
-// }
-
- public String getID() {
- return CCorePlugin.PLUGIN_ID + ".makeBuilder";
- }
-
-
-}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeProject.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeProject.java
deleted file mode 100644
index f2e0e09ae0..0000000000
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/make/MakeProject.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * (c) Copyright QNX Software System Ltd. 2002.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.internal.core.make;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.ICDescriptor;
-import org.eclipse.cdt.core.ICExtensionReference;
-import org.eclipse.cdt.core.ICOwner;
-import org.eclipse.core.runtime.CoreException;
-
-public class MakeProject implements ICOwner {
-
- public void configure(ICDescriptor cproject) throws CoreException {
- cproject.remove(CCorePlugin.BUILDER_MODEL_ID);
- ICExtensionReference ext = cproject.create(CCorePlugin.BUILDER_MODEL_ID, CCorePlugin.PLUGIN_ID + ".makeBuilder");
- ext.setExtensionData("command", "make");
- }
-
- public void update(ICDescriptor cproject, String extensionID) throws CoreException {
- if ( extensionID.equals(CCorePlugin.BUILDER_MODEL_ID ) ) {
- ICExtensionReference ext = cproject.create(CCorePlugin.BUILDER_MODEL_ID, CCorePlugin.PLUGIN_ID + ".makeBuilder");
- ext.setExtensionData("command", "make");
- }
- }
-}

Back to the top