Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.xml1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java38
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java37
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java200
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultCygwinScannerInfoCollector.java64
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java95
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultMinGWScannerInfoCollector.java70
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java242
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ManagedBuildCPathEntryContainer.java78
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml343
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControl.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java9
18 files changed, 938 insertions, 374 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
index 485f300db43..a528162d19d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
<plugin
id="org.eclipse.cdt.managedbuilder.core.tests"
name="Tests"
version="1.0.0">
<requires>
+ <import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.junit"/>
<import plugin="org.eclipse.cdt.managedbuilder.core"/>
<import plugin="org.eclipse.cdt.core"/>
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
index 51ce76b1a56..39d4c757301 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java
@@ -239,8 +239,8 @@ public class ManagedBuildCoreTests extends TestCase {
buildInfo.setDefaultConfiguration(newTarget.getConfiguration(configs[0].getId()));
// Save the build info
- ManagedBuildManager.saveBuildInfo(project, false);
-
+ ManagedBuildManager.saveBuildInfo(project, false);
+
// Use the plugin mechanism to discover the supplier of the path information
IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
if (extensionPoint == null) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
index 6bfcd2b842b..9b8054bc0af 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
@@ -16,6 +16,7 @@
<import plugin="org.eclipse.cdt.core"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.core.runtime.compatibility"/>
+ <import plugin="org.eclipse.cdt.make.core"/>
</requires>
diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
index a08dd4b3ee9..b7612d3ceb0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
+++ b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
@@ -493,6 +493,16 @@ Additional special types exist to flag options of special relevance to the build
</documentation>
</annotation>
</attribute>
+ <attribute name="scannerInfoCollector" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector"/>
+ </appInfo>
+ </annotation>
+ </attribute>
</complexType>
</element>
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
index 417cf56eb85..1b38abfc526 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
@@ -10,6 +10,7 @@
**********************************************************************/
package org.eclipse.cdt.managedbuilder.core;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
public interface IConfiguration extends IBuildObject {
@@ -19,11 +20,15 @@ public interface IConfiguration extends IBuildObject {
public static final String PARENT = "parent"; //$NON-NLS-1$
/**
- * Returns the target for this configuration.
+ * Projects have C or CC natures. Tools can specify a filter so they are not
+ * misapplied to a project. This method allows the caller to retrieve a list
+ * of tools from a project that are correct for a project's nature.
*
- * @return
+ * @param project the project to filter for
+ * @return an array of <code>ITools</code> that have compatible filters
+ * for the specified project
*/
- public ITarget getTarget();
+ ITool[] getFilteredTools(IProject project);
/**
* Returns the resource that owns the target that owns the configuration.
@@ -38,6 +43,20 @@ public interface IConfiguration extends IBuildObject {
*/
public IConfiguration getParent();
+ /**
+ * Returns the target for this configuration.
+ *
+ * @return
+ */
+ public ITarget getTarget();
+
+ /**
+ * Answers the <code>ITool</code> in the receiver with the same
+ * id as the argument, or <code>null</code>.
+ *
+ * @param id unique identifier to search for
+ * @return
+ */
public ITool getToolById(String id);
/**
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
index 7baf68696a4..cea801d2756 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
@@ -35,12 +35,6 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.eclipse.cdt.core.AbstractCExtension;
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.IContainerEntry;
-import org.eclipse.cdt.core.model.IPathEntry;
-import org.eclipse.cdt.core.model.IPathEntryContainer;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
@@ -49,7 +43,6 @@ import org.eclipse.cdt.managedbuilder.internal.core.DefaultManagedConfigElement;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.Target;
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
-import org.eclipse.cdt.managedbuilder.scannerconfig.ManagedBuildCPathEntryContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -58,8 +51,6 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.PluginVersionIdentifier;
import org.eclipse.core.runtime.QualifiedName;
import org.w3c.dom.Document;
@@ -79,7 +70,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
private static final ITarget[] emptyTargets = new ITarget[0];
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + "ManagedBuildManager"; //$NON-NLS-1$ //$NON-NLS-2$
- private static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
+ public static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
@@ -93,6 +84,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
private static Map extensionToolMap;
private static Map configElementMap;
+
// Listeners interested in build model changes
private static Map buildModelListeners;
@@ -714,7 +706,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
return false;
}
- private static ManagedBuildInfo findBuildInfo(IResource resource, boolean create) {
+ private static synchronized ManagedBuildInfo findBuildInfo(IResource resource, boolean create) {
// Make sure the extension information is loaded first
try {
loadExtensions();
@@ -723,8 +715,6 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
return null;
}
- // Flag to deteremine if a PathEntryContainer is needed for project
- boolean needsContainer = false;
ManagedBuildInfo buildInfo = null;
// Check if there is any build info associated with this project for this session
@@ -741,36 +731,19 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
if (buildInfo == null && resource instanceof IProject) {
// Nothing in session store, so see if we can load it from cdtbuild
buildInfo = loadBuildInfo((IProject)resource);
- needsContainer = (buildInfo != null);
}
if (buildInfo == null && create) {
try {
// Create a new build info object for the project
- buildInfo = new ManagedBuildInfo(resource);
+ buildInfo = new ManagedBuildInfo(resource, true);
// Associate the build info with the project for the duration of the session
resource.setSessionProperty(buildInfoProperty, buildInfo);
- needsContainer = true;
} catch (CoreException e) {
return null;
}
}
- // Assocaite a container with the project
- if (buildInfo != null && needsContainer) {
- IPathEntryContainer container = new ManagedBuildCPathEntryContainer(buildInfo);
- try {
- ICProject project = CoreModel.getDefault().create((IProject)resource);
- IContainerEntry containerEntry = CoreModel.newContainerEntry(new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER")); //$NON-NLS-1$
- CoreModel.getDefault().setRawPathEntries(project, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
- CoreModel.getDefault().setPathEntryContainer(new ICProject[]{project}, container, new NullProgressMonitor());
- } catch (CModelException e) {
- e.printStackTrace();
- // The build info is valid even if there's no container
- return buildInfo;
- }
- }
-
return buildInfo;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
index 829f6e36ba7..5b2330314de 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
@@ -15,6 +15,11 @@ import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
+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.IPluginDescriptor;
import org.eclipse.core.runtime.Plugin;
@@ -77,4 +82,37 @@ public class ManagedBuilderCorePlugin extends Plugin {
return getDefault().getDescriptor().getUniqueIdentifier();
}
+ /**
+ * Targets may have a scanner collector defined that knows how to discover
+ * built-in compiler defines and includes search paths. Find the scanner
+ * collector implentation for the target specified.
+ *
+ * @param string the unique id of the target to search for
+ * @return an implementation of <code>IManagedScannerInfoCollector</code>
+ */
+ public IManagedScannerInfoCollector getScannerInfoCollector(String targetId) {
+ try {
+ IExtensionPoint extension = getDescriptor().getExtensionPoint(ManagedBuildManager.EXTENSION_POINT_ID);
+ if (extension != null) {
+ // There could be many of these
+ 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++) {
+ IConfigurationElement element = configElements[j];
+ if (element.getName().equals("target")) { //$NON-NLS-1$
+ if (element.getAttribute(ITarget.ID).equals(targetId)) {
+ return (IManagedScannerInfoCollector) element.createExecutableExtension("scannerInfoCollector"); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+ }
+ catch (CoreException e) {
+ // Probably not defined
+ }
+ return null;
+ }
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index a003c75180c..4cd8e42b5d9 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
+import java.util.Vector;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
@@ -245,6 +246,42 @@ public class Configuration extends BuildObject implements IConfiguration {
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools(org.eclipse.core.resources.IProject)
+ */
+ public ITool[] getFilteredTools(IProject project) {
+ ITool[] localTools = getTools();
+ Vector tools = new Vector(localTools.length);
+ for (int i = 0; i < localTools.length; i++) {
+ ITool tool = localTools[i];
+ try {
+ // Make sure the tool is right for the project
+ switch (tool.getNatureFilter()) {
+ case ITool.FILTER_C:
+ if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ tools.add(tool);
+ }
+ break;
+ case ITool.FILTER_CC:
+ if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ tools.add(tool);
+ }
+ break;
+ case ITool.FILTER_BOTH:
+ tools.add(tool);
+ break;
+ default:
+ break;
+ }
+ } catch (CoreException e) {
+ continue;
+ }
+ }
+
+ // Answer the filtered tools as an array
+ return (ITool[])tools.toArray(new ITool[tools.size()]);
+ }
+
/* (non-javadoc)
* A safety method to avoid NPEs. It answers the tool reference list in the
* receiver. It does not look at the tool references defined in the parent.
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
index 98a3a13000d..497f3189054 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
@@ -23,8 +23,11 @@ import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.IContainerEntry;
import org.eclipse.cdt.core.model.IIncludeEntry;
+import org.eclipse.cdt.core.model.IMacroEntry;
import org.eclipse.cdt.core.model.IPathEntry;
+import org.eclipse.cdt.core.model.IPathEntryContainer;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -33,10 +36,12 @@ import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.ITarget;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedBuildCPathEntryContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.w3c.dom.Document;
@@ -50,6 +55,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
public static final String MINOR_SEPERATOR = "::"; //$NON-NLS-1$
private static final QualifiedName defaultConfigProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "defaultConfig"); //$NON-NLS-1$
private static final QualifiedName defaultTargetProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "defaultTarget"); //$NON-NLS-1$
+ // The path container used for all managed projects
+ private static final IContainerEntry containerEntry = CoreModel.newContainerEntry(new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER")); //$NON-NLS-1$
+
+ private ICProject cModelElement;
private String defaultConfigIds;
private Map defaultConfigMap;
private ITarget defaultTarget;
@@ -61,13 +70,34 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
private List targetList;
private String version;
+
/**
- * Create a new managed build information for the IResource specified in the argument
+ * For compatability.
*
* @param owner
*/
public ManagedBuildInfo(IResource owner) {
+ this(owner, true);
+ }
+
+ /**
+ * Create a new managed build information for the IResource specified in the argument
+ *
+ * @param owner
+ * @param intializeEntries
+ * @since 2.0
+ */
+ public ManagedBuildInfo(IResource owner, boolean intializeEntries) {
this.owner = owner;
+ cModelElement = CoreModel.getDefault().create(owner.getProject());
+
+ try {
+ CoreModel.getDefault().setRawPathEntries(cModelElement, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
+ } catch (CModelException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
isDirty = false;
// The id of the default target from the project persistent settings store
@@ -89,6 +119,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
return;
}
+ if(intializeEntries) {
+ initializePathEntries();
+ }
}
/**
@@ -99,13 +132,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @param element
*/
public ManagedBuildInfo(IResource owner, Element element) {
- this(owner);
+ this(owner, false);
// Inflate the targets
NodeList targetNodes = element.getElementsByTagName(ITarget.TARGET_ELEMENT_NAME);
for (int targIndex = targetNodes.getLength() - 1; targIndex >= 0; --targIndex) {
new Target(this, (Element)targetNodes.item(targIndex));
}
+
+ initializePathEntries();
}
/* (non-Javadoc)
@@ -273,7 +308,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
// If that failed, look for anything
if (defaultTarget == null) {
- defaultTarget = (ITarget) getTargets().get(0);
+ // Are there any defined targets
+ if (getTargets().size() > 0) {
+ return (ITarget) getTargets().get(0);
+ }
}
}
return defaultTarget;
@@ -283,32 +321,12 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols()
*/
public Map getDefinedSymbols() {
- IProject project = (IProject)owner;
// Return the defined symbols for the default configuration
- HashMap symbols = new HashMap();
+ HashMap symbols = getMacroPathEntries();
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
- ITool[] tools = config.getTools();
+ ITool[] tools = config.getFilteredTools(owner.getProject());
for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
- try {
- // Make sure the tool is right for the project
- switch (tool.getNatureFilter()) {
- case ITool.FILTER_C:
- if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- continue;
- }
- break;
- case ITool.FILTER_CC:
- if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- continue;
- }
- break;
- case ITool.FILTER_BOTH:
- break;
- }
- } catch (CoreException e) {
- continue;
- }
// Now extract the valid tool's options
IOption[] opts = tool.getOptions();
for (int j = 0; j < opts.length; j++) {
@@ -316,7 +334,6 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
try {
ArrayList symbolList = new ArrayList();
- symbolList.addAll(Arrays.asList(option.getBuiltIns()));
symbolList.addAll(Arrays.asList(option.getDefinedSymbols()));
Iterator iter = symbolList.listIterator();
while (iter.hasNext()) {
@@ -324,15 +341,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (symbol.length() == 0){
continue;
}
- String key = new String();
- String value = new String();
- int index = symbol.indexOf("="); //$NON-NLS-1$
- if (index != -1) {
- key = symbol.substring(0, index).trim();
- value = symbol.substring(index + 1).trim();
- } else {
- key = symbol.trim();
- }
+ String[] tokens = symbol.split("="); //$NON-NLS-1$
+ String key = tokens[0].trim();
+ String value = (tokens.length > 1) ? tokens[1].trim() : new String();
symbols.put(key, value);
}
@@ -426,14 +437,37 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
return null;
}
+ private ArrayList getIncludePathEntries() {
+ // Extract the resolved paths from the project (if any)
+ ArrayList paths = new ArrayList();
+ if (cModelElement != null) {
+ try {
+ IPathEntry[] entries = cModelElement.getResolvedPathEntries();
+ for (int index = 0; index < entries.length; ++index) {
+ int kind = entries[index].getEntryKind();
+ if (kind == IPathEntry.CDT_INCLUDE) {
+ IIncludeEntry include = (IIncludeEntry) entries[index];
+ if (include.isSystemInclude()) {
+ IPath entryPath = include.getFullIncludePath();
+ paths.add(entryPath.toString());
+ }
+ }
+ }
+ } catch (CModelException e) {
+ // Just return an empty array
+ paths.clear();
+ return paths;
+ }
+ }
+ return paths;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
*/
public String[] getIncludePaths() {
- IProject project = (IProject)owner;
-
// Return the include paths for the default configuration
- ArrayList paths = new ArrayList();
+ ArrayList paths = getIncludePathEntries();
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
IPath location = owner.getLocation();
// If the build info is out of date this might be null
@@ -441,36 +475,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
location = new Path("."); //$NON-NLS-1$
}
IPath root = location.addTrailingSeparator().append(config.getName());
- ITool[] tools = config.getTools();
+ ITool[] tools = config.getFilteredTools(owner.getProject());
for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
- try {
- // Make sure the tool is right for the project
- switch (tool.getNatureFilter()) {
- case ITool.FILTER_C:
- if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- continue;
- }
- break;
- case ITool.FILTER_CC:
- if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- continue;
- }
- break;
- case ITool.FILTER_BOTH:
- break;
- }
- } catch (CoreException e) {
- continue;
- }
// The tool checks out for this project, get its options
IOption[] opts = tool.getOptions();
for (int j = 0; j < opts.length; j++) {
IOption option = opts[j];
if (option.getValueType() == IOption.INCLUDE_PATH) {
try {
- // Get all the built-in paths from the option
- paths.addAll(getCompilerPaths(option));
// Get all the user-defined paths from the option as absolute paths
String[] userPaths = option.getIncludePaths();
for (int index = 0; index < userPaths.length; ++index) {
@@ -489,41 +502,30 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
}
}
- paths.trimToSize();
+
+ // Answer the results as an array
return (String[])paths.toArray(new String[paths.size()]);
}
- /**
- * @param owner2
- * @return
- */
- private List getCompilerPaths(IOption option) {
- // Extract the resolved paths from the project (if any)
- ArrayList paths = new ArrayList();
- ICProject project = CoreModel.getDefault().create(owner.getProject());
- if (project != null) {
+ private HashMap getMacroPathEntries() {
+ HashMap macros = new HashMap();
+ if (cModelElement != null) {
try {
- IPathEntry[] entries = project.getResolvedPathEntries();
- for (int index = entries.length - 1; index >=0; --index) {
- int kind = entries[index].getEntryKind();
- if (kind == IPathEntry.CDT_INCLUDE) {
- IIncludeEntry include = (IIncludeEntry) entries[index];
- if (include.isSystemInclude()) {
- IPath entryPath = include.getPath();
- paths.add(entryPath.toString());
- }
+ IPathEntry[] entries = cModelElement.getResolvedPathEntries();
+ for (int index = 0; index < entries.length; ++index) {
+ if (entries[index].getEntryKind() == IPathEntry.CDT_MACRO) {
+ IMacroEntry macro = (IMacroEntry) entries[index];
+ macros.put(macro.getMacroName(), macro.getMacroValue());
}
}
} catch (CModelException e) {
- // See if there are any built-ins from the tool definition
- return Arrays.asList(option.getBuiltIns());
+ // return an empty map
+ macros.clear();
+ return macros;
}
+
}
-// if (paths.size() == 0) {
- return Arrays.asList(option.getBuiltIns());
-// } else {
-// return paths;
-// }
+ return macros;
}
/* (non-Javadoc)
@@ -976,6 +978,19 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
/* (non-Javadoc)
+ *
+ */
+ private void initializePathEntries() {
+ try {
+ IPathEntryContainer container = new ManagedBuildCPathEntryContainer(this);
+ CoreModel.getDefault().setPathEntryContainer(new ICProject[]{cModelElement}, container, new NullProgressMonitor());
+ } catch (CModelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#removeTarget(java.lang.String)
*/
public void removeTarget(String id) {
@@ -1045,6 +1060,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
defaultTarget = target;
defaultTargetId = target.getId();
persistDefaultTarget();
+ initializePathEntries();
}
}
@@ -1103,6 +1119,18 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
ITarget target = (ITarget) iter.next();
target.updateOwner(resource);
}
+ // And finally update the cModelElement
+ cModelElement = CoreModel.getDefault().create(owner.getProject());
+ try {
+ CoreModel.getDefault().setRawPathEntries(cModelElement, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
+ } catch (CModelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ initializePathEntries();
+
+ // Save everything
+ setDirty(true);
}
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultCygwinScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultCygwinScannerInfoCollector.java
new file mode 100644
index 00000000000..c1b19bb62bd
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultCygwinScannerInfoCollector.java
@@ -0,0 +1,64 @@
+/**********************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
+import org.eclipse.core.resources.IResource;
+
+/**
+ * Implementation class for gathering the built-in compiler settings for
+ * Cygwin-based targets.
+ *
+ * @since 2.0
+ */
+public class DefaultCygwinScannerInfoCollector extends DefaultGCCScannerInfoCollector {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(org.eclipse.core.resources.IResource, java.util.List, java.util.List, java.util.List)
+ */
+ public void contributeToScannerConfig(IResource resource, List includes,
+ List symbols, List targetSpecificOptions) {
+ // This method will be called by the parser each time there is a new value
+ Iterator pathIter = includes.listIterator();
+ while (pathIter.hasNext()) {
+ String path = (String) pathIter.next();
+ String convertedPath = convertPath(path);
+ getIncludePaths().add(convertedPath);
+ }
+
+ // Now add the macros
+ Iterator symbolIter = symbols.listIterator();
+ while (symbolIter.hasNext()) {
+ // See if it has an equals
+ String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
+ String macro = macroTokens[0].trim();
+ String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String();
+ getDefinedSymbols().put(macro, value);
+ }
+ }
+
+ /* (non-Javadoc)
+ * Converts the argument from a POSIX-style path to a valid Win32 path.
+ * If the string is already in the proper format it will not be changed.
+ *
+ * @param path <code>String</code> containing path to convert
+ * @return <code>String</code> containing the converted path
+ */
+ private String convertPath(String includePath) {
+ // Convert a POSIX-style path to Win32
+ String translatedPath = new CygpathTranslator(project, includePath).run();
+ return translatedPath;
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java
new file mode 100644
index 00000000000..00ce6433fff
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java
@@ -0,0 +1,95 @@
+/**********************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+
+/**
+ * Implementation class for gathering the built-in compiler settings for
+ * GCC-based targets. The assumption is that the tools will answer path
+ * information in POSIX format and that the Scanner will be able to search for
+ * files using this format.
+ *
+ * @since 2.0
+ */
+public class DefaultGCCScannerInfoCollector implements IManagedScannerInfoCollector {
+ protected Map definedSymbols;
+ protected static final String EQUALS = "="; //$NON-NLS-1$
+ protected List includePaths;
+ protected IProject project;
+
+ /**
+ *
+ */
+ public DefaultGCCScannerInfoCollector() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(org.eclipse.core.resources.IResource, java.util.List, java.util.List, java.util.List)
+ */
+ public void contributeToScannerConfig(IResource resource, List includes,
+ List symbols, List targetSpecificOptions) {
+
+ // This method will be called by the parser each time there is a new value
+ Iterator pathIter = includes.listIterator();
+ while (pathIter.hasNext()) {
+ String path = (String) pathIter.next();
+ getIncludePaths().add(path);
+ }
+
+ // Now add the macros
+ Iterator symbolIter = symbols.listIterator();
+ while (symbolIter.hasNext()) {
+ // See if it has an equals
+ String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
+ String macro = macroTokens[0].trim();
+ String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String();
+ getDefinedSymbols().put(macro, value);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols()
+ */
+ public Map getDefinedSymbols() {
+ if (definedSymbols == null) {
+ definedSymbols = new HashMap();
+ }
+ return definedSymbols;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#getIncludePaths()
+ */
+ public List getIncludePaths() {
+ if (includePaths == null) {
+ includePaths = new ArrayList();
+ }
+ return includePaths;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#setProject(org.eclipse.core.resources.IProject)
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultMinGWScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultMinGWScannerInfoCollector.java
new file mode 100644
index 00000000000..7cda6bcf1f0
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultMinGWScannerInfoCollector.java
@@ -0,0 +1,70 @@
+/**********************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+
+/**
+ * Implementation class for gathering the built-in compiler settings for
+ * MinGw-based targets. The paths are collected only in Win32 format.
+ *
+ * @since 2.0
+ */
+public class DefaultMinGWScannerInfoCollector extends DefaultGCCScannerInfoCollector {
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(org.eclipse.core.resources.IResource, java.util.List, java.util.List, java.util.List)
+ */
+ public void contributeToScannerConfig(IResource resource, List includes,
+ List symbols, List targetSpecificOptions) {
+ // This method will be called by the parser each time there is a new value
+ Iterator pathIter = includes.listIterator();
+ while (pathIter.hasNext()) {
+ String path = (String) pathIter.next();
+ if (!filterPath(path)) {
+ getIncludePaths().add(path);
+ }
+ }
+
+ // Now add the macros
+ Iterator symbolIter = symbols.listIterator();
+ while (symbolIter.hasNext()) {
+ // See if it has an equals
+ String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
+ String macro = macroTokens[0].trim();
+ String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String();
+ getDefinedSymbols().put(macro, value);
+ }
+ }
+
+ /* (non-Javadoc)
+ *
+ * @param path
+ * @return
+ */
+ private boolean filterPath(String includePath) {
+ // MinGW's compiler will return paths in both POSIX and Win32 format
+ // We only want to store the Win32 variant like:
+ // <drive_letter>:<path>
+ // \\<unc_path>
+ int firstColon = includePath.indexOf(':'); //$NON-NLS-1$
+ if (firstColon == 1 && Character.isLetter(includePath.charAt(0))) {
+ // <drive>:<path> is OK
+ return false;
+ }
+
+ return true;
+ }
+
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java
new file mode 100644
index 00000000000..083f1dc9d86
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java
@@ -0,0 +1,242 @@
+/**********************************************************************
+ * Copyright (c) Apr 21, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.IIncludeEntry;
+import org.eclipse.cdt.core.model.IMacroEntry;
+import org.eclipse.cdt.core.model.IPathEntry;
+import org.eclipse.cdt.core.model.IPathEntryContainer;
+import org.eclipse.cdt.make.core.MakeCorePlugin;
+import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
+import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo;
+import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.ITarget;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * Implements a specialized path container for managed build projects. It will
+ * either start the dynamic path collector specified for a target in the tool
+ * manifest, or it will attempt to discover the built-in values specified in
+ * the manifest.
+ *
+ * @since 2.0
+ */
+public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
+
+ private static final String BUILDER_ID = MakeCorePlugin.getUniqueIdentifier() + ".ScannerConfigBuilder"; //$NON-NLS-1$
+ private ITarget defaultTarget;
+ private Vector entries;
+ private ManagedBuildInfo info;
+
+ /**
+ * Creates a new path container for the managed buildd project.
+ *
+ * @param info the build information associated with the project
+ */
+ public ManagedBuildCPathEntryContainer(ManagedBuildInfo info) {
+ super();
+ this.info = info;
+ defaultTarget = info.getDefaultTarget();
+ entries = new Vector();
+ }
+
+ protected void addDefinedSymbols(Map definedSymbols) {
+ // Add a new macro entry for each defined symbol
+ Set macros = definedSymbols.keySet();
+ Iterator keyIter = macros.iterator();
+ while (keyIter.hasNext()) {
+ boolean add = true;
+ String macro = (String) keyIter.next();
+ String value = (String) definedSymbols.get(macro);
+ // Make sure the current entries do not contain a duplicate
+ Iterator entryIter = entries.listIterator();
+ while (entryIter.hasNext()) {
+ IPathEntry entry = (IPathEntry) entryIter.next();
+ if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
+ if (((IMacroEntry)entry).getMacroName().equals(macro) &&
+ ((IMacroEntry)entry).getMacroValue().equals(value)) {
+ add = false;
+ break;
+ }
+ }
+ }
+
+ if (add) {
+ entries.add(CoreModel.newMacroEntry(new Path(""), macro, value)); //$NON-NLS-1$
+ }
+ }
+
+ }
+
+ protected void addIncludePaths(List paths) {
+ // A little checking is needed to avoid adding duplicates
+ Iterator pathIter = paths.listIterator();
+ while (pathIter.hasNext()) {
+ boolean add = true;
+ String path = (String) pathIter.next();
+ // Make sure there is no other path with the same value
+ Iterator entryIter = entries.listIterator();
+ while (entryIter.hasNext()) {
+ IPathEntry entry = (IPathEntry) entryIter.next();
+ if (entry.getEntryKind() == IPathEntry.CDT_INCLUDE) {
+ if (((IIncludeEntry)entry).getFullIncludePath().equals(path)) {
+ add = false;
+ break;
+ }
+ }
+ }
+ if (add) {
+ entries.add(CoreModel.newIncludeEntry(new Path(""), null, new Path(path), true)); //$NON-NLS-1$
+ }
+ }
+
+ }
+
+ protected void calculateBuiltIns(ITarget defaultTarget, IConfiguration config) {
+ ITool[] tools = config.getFilteredTools(info.getOwner().getProject());
+
+ // Iterate over the list
+ for (int toolIndex = 0; toolIndex < tools.length; ++toolIndex) {
+ ITool tool = tools[toolIndex];
+ // Check its options
+ IOption[] options = tool.getOptions();
+ for (int optIndex = 0; optIndex < options.length; ++optIndex) {
+ IOption option = options[optIndex];
+ if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
+ String[] builtIns = option.getBuiltIns();
+ Map macroMap = new HashMap();
+ for (int biIndex = 0; biIndex < builtIns.length; ++biIndex) {
+ String symbol = builtIns[biIndex];
+ String[] tokens = symbol.split("="); //$NON-NLS-1$
+ String macro = tokens[0].trim();
+ String value = (tokens.length > 1) ? tokens[1] : new String();
+ macroMap.put(macro, value);
+ }
+ addDefinedSymbols(macroMap);
+ } else if (option.getValueType() == IOption.INCLUDE_PATH) {
+ // Make sure it is a built-in, not a user-defined path
+ String[] values = option.getBuiltIns();
+ if (values.length > 0) {
+ addIncludePaths(Arrays.asList(values));
+ }
+ }
+ }
+ }
+
+ }
+
+ protected void calculateEntriesDynamically(final IProject project, final IScannerInfoCollector collector) {
+ final IScannerConfigBuilderInfo buildInfo;
+ buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(
+ MakeCorePlugin.getDefault().getPluginPreferences(),
+ BUILDER_ID,
+ false);
+
+ // TODO Get the provider from the toolchain specification
+ final IExternalScannerInfoProvider esiProvider;
+ esiProvider = MakeCorePlugin.getDefault().getExternalScannerInfoProvider(MakeCorePlugin.DEFAULT_EXTERNAL_SI_PROVIDER_ID);
+
+ // Set the arguments for the provider
+ Vector compilerArgs = new Vector();
+ String args = buildInfo.getESIProviderArguments();
+ IPath command = buildInfo.getESIProviderCommand();
+ final Vector buildArgs = compilerArgs;
+
+ ISafeRunnable runnable = new ISafeRunnable() {
+ public void run() {
+ IProgressMonitor monitor = new NullProgressMonitor();
+ esiProvider.invokeProvider(monitor, project, buildInfo, buildArgs, collector);
+ }
+
+ public void handleException(Throwable exception) {
+ if (exception instanceof OperationCanceledException) {
+ throw (OperationCanceledException) exception;
+ }
+ }
+ };
+ Platform.run(runnable);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.model.IPathEntryContainer#getPathEntries()
+ */
+ public synchronized IPathEntry[] getPathEntries() {
+ // TODO figure out when I can skip this step
+ if (entries.isEmpty()) {
+ // Load the toolchain-spec'd collector
+ defaultTarget = info.getDefaultTarget();
+ if (defaultTarget == null) {
+ // The build information has not been loaded yet
+ return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
+ }
+ ITarget parent = defaultTarget.getParent();
+ if (parent == null) {
+ // The build information has not been loaded yet
+ return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
+ }
+ // See if we can load a dynamic resolver
+ String baseTargetId = parent.getId();
+ IManagedScannerInfoCollector collector = ManagedBuilderCorePlugin.getDefault().getScannerInfoCollector(baseTargetId);
+ if (collector != null) {
+ collector.setProject(info.getOwner().getProject());
+ calculateEntriesDynamically((IProject)info.getOwner(), collector);
+ addIncludePaths(collector.getIncludePaths());
+ addDefinedSymbols(collector.getDefinedSymbols());
+ } else {
+ // If none supplied, use the built-ins
+ IConfiguration config = info.getDefaultConfiguration(defaultTarget);
+ if (config != null) {
+ calculateBuiltIns(defaultTarget, config);
+ } else {
+ return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
+ }
+ }
+ }
+ return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.model.IPathEntryContainer#getDescription()
+ */
+ public String getDescription() {
+ return "CDT Managed Build Project"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.model.IPathEntryContainer#getPath()
+ */
+ public IPath getPath() {
+ return new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"); //$NON-NLS-1$
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java
new file mode 100644
index 00000000000..47c1eb7176e
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java
@@ -0,0 +1,52 @@
+/**********************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.cdt.managedbuilder.scannerconfig;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
+import org.eclipse.core.resources.IProject;
+
+/**
+ * Interface that a colelctor of compiler information must implement.
+ * @since 2.0
+ */
+public interface IManagedScannerInfoCollector extends IScannerInfoCollector {
+ /**
+ * Answers a map of collected defines that the the compiler uses by default.
+ * The symbols are defined in the map as a (macro, value) pair as follows
+ * <p><p><code>-DFOO</code> will be stored as ("FOO","")
+ * <p><code>-DFOO=BAR</code> will be stored as ("FOO","BAR")
+ * <p><p>Duplicates will not be stored in the map and any whitespaces in
+ * the macro or value will be trimmed out.
+ *
+ * @return a <code>Map</code> of defined symbols and values
+ */
+ public Map getDefinedSymbols();
+
+
+ /**
+ * Answers a <code>List</code> of unique built-in includes paths that have been
+ * collected for the receiver. The paths are stored as <code>String</code> in the proper
+ * format for the host tools.
+ *
+ * @return a <code>List</code> of built-in compiler include search paths.
+ */
+ public List getIncludePaths();
+
+ /**
+ * Sets the <code>IProject</code> for the receiver.
+ *
+ * @param project
+ */
+ public void setProject(IProject project);
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ManagedBuildCPathEntryContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ManagedBuildCPathEntryContainer.java
deleted file mode 100644
index 4eb68453b39..00000000000
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/ManagedBuildCPathEntryContainer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**********************************************************************
- * Copyright (c) Apr 21, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-
-package org.eclipse.cdt.managedbuilder.scannerconfig;
-
-import java.util.ArrayList;
-
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.IPathEntry;
-import org.eclipse.cdt.core.model.IPathEntryContainer;
-import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- *
- *
- */
-public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
-
- private ManagedBuildInfo info;
-
- /**
- *
- */
- public ManagedBuildCPathEntryContainer(ManagedBuildInfo info) {
- super();
- this.info = info;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.model.IPathEntryContainer#getPathEntries()
- */
- public IPathEntry[] getPathEntries() {
- // Resolve the symbols and paths for the project
- IPath resourcePath = info.getOwner().getProjectRelativePath();
-
- ArrayList entries = new ArrayList();
- entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/c++"), true));
- entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/c++/i686-pc-cygwin"), true));
- entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/c++/backward"), true));
- entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include"), true));
- entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include"), true));
- entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/api"), true));
-
- entries.add(CoreModel.newMacroEntry(resourcePath, "__GNUC__", "3"));
- entries.add(CoreModel.newMacroEntry(resourcePath, "__GNUC_MINOR__", "3"));
- entries.add(CoreModel.newMacroEntry(resourcePath, "__GNUC_PATCHLEVEL__", "1"));
- entries.add(CoreModel.newMacroEntry(resourcePath, "__CYGWIN32__", ""));
- entries.add(CoreModel.newMacroEntry(resourcePath, "__CYGWIN__", ""));
- entries.add(CoreModel.newMacroEntry(resourcePath, "unix", ""));
- entries.add(CoreModel.newMacroEntry(resourcePath, "__unix__", ""));
- entries.add(CoreModel.newMacroEntry(resourcePath, "unix__", ""));
- return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.model.IPathEntryContainer#getDescription()
- */
- public String getDescription() {
- return "CDT Managed Build Project"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.model.IPathEntryContainer#getPath()
- */
- public IPath getPath() {
- return new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"); //$NON-NLS-1$
- }
-}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index e10bfaeeb5e..51b6c6d8749 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -31,8 +31,8 @@
icon="icons/full/wizban/newmngcc_app.gif"
category="org.eclipse.cdt.ui.newCCWizards"
class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCCProjectWizard"
- project="true"
finalPerspective="org.eclipse.cdt.ui.CPerspective"
+ project="true"
id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCCWizard">
<description>
%MngCCWizard.description
@@ -43,8 +43,8 @@
icon="icons/full/wizban/newmngc_app.gif"
category="org.eclipse.cdt.ui.newCWizards"
class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCProjectWizard"
- project="true"
finalPerspective="org.eclipse.cdt.ui.CPerspective"
+ project="true"
id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCWizard">
<description>
%MngCWizard.description
@@ -54,8 +54,8 @@
<extension
point="org.eclipse.ui.propertyPages">
<page
- objectClass="org.eclipse.core.resources.IProject"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IProject"
name="%MngBuildProp.name"
class="org.eclipse.cdt.managedbuilder.ui.properties.BuildPropertyPage"
id="org.eclipse.cdt.managedbuilder.ui.properties.BuildProperties">
@@ -68,8 +68,8 @@
<extension
point="org.eclipse.ui.propertyPages">
<page
- objectClass="org.eclipse.core.resources.IProject"
adaptable="true"
+ objectClass="org.eclipse.core.resources.IProject"
name="%MngOtherProp.name"
class="org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderPropertyPage"
id="org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderProperties">
@@ -95,8 +95,8 @@
</managedBuildRevision>
<tool
natureFilter="cnature"
- sources="o"
name="%ToolName.linker.gnu.c"
+ sources="o"
outputFlag="-o"
command="gcc"
id="cdt.managedbuild.tool.gnu.c.linker">
@@ -110,40 +110,40 @@
name="%Option.Posix.Linker.NoStartFiles"
category="gnu.c.link.category.general"
command="-nostartfiles"
- id="gnu.c.link.option.nostart"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.link.option.nostart">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.NoDefLibs"
category="gnu.c.link.category.general"
command="-nodefaultlibs"
- id="gnu.c.link.option.nodeflibs"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.link.option.nodeflibs">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.NoStdLibs"
category="gnu.c.link.category.general"
command="-nostdlib"
- id="gnu.c.link.option.nostdlibs"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.link.option.nostdlibs">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.Strip"
category="gnu.c.link.category.general"
command="-s"
- id="gnu.c.link.option.strip"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.link.option.strip">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.Static"
category="gnu.c.link.category.general"
command="-static"
- id="gnu.c.link.option.noshared"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.link.option.noshared">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.linker"
@@ -154,17 +154,17 @@
name="%Option.Posix.Libs"
category="gnu.c.link.category.libs"
command="-l"
- id="gnu.c.link.option.libs"
+ valueType="libs"
browseType="file"
- valueType="libs">
+ id="gnu.c.link.option.libs">
</option>
<option
name="%Option.Posix.Libsearch"
category="gnu.c.link.category.libs"
command="-L"
- id="gnu.c.link.option.paths"
+ valueType="stringList"
browseType="directory"
- valueType="stringList">
+ id="gnu.c.link.option.paths">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.linker"
@@ -174,22 +174,22 @@
<option
name="%Option.Posix.Linker.Flags"
category="gnu.c.link.category.other"
- valueType="string"
- id="gnu.c.link.option.ldflags">
+ id="gnu.c.link.option.ldflags"
+ valueType="string">
</option>
<option
name="%Option.Posix.Linker.XLinker"
category="gnu.c.link.category.other"
command="-Xlinker"
- valueType="stringList"
- id="gnu.c.link.option.other">
+ id="gnu.c.link.option.other"
+ valueType="stringList">
</option>
<option
name="%Option.Posix.UserObjs"
category="gnu.c.link.category.other"
- browseType="file"
+ id="gnu.c.link.option.userobjs"
valueType="userObjs"
- id="gnu.c.link.option.userobjs">
+ browseType="file">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.linker"
@@ -201,35 +201,35 @@
name="%Option.Posix.Linker.Shared"
category="gnu.c.link.category.shared"
command="-shared"
- id="gnu.c.link.option.shared"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.link.option.shared">
</option>
<option
name="%Option.Posix.Linker.SOName"
category="gnu.c.link.category.shared"
command="-Wl,-soname,"
- id="gnu.c.link.option.soname"
- valueType="string">
+ valueType="string"
+ id="gnu.c.link.option.soname">
</option>
<option
name="%Option.Posix.Linker.Implib"
category="gnu.c.link.category.shared"
command="-Wl,--out-implib,"
- id="gnu.c.link.option.implname"
- valueType="string">
+ valueType="string"
+ id="gnu.c.link.option.implname">
</option>
<option
name="%Option.Posix.Linker.Defname"
category="gnu.c.link.category.shared"
command="-Wl,--output-def,"
- id="gnu.c.link.option.defname"
- valueType="string">
+ valueType="string"
+ id="gnu.c.link.option.defname">
</option>
</tool>
<tool
natureFilter="ccnature"
- sources="o"
name="%ToolName.linker.gnu.cpp"
+ sources="o"
outputFlag="-o"
command="g++"
id="cdt.managedbuild.tool.gnu.cpp.linker">
@@ -243,32 +243,32 @@
name="%Option.Posix.Linker.NoStartFiles"
category="gnu.cpp.link.category.options"
command="-nostartfiles"
- id="gnu.cpp.link.option.nostart"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.link.option.nostart">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.NoDefLibs"
category="gnu.cpp.link.category.options"
command="-nodefaultlibs"
- id="gnu.cpp.link.option.nodeflibs"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.link.option.nodeflibs">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.NoStdLibs"
category="gnu.cpp.link.category.options"
command="-nostdlib"
- id="gnu.cpp.link.option.nostdlibs"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.link.option.nostdlibs">
</option>
<option
defaultValue="false"
name="%Option.Posix.Linker.Strip"
category="gnu.cpp.link.category.options"
command="-s"
- id="gnu.cpp.link.option.strip"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.link.option.strip">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.linker"
@@ -279,17 +279,17 @@
name="%Option.Posix.Libs"
category="gnu.cpp.link.category.libs"
command="-l"
- id="gnu.cpp.link.option.libs"
+ valueType="libs"
browseType="file"
- valueType="libs">
+ id="gnu.cpp.link.option.libs">
</option>
<option
name="%Option.Posix.Libsearch"
category="gnu.cpp.link.category.libs"
command="-L"
- id="gnu.cpp.link.option.paths"
+ valueType="stringList"
browseType="directory"
- valueType="stringList">
+ id="gnu.cpp.link.option.paths">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.linker"
@@ -299,22 +299,22 @@
<option
name="%Option.Posix.Linker.Flags"
category="gnu.cpp.link.category.other"
- valueType="string"
- id="gnu.cpp.link.option.flags">
+ id="gnu.cpp.link.option.flags"
+ valueType="string">
</option>
<option
name="%Option.Posix.Linker.XLinker"
category="gnu.cpp.link.category.other"
command="-Xlinker"
- valueType="stringList"
- id="gnu.cpp.link.option.other">
+ id="gnu.cpp.link.option.other"
+ valueType="stringList">
</option>
<option
name="%Option.Posix.UserObjs"
category="gnu.cpp.link.category.other"
- browseType="file"
+ id="gnu.cpp.link.option.userobjs"
valueType="userObjs"
- id="gnu.cpp.link.option.userobjs">
+ browseType="file">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.linker"
@@ -326,38 +326,38 @@
name="%Option.Posix.Linker.Shared"
category="gnu.cpp.link.category.shared"
command="-shared"
- valueType="boolean"
- id="gnu.cpp.link.option.shared">
+ id="gnu.cpp.link.option.shared"
+ valueType="boolean">
</option>
<option
name="%Option.Posix.Linker.SOName"
category="gnu.cpp.link.category.shared"
command="-Wl,-soname,"
- valueType="string"
- id="gnu.cpp.link.option.soname">
+ id="gnu.cpp.link.option.soname"
+ valueType="string">
</option>
<option
name="%Option.Posix.Linker.Implib"
category="gnu.cpp.link.category.shared"
command="-Wl,--out-implib,"
- valueType="string"
- id="gnu.cpp.link.option.implname">
+ id="gnu.cpp.link.option.implname"
+ valueType="string">
</option>
<option
name="%Option.Posix.Linker.Defname"
category="gnu.cpp.link.category.shared"
command="-Wl,--output-def,"
- valueType="string"
- id="gnu.cpp.link.option.defname">
+ id="gnu.cpp.link.option.defname"
+ valueType="string">
</option>
</tool>
<tool
natureFilter="both"
- sources="o"
name="%ToolName.archiver.gnu"
- outputs="a"
- command="ar"
+ sources="o"
outputPrefix="lib"
+ command="ar"
+ outputs="a"
id="cdt.managedbuild.tool.gnu.archiver">
<optionCategory
owner="cdt.managedbuild.tool.gnu.archiver"
@@ -368,8 +368,8 @@
defaultValue="-r"
name="%Option.Posix.Archiver.Flags"
category="gnu.lib.category.general"
- valueType="string"
- id="gnu.both.lib.option.flags">
+ id="gnu.both.lib.option.flags"
+ valueType="string">
</option>
</tool>
<target
@@ -384,12 +384,12 @@
makeArguments="-k">
<tool
natureFilter="cnature"
- sources="c"
name="%ToolName.compiler.gnu.c"
+ sources="c"
headerExtensions="h"
outputFlag="-o"
- outputs="o"
command="gcc"
+ outputs="o"
id="cdt.managedbuild.tool.gnu.c.compiler">
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -401,16 +401,16 @@
name="%Option.Posix.Nostdinc"
category="gnu.c.compiler.category.preprocessor"
command="-nostdinc"
- id="gnu.c.compiler.option.preprocessor.nostdinc"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.preprocessor.nostdinc">
</option>
<option
defaultValue="false"
name="%Option.Posix.PreprocOnly"
category="gnu.c.compiler.category.preprocessor"
command="-E"
- id="gnu.c.compiler.option.preprocessor.preprocess"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.preprocessor.preprocess">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -421,15 +421,15 @@
name="%Option.Posix.DefSym"
category="gnu.c.compiler.category.symbols"
command="-D"
- id="gnu.c.compiler.option.preprocessor.def.symbols"
- valueType="definedSymbols">
+ valueType="definedSymbols"
+ id="gnu.c.compiler.option.preprocessor.def.symbols">
</option>
<option
name="%Option.Posix.UndefSym"
category="gnu.c.compiler.category.symbols"
command="-U"
- id="gnu.c.compiler.option.preprocessor.undef.symbol"
- valueType="stringList">
+ valueType="stringList"
+ id="gnu.c.compiler.option.preprocessor.undef.symbol">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -440,9 +440,9 @@
name="%Option.Posix.InclPaths"
category="gnu.c.compiler.category.dirs"
command="-I"
- id="gnu.c.compiler.option.include.paths"
+ browseType="directory"
valueType="includePath"
- browseType="directory">
+ id="gnu.c.compiler.option.include.paths">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -452,8 +452,8 @@
<option
name="%Option.Posix.OptLevel"
category="gnu.c.compiler.category.optimization"
- id="gnu.c.compiler.option.optimization.level"
- valueType="enumerated">
+ valueType="enumerated"
+ id="gnu.c.compiler.option.optimization.level">
<enumeratedOptionValue
name="%Option.Posix.Optimize.None"
isDefault="false"
@@ -480,8 +480,8 @@
<option
name="%Option.Posix.Optimize.Flags"
category="gnu.c.compiler.category.optimization"
- id="gnu.c.compiler.option.optimization.flags"
- valueType="string">
+ valueType="string"
+ id="gnu.c.compiler.option.optimization.flags">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -491,8 +491,8 @@
<option
name="%Option.Posix.DebugLevel"
category="gnu.c.compiler.category.debug"
- id="gnu.c.compiler.option.debugging.level"
- valueType="enumerated">
+ valueType="enumerated"
+ id="gnu.c.compiler.option.debugging.level">
<enumeratedOptionValue
name="%Option.Posix.Debug.None"
isDefault="false"
@@ -519,24 +519,24 @@
<option
name="%Option.Posix.Debug.Other"
category="gnu.c.compiler.category.debug"
- id="gnu.c.compiler.option.debugging.other"
- valueType="string">
+ valueType="string"
+ id="gnu.c.compiler.option.debugging.other">
</option>
<option
defaultValue="false"
name="%Option.Posix.Debug.gprof"
category="gnu.c.compiler.category.debug"
command="-pg"
- id="gnu.c.compiler.option.debugging.gprof"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.debugging.gprof">
</option>
<option
defaultValue="false"
name="%Option.Posix.Debug.prof"
category="gnu.c.compiler.category.debug"
command="-p"
- id="gnu.c.compiler.option.debugging.prof"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.debugging.prof">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -548,48 +548,48 @@
name="%Option.Posix.Warn.Syntax"
category="gnu.c.compiler.category.warnings"
command="-fsyntax-only"
- id="gnu.c.compiler.option.warnings.syntax"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.warnings.syntax">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.Pedandic"
category="gnu.c.compiler.category.warnings"
command="-pedantic"
- id="gnu.c.compiler.option.warnings.pedantic"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.warnings.pedantic">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.PedErrors"
category="gnu.c.compiler.category.warnings"
command="-pedantic-errors"
- id="gnu.c.compiler.option.warnings.pedantic.error"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.warnings.pedantic.error">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.nowarn"
category="gnu.c.compiler.category.warnings"
command="-w"
- id="gnu.c.compiler.option.warnings.nowarn"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.warnings.nowarn">
</option>
<option
defaultValue="true"
name="%Option.Posix.Warn.allwarn"
category="gnu.c.compiler.category.warnings"
command="-Wall"
- id="gnu.c.compiler.option.warnings.allwarn"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.warnings.allwarn">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.toerrs"
category="gnu.c.compiler.category.warnings"
command="-Werror"
- id="gnu.c.compiler.option.warnings.toerrors"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.warnings.toerrors">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
@@ -600,34 +600,34 @@
defaultValue="-c -fmessage-length=0"
name="%Option.OtherFlags"
category="gnu.c.compiler.category.other"
- id="gnu.c.compiler.option.misc.other"
- valueType="string">
+ valueType="string"
+ id="gnu.c.compiler.option.misc.other">
</option>
<option
defaultValue="false"
name="%Option.Posix.Verbose"
category="gnu.c.compiler.category.other"
command="-v"
- id="gnu.c.compiler.option.misc.verbose"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.misc.verbose">
</option>
<option
defaultValue="false"
name="%Option.Posix.Ansi"
category="gnu.c.compiler.category.other"
command="-ansi"
- id="gnu.c.compiler.option.misc.ansi"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.c.compiler.option.misc.ansi">
</option>
</tool>
<tool
natureFilter="ccnature"
- sources="c,C,cc,cxx,cpp"
name="%ToolName.compiler.gnu.cpp"
+ sources="c,C,cc,cxx,cpp"
headerExtensions="h,H,hpp"
outputFlag="-o"
- outputs="o"
command="g++"
+ outputs="o"
id="cdt.managedbuild.tool.gnu.cpp.compiler">
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
@@ -639,30 +639,30 @@
name="%Option.Posix.Nostdinc"
category="gnu.cpp.compiler.category.preprocessor"
command="-nostdinc"
- id="gnu.cpp.compiler.option.preprocessor.nostdinc"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.preprocessor.nostdinc">
</option>
<option
defaultValue="false"
name="%Option.Posix.PreprocOnly"
category="gnu.cpp.compiler.category.preprocessor"
command="-E"
- id="gnu.cpp.compiler.option.preprocessor.preprocess"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.preprocessor.preprocess">
</option>
<option
name="%Option.Posix.DefSym"
category="gnu.cpp.compiler.category.preprocessor"
command="-D"
- id="gnu.cpp.compiler.option.preprocessor.def"
- valueType="definedSymbols">
+ valueType="definedSymbols"
+ id="gnu.cpp.compiler.option.preprocessor.def">
</option>
<option
name="%Option.Posix.UndefSym"
category="gnu.cpp.compiler.category.preprocessor"
command="-U"
- id="gnu.cpp.compiler.option.preprocessor.undef"
- valueType="stringList">
+ valueType="stringList"
+ id="gnu.cpp.compiler.option.preprocessor.undef">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
@@ -673,9 +673,9 @@
name="%Option.Posix.InclPaths"
category="gnu.cpp.compiler.category.dirs"
command="-I"
- id="gnu.cpp.compiler.option.include.paths"
+ browseType="directory"
valueType="includePath"
- browseType="directory">
+ id="gnu.cpp.compiler.option.include.paths">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
@@ -685,8 +685,8 @@
<option
name="%Option.Posix.OptLevel"
category="gnu.cpp.compiler.category.optimization"
- id="gnu.cpp.compiler.option.optimization.level"
- valueType="enumerated">
+ valueType="enumerated"
+ id="gnu.cpp.compiler.option.optimization.level">
<enumeratedOptionValue
name="%Option.Posix.Optimize.None"
command="-O0"
@@ -712,8 +712,8 @@
<option
name="%Option.Posix.Optimize.Flags"
category="gnu.cpp.compiler.category.optimization"
- id="gnu.cpp.compiler.option.optimization.flags"
- valueType="string">
+ valueType="string"
+ id="gnu.cpp.compiler.option.optimization.flags">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
@@ -723,8 +723,8 @@
<option
name="%Option.Posix.DebugLevel"
category="gnu.cpp.compiler.category.debug"
- id="gnu.cpp.compiler.option.debugging.level"
- valueType="enumerated">
+ valueType="enumerated"
+ id="gnu.cpp.compiler.option.debugging.level">
<enumeratedOptionValue
name="%Option.Posix.Debug.None"
isDefault="false"
@@ -751,24 +751,24 @@
<option
name="%Option.Posix.Debug.Other"
category="gnu.cpp.compiler.category.debug"
- id="gnu.cpp.compiler.option.debugging.other"
- valueType="string">
+ valueType="string"
+ id="gnu.cpp.compiler.option.debugging.other">
</option>
<option
defaultValue="false"
name="%Option.Posix.Debug.prof"
category="gnu.cpp.compiler.category.debug"
command="-p"
- id="gnu.cpp.compiler.option.debugging.prof"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.debugging.prof">
</option>
<option
defaultValue="false"
name="%Option.Posix.Debug.gprof"
category="gnu.cpp.compiler.category.debug"
command="-pg"
- id="gnu.cpp.compiler.option.debugging.gprof"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.debugging.gprof">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
@@ -780,48 +780,48 @@
name="%Option.Posix.Warn.Syntax"
category="gnu.cpp.compiler.category.warnings"
command="-fsyntax-only"
- id="gnu.cpp.compiler.option.warnings.syntax"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.warnings.syntax">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.Pedandic"
category="gnu.cpp.compiler.category.warnings"
command="-pedantic"
- id="gnu.cpp.compiler.option.warnings.pedantic"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.warnings.pedantic">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.PedErrors"
category="gnu.cpp.compiler.category.warnings"
command="-pedantic-errors"
- id="gnu.cpp.compiler.option.warnings.pedantic.error"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.warnings.pedantic.error">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.nowarn"
category="gnu.cpp.compiler.category.warnings"
command="-w"
- id="gnu.cpp.compiler.option.warnings.nowarn"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.warnings.nowarn">
</option>
<option
defaultValue="true"
name="%Option.Posix.Warn.allwarn"
category="gnu.cpp.compiler.category.warnings"
command="-Wall"
- id="gnu.cpp.compiler.option.warnings.allwarn"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.warnings.allwarn">
</option>
<option
defaultValue="false"
name="%Option.Posix.Warn.toerrs"
category="gnu.cpp.compiler.category.warnings"
command="-Werror"
- id="gnu.cpp.compiler.option.warnings.toerrors"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.warnings.toerrors">
</option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
@@ -832,16 +832,16 @@
defaultValue="-c -fmessage-length=0"
name="%Option.OtherFlags"
category="gnu.cpp.compiler.category.other"
- id="gnu.cpp.compiler.option.other.other"
- valueType="string">
+ valueType="string"
+ id="gnu.cpp.compiler.option.other.other">
</option>
<option
defaultValue="false"
name="%Option.Posix.Verbose"
category="gnu.cpp.compiler.category.other"
command="-v"
- id="gnu.cpp.compiler.option.other.verbose"
- valueType="boolean">
+ valueType="boolean"
+ id="gnu.cpp.compiler.option.other.verbose">
</option>
</tool>
</target>
@@ -849,6 +849,7 @@
isTest="false"
osList="solaris,linux,hpux,aix,macosx,qnx"
name="%TargetName.gnu.exe"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
parent="cdt.managedbuild.target.gnu"
isAbstract="false"
id="cdt.managedbuild.target.gnu.exe">
@@ -915,6 +916,7 @@
isTest="false"
osList="solaris,linux,hpux,aix,macosx,qnx"
name="%TargetName.gnu.so"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
parent="cdt.managedbuild.target.gnu"
defaultExtension="so"
isAbstract="false"
@@ -972,13 +974,13 @@
</toolReference>
</configuration>
<toolReference
- outputs="so"
outputPrefix="lib"
+ outputs="so"
id="cdt.managedbuild.tool.gnu.c.linker">
</toolReference>
<toolReference
- outputs="so"
outputPrefix="lib"
+ outputs="so"
id="cdt.managedbuild.tool.gnu.cpp.linker">
</toolReference>
</target>
@@ -986,6 +988,7 @@
isTest="false"
osList="solaris,linux,hpux,aix,macosx,qnx"
name="%TargetName.gnu.lib"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
parent="cdt.managedbuild.target.gnu"
defaultExtension="a"
isAbstract="false"
@@ -1043,20 +1046,21 @@
</toolReference>
</configuration>
<toolReference
- outputs="a"
outputPrefix="lib"
+ outputs="a"
id="cdt.managedbuild.tool.gnu.archiver">
</toolReference>
</target>
<target
- isTest="false"
- osList="win32"
name="%TargetName.cygw.exe"
- parent="cdt.managedbuild.target.gnu"
- binaryParser="org.eclipse.cdt.core.PE"
+ id="cdt.managedbuild.target.gnu.cygwin.exe"
+ isTest="false"
defaultExtension="exe"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultCygwinScannerInfoCollector"
isAbstract="false"
- id="cdt.managedbuild.target.gnu.cygwin.exe">
+ binaryParser="org.eclipse.cdt.core.PE"
+ parent="cdt.managedbuild.target.gnu"
+ osList="win32">
<configuration
name="%ConfigName.Dbg"
id="cdt.managedbuild.config.gnu.cygwin.exe.debug">
@@ -1119,14 +1123,15 @@
</toolReference>
</target>
<target
- isTest="false"
- osList="win32"
name="%TargetName.cygw.so"
- binaryParser="org.eclipse.cdt.core.PE"
- parent="cdt.managedbuild.target.gnu"
+ id="cdt.managedbuild.target.gnu.cygwin.so"
+ isTest="false"
defaultExtension="a.dll"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultCygwinScannerInfoCollector"
isAbstract="false"
- id="cdt.managedbuild.target.gnu.cygwin.so">
+ binaryParser="org.eclipse.cdt.core.PE"
+ parent="cdt.managedbuild.target.gnu"
+ osList="win32">
<configuration
name="%ConfigName.Dbg"
id="cdt.managedbuild.config.gnu.cygwin.so.debug">
@@ -1189,14 +1194,15 @@
</toolReference>
</target>
<target
- isTest="false"
- osList="win32"
name="%TargetName.cygw.lib"
- parent="cdt.managedbuild.target.gnu"
- binaryParser="org.eclipse.cdt.core.PE"
+ id="cdt.managedbuild.target.gnu.cygwin.lib"
+ isTest="false"
defaultExtension="a"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultCygwinScannerInfoCollector"
isAbstract="false"
- id="cdt.managedbuild.target.gnu.cygwin.lib">
+ binaryParser="org.eclipse.cdt.core.PE"
+ parent="cdt.managedbuild.target.gnu"
+ osList="win32">
<configuration
name="%ConfigName.Dbg"
id="cdt.managedbuild.config.gnu.cygwin.lib.debug">
@@ -1250,8 +1256,8 @@
</toolReference>
</configuration>
<toolReference
- outputPrefix="lib"
outputs="a"
+ outputPrefix="lib"
id="cdt.managedbuild.tool.gnu.archiver">
</toolReference>
</target>
@@ -1260,6 +1266,7 @@
id="cdt.managedbuild.target.gnu.mingw.exe"
isTest="false"
defaultExtension="exe"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultMinGWScannerInfoCollector"
isAbstract="false"
makeCommand="mingw32-make"
binaryParser="org.eclipse.cdt.core.PE"
@@ -1331,6 +1338,7 @@
id="cdt.managedbuild.target.gnu.mingw.so"
isTest="false"
defaultExtension="dll"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultMinGWScannerInfoCollector"
isAbstract="false"
makeCommand="mingw32-make"
binaryParser="org.eclipse.cdt.core.PE"
@@ -1402,6 +1410,7 @@
id="cdt.managedbuild.target.gnu.mingw.lib"
isTest="false"
defaultExtension="lib"
+ scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultMinGWScannerInfoCollector"
isAbstract="false"
makeCommand="mingw32-make"
binaryParser="org.eclipse.cdt.core.PE"
@@ -1460,8 +1469,8 @@
</toolReference>
</configuration>
<toolReference
- outputPrefix="lib"
outputs="lib"
+ outputPrefix="lib"
id="cdt.managedbuild.tool.gnu.archiver">
</toolReference>
</target>
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControl.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControl.java
index 47d4857d6ef..cbd48733cb9 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControl.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/FileListControl.java
@@ -74,8 +74,7 @@ public class FileListControl {
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
if (type != IOption.BROWSE_NONE) {
- final Button browse = createButton(parent, 3, ManagedBuilderUIPlugin.getResourceString(BROWSE), true);
- getOkButton().setFocus();
+ final Button browse = createButton(parent, 3, ManagedBuilderUIPlugin.getResourceString(BROWSE), false);
browse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent ev) {
String currentName;
@@ -90,8 +89,6 @@ public class FileListControl {
result = dialog.open();
if(result != null) {
getText().setText(result);
- // Give the OK button focus
- getOkButton().setFocus();
}
break;
case IOption.BROWSE_FILE:
@@ -103,8 +100,6 @@ public class FileListControl {
result = browseDialog.open();
if (result != null) {
getText().setText(result);
- // Give the OK button focus
- getOkButton().setFocus();
}
break;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
index f89b3d85be2..33fad728288 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
@@ -11,9 +11,10 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
* IBM Rational Software - Initial API and implementation
* **********************************************************************/
+import org.eclipse.cdt.managedbuilder.internal.ui.ErrorParserBlock;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock;
-import org.eclipse.cdt.managedbuilder.internal.ui.ErrorParserBlock;
+import org.eclipse.cdt.ui.dialogs.IndexerBlock;
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
@@ -22,11 +23,14 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Preferences;
public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
+
public class ManagedWizardOptionBlock extends ManagedProjectOptionBlock {
NewManagedProjectOptionPage parent;
ErrorParserBlock errorParsers;
+ IndexerBlock indexBlock;
+
public ManagedWizardOptionBlock(NewManagedProjectOptionPage parentPage) {
super(parentPage);
@@ -47,6 +51,7 @@ public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
addTab(new ReferenceBlock());
errorParsers = new ErrorParserBlock();
addTab(errorParsers);
+ addTab(indexBlock = new IndexerBlock());
}
}
@@ -87,4 +92,6 @@ public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
// Update the error parser list
optionBlock.updateTargetProperties();
}
+
+
}

Back to the top