Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core.tests/ChangeLog6
-rw-r--r--core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java165
-rw-r--r--core/org.eclipse.cdt.core.tests/plugin.xml27
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog19
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IManagedBuildPathInfo.java32
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java59
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java43
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java16
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java85
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java55
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java59
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java22
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java18
-rw-r--r--core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd8
-rw-r--r--core/org.eclipse.cdt.ui.tests/ChangeLog3
-rw-r--r--core/org.eclipse.cdt.ui.tests/plugin.xml103
-rw-r--r--core/org.eclipse.cdt.ui/ChangeLog16
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java38
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java51
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java3
-rw-r--r--core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gifbin0 -> 171 bytes
-rw-r--r--core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gifbin0 -> 211 bytes
-rw-r--r--core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gifbin0 -> 416 bytes
-rw-r--r--core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gifbin0 -> 425 bytes
-rw-r--r--core/org.eclipse.cdt.ui/plugin.xml8
25 files changed, 608 insertions, 228 deletions
diff --git a/core/org.eclipse.cdt.core.tests/ChangeLog b/core/org.eclipse.cdt.core.tests/ChangeLog
index 31381fb784..35fc8a774b 100644
--- a/core/org.eclipse.cdt.core.tests/ChangeLog
+++ b/core/org.eclipse.cdt.core.tests/ChangeLog
@@ -2,6 +2,12 @@
Added MacroTests.java (invocation in AllCoreTests).
Added MacroTests.c to resources.
+2003-06-17 Sean Evoy
+ Moved the ManagedBuildInfo extension point from the plugin file in org.eclipse.cdt.ui.tests
+ Added new options to sub target for include paths and preprocessor symbols
+ Added test for IManagedBuildPathInfo
+ * build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
+
2003-06-17 Brent Nicolle
Added Interface tests of IStructure.java.
diff --git a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java b/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
index 21b46572e3..78bdf4e4af 100644
--- a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
+++ b/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
@@ -19,6 +19,7 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.core.build.managed.BuildException;
import org.eclipse.cdt.core.build.managed.IConfiguration;
+import org.eclipse.cdt.core.build.managed.IManagedBuildPathInfo;
import org.eclipse.cdt.core.build.managed.IOption;
import org.eclipse.cdt.core.build.managed.IOptionCategory;
import org.eclipse.cdt.core.build.managed.IResourceBuildInfo;
@@ -56,6 +57,7 @@ public class AllBuildTests extends TestCase {
suite.addTest(new AllBuildTests("testProject"));
suite.addTest(new AllBuildTests("testConfigurations"));
suite.addTest(new AllBuildTests("testTargetArtifacts"));
+ suite.addTest(new AllBuildTests("testBuildPathInfoInterface"));
suite.addTest(new AllBuildTests("cleanup"));
return suite;
@@ -90,6 +92,88 @@ public class AllBuildTests extends TestCase {
}
/**
+ * The purpose of this test is to exercise the build path info interface.
+ * To get to that point, a new target/config has to be created in the test
+ * project and the default configuration changed.
+ *
+ * @throws CoreException
+ */
+ public void testBuildPathInfoInterface(){
+ // Open the test project
+ IProject project = null;
+ try {
+ project = createProject(projectName);
+ } catch (CoreException e) {
+ fail("Failed to open project: " + e.getLocalizedMessage());
+ }
+
+ // Create a new target in the project based on the sub target
+ ITarget baseTarget = ManagedBuildManager.getTarget(project, "test.sub");
+ assertNotNull(baseTarget);
+ ITarget newTarget = null;
+ try {
+ newTarget = ManagedBuildManager.createTarget(project, baseTarget);
+ } catch (BuildException e) {
+ fail("Failed adding new target to project: " + e.getLocalizedMessage());
+ }
+ assertNotNull(newTarget);
+ // Copy over the configs
+ IConfiguration[] baseConfigs = baseTarget.getConfigurations();
+ for (int i = 0; i < baseConfigs.length; ++i) {
+ newTarget.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i);
+ }
+
+ // Change the default configuration to the sub config
+ IConfiguration[] configs = newTarget.getConfigurations();
+ assertEquals(3, configs.length);
+ IResourceBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
+ buildInfo.setDefaultConfiguration(newTarget.getConfiguration("sub.config.2"));
+ // Get the path information for the project
+ IManagedBuildPathInfo info = ManagedBuildManager.getBuildPathInfo(project);
+ assertNotNull(info);
+
+ // Test the interface for include paths. It is important that the build model
+ // return the contents of all options flagged as containing include paths
+ String[] expectedPaths = {"/usr/include", "/opt/gnome/include", "/home/tester/include"};
+ String[] actualPaths = info.getIncludePaths();
+ assertTrue(Arrays.equals(expectedPaths, actualPaths));
+
+ // Test the interface for defined symbols (there are none but it should not return null)
+ String[] definedSymbols = info.getDefinedSymbols();
+ assertNotNull(definedSymbols);
+ assertEquals(0, definedSymbols.length);
+
+ // Add some defined symbols programmatically
+ String[] expectedSymbols = {"DEBUG", "GNOME"};
+ IConfiguration defaultConfig = buildInfo.getDefaultConfiguration(newTarget);
+ ITool[] tools = defaultConfig.getTools();
+ ITool subTool = null;
+ for (int i = 0; i < tools.length; i++) {
+ ITool tool = tools[i];
+ if("tool.sub".equalsIgnoreCase(tool.getId())) {
+ subTool = tool;
+ break;
+ }
+ }
+ assertNotNull(subTool);
+ IOption symbolOpt = null;
+ IOption[] opts = subTool.getOptions();
+ for (int i = 0; i < opts.length; i++) {
+ IOption option = opts[i];
+ if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
+ symbolOpt = option;
+ break;
+ }
+ }
+ assertNotNull(symbolOpt);
+ ManagedBuildManager.setOption(defaultConfig, symbolOpt, expectedSymbols);
+
+ // Retest
+ definedSymbols = info.getDefinedSymbols();
+ assertTrue(Arrays.equals(expectedSymbols, definedSymbols));
+ }
+
+ /**
* Create a new configuration based on one defined in the plugin file.
* Overrides all of the configuration settings. Saves, closes, and reopens
* the project. Then calls a method to check the overridden options.
@@ -145,9 +229,18 @@ public class AllBuildTests extends TestCase {
checkOptionReferences(project);
}
- public void testProject() throws CoreException, BuildException {
+ /**
+ * @throws CoreException
+ * @throws BuildException
+ */
+ public void testProject() throws BuildException {
// Create new project
- IProject project = createProject(projectName);
+ IProject project = null;
+ try {
+ project = createProject(projectName);
+ } catch (CoreException e) {
+ fail("Test failed on project creation: " + e.getLocalizedMessage());
+ }
// There should not be any targets defined for this project yet
assertEquals(0, ManagedBuildManager.getTargets(project).length);
@@ -196,9 +289,17 @@ public class AllBuildTests extends TestCase {
// Save, close, reopen and test again
ManagedBuildManager.saveBuildInfo(project);
- project.close(null);
+ try {
+ project.close(null);
+ } catch (CoreException e) {
+ fail("Failed on project close: " + e.getLocalizedMessage());
+ }
ManagedBuildManager.removeBuildInfo(project);
- project.open(null);
+ try {
+ project.open(null);
+ } catch (CoreException e) {
+ fail("Failed on project open: " + e.getLocalizedMessage());
+ }
// Test that the default config was remembered
IResourceBuildInfo info = ManagedBuildManager.getBuildInfo(project);
@@ -213,7 +314,8 @@ public class AllBuildTests extends TestCase {
checkRootTarget(targets[0], "z");
// Now test the information the makefile builder needs
- checkBuildSettings(project);
+ checkBuildTestSettings(info);
+ ManagedBuildManager.removeBuildInfo(project);
}
/**
@@ -222,15 +324,13 @@ public class AllBuildTests extends TestCase {
*
* @param project
*/
- private void checkBuildSettings(IProject project) {
+ private void checkBuildTestSettings(IResourceBuildInfo info) {
String ext1 = "foo";
String ext2 = "bar";
String badExt = "cpp";
String expectedOutput = "toor";
String expectedCmd = "doIt";
- // Get that interface, Rover. Go get it. That's a good doggie! Good boy.
- IResourceBuildInfo info = ManagedBuildManager.getBuildInfo(project);
assertNotNull(info);
assertEquals(info.getBuildArtifactName(), "BuildTest.toor");
@@ -330,7 +430,9 @@ public class AllBuildTests extends TestCase {
assertEquals("-e2", rootOptions[3].getEnumCommand(selEnum));
}
-
+ /*
+ * Do a full sanity check on the root target.
+ */
private void checkRootTarget(ITarget target, String oicValue) throws BuildException {
// Target stuff
assertTrue(target.isTestTarget());
@@ -439,28 +541,58 @@ public class AllBuildTests extends TestCase {
assertEquals("-e2", options[1].getEnumCommand(valueList[1]));
}
- private void checkSubTarget(ITarget target) {
+ /*
+ * Do a sanity check on the values in the sub-target. Most of the
+ * sanity on the how build model entries are read is performed in
+ * the root target check, so these tests just verify that the the sub
+ * target properly inherits from its parent. For the new options
+ * in the sub target, the test does a sanity check just to be complete.
+ */
+ private void checkSubTarget(ITarget target) throws BuildException {
// Make sure this is a test target
assertTrue(target.isTestTarget());
// Make sure the build artifact extension is there
assertEquals(target.getDefaultExtension(), subExt);
- // Tools
+ // Get the tools for this target
ITool[] tools = target.getTools();
- // Root Tool
+ // Do we inherit properly from parent
ITool rootTool = tools[0];
assertEquals("Root Tool", rootTool.getName());
- // Sub Tool
+ // Now get the tool defined for this target
ITool subTool = tools[1];
assertEquals("Sub Tool", subTool.getName());
+ // Confirm that it has three options
+ IOption[] subOpts = subTool.getOptions();
+ assertEquals(3, subOpts.length);
- // Configs
+ // Do a sanity check on the options
+ assertEquals("Include Paths", subOpts[0].getName());
+ assertEquals(IOption.INCLUDE_PATH, subOpts[0].getValueType());
+ String[] incPath = subOpts[0].getIncludePaths();
+ assertEquals(2, incPath.length);
+ assertEquals("/usr/include", incPath[0]);
+ assertEquals("/opt/gnome/include", incPath[1]);
+ assertEquals("-I", subOpts[0].getCommand());
+ assertEquals("Defined Symbols", subOpts[1].getName());
+ assertEquals(IOption.PREPROCESSOR_SYMBOLS, subOpts[1].getValueType());
+ String[] defdSymbols = subOpts[1].getDefinedSymbols();
+ assertEquals(0, defdSymbols.length);
+ assertEquals("-D", subOpts[1].getCommand());
+ assertEquals("More Includes", subOpts[2].getName());
+ assertEquals(IOption.INCLUDE_PATH, subOpts[2].getValueType());
+ String[] moreIncPath = subOpts[2].getIncludePaths();
+ assertEquals(1, moreIncPath.length);
+ assertEquals("/home/tester/include", moreIncPath[0]);
+ assertEquals("-I", subOpts[2].getCommand());
+
+ // Get the configs for this target
IConfiguration[] configs = target.getConfigurations();
- // Root Config
+ // Check inheritance
IConfiguration rootConfig = configs[0];
assertEquals("Root Config", rootConfig.getName());
assertEquals("Root Override Config", configs[1].getName());
- // Sub Config
+ // Check the defined config for target
IConfiguration subConfig = configs[2];
assertEquals("Sub Config", subConfig.getName());
}
@@ -550,4 +682,5 @@ public class AllBuildTests extends TestCase {
public void testThatAlwaysFails() {
assertTrue(false);
}
+
}
diff --git a/core/org.eclipse.cdt.core.tests/plugin.xml b/core/org.eclipse.cdt.core.tests/plugin.xml
index 52623d5209..cc0eeb0b3f 100644
--- a/core/org.eclipse.cdt.core.tests/plugin.xml
+++ b/core/org.eclipse.cdt.core.tests/plugin.xml
@@ -121,6 +121,33 @@
<tool
name="Sub Tool"
id="tool.sub">
+ <option
+ name="Include Paths"
+ command="-I"
+ valueType="includePath"
+ id="sub.tool.opt.inc.paths">
+ <optionValue
+ value="/usr/include">
+ </optionValue>
+ <optionValue
+ value="/opt/gnome/include">
+ </optionValue>
+ </option>
+ <option
+ name="Defined Symbols"
+ command="-D"
+ valueType="definedSymbols"
+ id="sub.tool.opt.def.symbols">
+ </option>
+ <option
+ name="More Includes"
+ command="-I"
+ valueType="includePath"
+ id="sub.tool.opts.inc.paths.more">
+ <optionValue
+ value="/home/tester/include">
+ </optionValue>
+ </option>
</tool>
</target>
</extension>
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index a30856dc56..3a1c0193b9 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,3 +1,22 @@
+2003-06-20 Sean Evoy
+ Added two new value types to the ManagedBuildTools schema for include paths
+ and defined symbols.
+
+ Added interface so clients can query build model for include paths and
+ defined symbols
+ * build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java
+ * build/org/eclipse/cdt/core/build/managed/IManagedBuildPathInfo.java
+ * build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java
+
+ Changed code in build model to support these new value types
+ * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+ * build/org/eclipse/cdt/internal/core/build/managed/Option.java
+ * build/org/eclipse/cdt/core/build/managed/IOption.java
+ * build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
+ * build/org/eclipse/cdt/internal/core/build/managed/Tool.java
+ * build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
+
+
2003-06-19 Alain Magloire
* model/org/eclipse/cdt/internal/core/model/CModelManager.java:
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IManagedBuildPathInfo.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IManagedBuildPathInfo.java
new file mode 100644
index 0000000000..03fbcc20f1
--- /dev/null
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IManagedBuildPathInfo.java
@@ -0,0 +1,32 @@
+package org.eclipse.cdt.core.build.managed;
+
+/**********************************************************************
+ * 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 interface IManagedBuildPathInfo {
+ /**
+ * Answers a <code>String</code> array containing all the defined
+ * preprocessor symbols. If there are no defined symbols, the receiver
+ * will return an empty array, never <code>null</code>
+ *
+ * @return
+ */
+ public String[] getDefinedSymbols();
+
+ /**
+ * Answers a <code>String</code> array containing all the known include
+ * search paths. If there are no paths defined, the receiver will
+ * return an empty array, never <code>null</code>
+ *
+ * @return
+ */
+ public String[] getIncludePaths();
+}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
index 9543517ada..2e442ea3dd 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
@@ -14,24 +14,28 @@ package org.eclipse.cdt.core.build.managed;
*
*/
public interface IOption extends IBuildObject {
-
// Type for the value of the option
public static final int BOOLEAN = 0;
public static final int ENUMERATED = 1;
public static final int STRING = 2;
public static final int STRING_LIST = 3;
+ public static final int INCLUDE_PATH = 4;
+ public static final int PREPROCESSOR_SYMBOLS = 5;
/**
* If this option is defined as an enumeration, this function returns
* the list of possible values for that enum.
*
- * If this option is not defined as an enumeration, it returns null.
+ * If this option is not defined as an enumeration, it returns <code>null</code>.
* @return
*/
public String [] getApplicableValues();
/**
- * @return the value for a boolean option.
+ * Answers the value for a boolean option.
+ *
+ * @return
+ * @throws BuildException
*/
public boolean getBooleanValue() throws BuildException;
@@ -43,45 +47,64 @@ public interface IOption extends IBuildObject {
public IOptionCategory getCategory();
/**
- * @return a String containing the actual command line option
- * associated with the <code>IOption</code>
+ * Answers a <code>String</code> containing the actual command line
+ * option associated with the option
+ *
+ * @return
*/
public String getCommand();
/**
- * @return <code>String</code> containing the command associated with the
- * enumeration name.
+ * @return
+ * @throws BuildException
*/
- public String getEnumCommand (String name);
-
+ public String[] getDefinedSymbols() throws BuildException;
+
/**
- * Returns the name of this option.
- *
- * @return
+ * Answers the command associated with the enumeration name. For
+ * example, if the enumeration name was 'Default' for the debug
+ * level option of the Gnu compiler, and the plugin manifest defined
+ * that as -g, then the return value would be a String containing "-g"
+ *
+ * @return
*/
- public String getName();
-
+ public String getEnumCommand (String name);
+
/**
- * Returns the current value for this option if it is a List of Strings.
+ * Answers an array of <code>String</code> containing the includes paths
+ * defined in the build model.
*
* @return
+ * @throws BuildException
*/
- public String [] getStringListValue() throws BuildException;
+ public String[] getIncludePaths() throws BuildException;
+
/**
- * @return a <code>String</code> containing the selected enumeration in an
+ * Answers a <code>String</code> containing the selected enumeration in an
* enumerated option. For an option that has not been changed by the user,
* the receiver will answer with the default defined in the plugin manifest.
* If the user has modified the selection, the receiver will answer with the
* overridden selection.
+ *
+ * @return
+ * @throws BuildException
*/
- public String getSelectedEnum ();
+ public String getSelectedEnum () throws BuildException;
+ /**
+ * Returns the current value for this option if it is a List of Strings.
+ *
+ * @return
+ * @throws BuildException
+ */
+ public String [] getStringListValue() throws BuildException;
/**
* Returns the current value for this option if it is a String
*
* @return
+ * @throws BuildException
*/
public String getStringValue() throws BuildException;
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java
index 7adb6cd147..8d261f0d54 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java
@@ -118,19 +118,28 @@ public class ManagedBuildManager {
}
}
-
+
+ /**
+ * Answers the result of a best-effort search to find a target with the
+ * specified ID, or <code>null</code> if one is not found.
+ *
+ * @param resource
+ * @param id
+ * @return
+ */
public static ITarget getTarget(IResource resource, String id) {
+ ITarget target = null;
+ // Check if the target is spec'd in the build info for the resource
if (resource != null) {
IResourceBuildInfo buildInfo = getBuildInfo(resource);
if (buildInfo != null)
- return buildInfo.getTarget(id);
+ target = buildInfo.getTarget(id);
}
-
- ITarget target = (ITarget)getExtensionTargetMap().get(id);
- if (target != null)
- return target;
-
- return null;
+ // OK, check the extension map
+ if (target == null) {
+ target = (ITarget)getExtensionTargetMap().get(id);
+ }
+ return target;
}
/**
@@ -329,7 +338,7 @@ public class ManagedBuildManager {
return buildInfo;
}
- public static IResourceBuildInfo getBuildInfo(IResource resource, boolean create) {
+ private static ResourceBuildInfo findBuildInfo(IResource resource, boolean create) {
// Make sure the extension information is loaded first
loadExtensions();
ResourceBuildInfo buildInfo = null;
@@ -354,9 +363,23 @@ public class ManagedBuildManager {
return buildInfo;
}
+ public static IResourceBuildInfo getBuildInfo(IResource resource, boolean create) {
+ return (IResourceBuildInfo) findBuildInfo(resource, create);
+ }
+
public static IResourceBuildInfo getBuildInfo(IResource resource) {
- return getBuildInfo(resource, false);
+ return (IResourceBuildInfo) findBuildInfo(resource, false);
}
+ /**
+ * Answers with an interface to the parse information that has been
+ * associated with the resource specified in the argument.
+ *
+ * @param resource
+ * @return
+ */
+ public static IManagedBuildPathInfo getBuildPathInfo(IResource resource) {
+ return (IManagedBuildPathInfo) getBuildInfo(resource, false);
+ }
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
index 1369bb6a94..45af3a8f52 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
@@ -272,7 +272,21 @@ public class Configuration extends BuildObject implements IConfiguration {
*/
public void setOption(IOption option, String[] value) throws BuildException {
// Is there a delta
- String[] oldValue = option.getStringListValue();
+ String[] oldValue;
+ switch (option.getValueType()) {
+ case IOption.STRING_LIST :
+ oldValue = option.getStringListValue();
+ break;
+ case IOption.INCLUDE_PATH :
+ oldValue = option.getIncludePaths();
+ break;
+ case IOption.PREPROCESSOR_SYMBOLS :
+ oldValue = option.getDefinedSymbols();
+ break;
+ default :
+ oldValue = new String[0];
+ break;
+ }
if(!Arrays.equals(value, oldValue))
createOptionReference(option).setValue(value);
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
index ccc5876d10..d9209a9c2a 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
@@ -36,7 +36,7 @@ public class Option extends BuildObject implements IOption {
private String defaultEnumName;
private String command;
- private static final String[] emptyStrings = new String[0];
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
private static final String EMPTY_STRING = new String();
public Option(ITool tool) {
@@ -46,24 +46,24 @@ public class Option extends BuildObject implements IOption {
public Option(Tool tool, IConfigurationElement element) {
this(tool);
- // id
+ // Get the unique id of the option
setId(element.getAttribute("id"));
- // hook me up
+ // Hook me up to a tool
tool.addOption(this);
- // name
+ // Get the option Name (this is what the user will see in the UI)
setName(element.getAttribute("name"));
- // category
+ // Options can be grouped into categories
String categoryId = element.getAttribute("category");
if (categoryId != null)
setCategory(tool.getOptionCategory(categoryId));
- // command
+ // Get the command defined for the option
command = element.getAttribute("command");
- // valueType
+ // Options hold different types of values
String valueTypeStr = element.getAttribute("valueType");
if (valueTypeStr == null)
valueType = -1;
@@ -73,10 +73,14 @@ public class Option extends BuildObject implements IOption {
valueType = IOption.STRING_LIST;
else if (valueTypeStr.equals("boolean"))
valueType = IOption.BOOLEAN;
- else
+ else if (valueTypeStr.equals("enumerated"))
valueType = IOption.ENUMERATED;
+ else if (valueTypeStr.equals("includePath"))
+ valueType = IOption.INCLUDE_PATH;
+ else
+ valueType = IOption.PREPROCESSOR_SYMBOLS;
- // value
+ // Now get the actual value
enumCommands = new HashMap();
switch (valueType) {
case IOption.BOOLEAN:
@@ -103,6 +107,8 @@ public class Option extends BuildObject implements IOption {
value = enumList;
break;
case IOption.STRING_LIST:
+ case IOption.INCLUDE_PATH:
+ case IOption.PREPROCESSOR_SYMBOLS:
List valueList = new ArrayList();
IConfigurationElement[] valueElements = element.getChildren("optionValue");
for (int i = 0; i < valueElements.length; ++i) {
@@ -122,7 +128,7 @@ public class Option extends BuildObject implements IOption {
List enumValues = (List)value;
return enumValues != null
? (String[])enumValues.toArray(new String[enumValues.size()])
- : emptyStrings;
+ : EMPTY_STRING_ARRAY;
}
public boolean getBooleanValue() {
@@ -145,36 +151,70 @@ public class Option extends BuildObject implements IOption {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
+ */
+ public String[] getDefinedSymbols() throws BuildException {
+ if (valueType != IOption.PREPROCESSOR_SYMBOLS) {
+ throw new BuildException("bad value type");
+ }
+ List v = (List)value;
+ return v != null
+ ? (String[])v.toArray(new String[v.size()])
+ : EMPTY_STRING_ARRAY;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
*/
public String getEnumCommand(String name) {
String cmd = (String) enumCommands.get(name);
- return (cmd == null ? new String() : cmd);
+ return cmd == null ? EMPTY_STRING : cmd;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getIncludePaths()
+ */
+ public String[] getIncludePaths() throws BuildException {
+ if (valueType != IOption.INCLUDE_PATH) {
+ throw new BuildException("bad value type");
+ }
+ List v = (List)value;
+ return v != null
+ ? (String[])v.toArray(new String[v.size()])
+ : EMPTY_STRING_ARRAY;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
*/
- public String getSelectedEnum() {
- return defaultEnumName;
+ public String getSelectedEnum() throws BuildException {
+ if (valueType != IOption.ENUMERATED) {
+ throw new BuildException("bad value type");
+ }
+ return defaultEnumName == null ? EMPTY_STRING : defaultEnumName;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
- public String[] getStringListValue() {
+ public String[] getStringListValue() throws BuildException {
+ if (valueType != IOption.STRING_LIST) {
+ throw new BuildException("bad value type");
+ }
List v = (List)value;
return v != null
? (String[])v.toArray(new String[v.size()])
- : emptyStrings;
+ : EMPTY_STRING_ARRAY;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringValue()
*/
- public String getStringValue() {
- String v = (String) value;
- return value == null ? EMPTY_STRING : v;
+ public String getStringValue() throws BuildException {
+ if (valueType != IOption.STRING) {
+ throw new BuildException("bad value type");
+ }
+ return value == null ? EMPTY_STRING : (String)value;
}
/* (non-Javadoc)
@@ -204,16 +244,15 @@ public class Option extends BuildObject implements IOption {
public IOption setValue(IConfiguration config, String value)
throws BuildException
{
- if (valueType != IOption.STRING)
+ if (valueType != IOption.STRING
+ || valueType != IOption.ENUMERATED)
throw new BuildException("Bad value for type");
if (config == null) {
this.value = value;
return this;
} else {
-
// Magic time
-
return null;
}
}
@@ -224,7 +263,9 @@ public class Option extends BuildObject implements IOption {
public IOption setValue(IConfiguration config, String[] value)
throws BuildException
{
- if (valueType != IOption.STRING_LIST)
+ if (valueType != IOption.STRING_LIST
+ || valueType != IOption.INCLUDE_PATH
+ || valueType != IOption.PREPROCESSOR_SYMBOLS)
throw new BuildException("Bad value for type");
if (config == null) {
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
index 66abdfc2df..0228a7408d 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
@@ -53,7 +53,7 @@ public class OptionReference implements IOption {
}
/**
- * Created from extension.
+ * Created from extension point.
*
* @param owner
* @param element
@@ -73,9 +73,15 @@ public class OptionReference implements IOption {
value = element.getAttribute("defaultValue");
break;
case IOption.ENUMERATED:
- value = option.getSelectedEnum();
+ try {
+ value = option.getSelectedEnum();
+ } catch (BuildException e) {
+ value = new String();
+ }
break;
case IOption.STRING_LIST:
+ case IOption.INCLUDE_PATH:
+ case IOption.PREPROCESSOR_SYMBOLS:
List valueList = new ArrayList();
IConfigurationElement[] valueElements = element.getChildren("optionValue");
for (int i = 0; i < valueElements.length; ++i) {
@@ -108,6 +114,8 @@ public class OptionReference implements IOption {
value = (String) element.getAttribute("defaultValue");
break;
case IOption.STRING_LIST:
+ case IOption.INCLUDE_PATH:
+ case IOption.PREPROCESSOR_SYMBOLS:
List valueList = new ArrayList();
NodeList nodes = element.getElementsByTagName("optionValue");
for (int i = 0; i < nodes.getLength(); ++i) {
@@ -141,6 +149,8 @@ public class OptionReference implements IOption {
element.setAttribute("defaultValue", (String)value);
break;
case IOption.STRING_LIST:
+ case IOption.INCLUDE_PATH:
+ case IOption.PREPROCESSOR_SYMBOLS:
ArrayList stringList = (ArrayList)value;
ListIterator iter = stringList.listIterator();
while (iter.hasNext()) {
@@ -174,6 +184,20 @@ public class OptionReference implements IOption {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
+ */
+ public String[] getDefinedSymbols() throws BuildException {
+ if (value == null)
+ return option.getDefinedSymbols();
+ else if (getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
+ ArrayList list = (ArrayList)value;
+ return (String[]) list.toArray(new String[list.size()]);
+ }
+ else
+ throw new BuildException("bad value type");
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
*/
public String getEnumCommand(String name) {
@@ -184,13 +208,29 @@ public class OptionReference implements IOption {
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
public String getId() {
+ // A reference has the same id as the option it references
return option.getId();
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getIncludePaths()
+ */
+ public String[] getIncludePaths() throws BuildException {
+ if (value == null)
+ return option.getIncludePaths();
+ else if (getValueType() == IOption.INCLUDE_PATH) {
+ ArrayList list = (ArrayList)value;
+ return (String[]) list.toArray(new String[list.size()]);
+ }
+ else
+ throw new BuildException("bad value type");
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
*/
public String getName() {
+ // A reference has the same name as the option it references
return option.getName();
}
@@ -212,13 +252,15 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
*/
- public String getSelectedEnum() {
+ public String getSelectedEnum() throws BuildException {
if (value == null) {
// Return the default defined for the enumeration in the manifest.
return option.getSelectedEnum();
- } else {
+ } else if (getValueType() == IOption.ENUMERATED) {
// Value will contain the human-readable name of the enum
return (String) value;
+ } else {
+ throw new BuildException("bad value type");
}
}
@@ -302,11 +344,14 @@ public class OptionReference implements IOption {
* @throws BuildException
*/
public void setValue(String [] value) throws BuildException {
- if (getValueType() == IOption.STRING_LIST) {
+ if (getValueType() == IOption.STRING_LIST
+ || getValueType() == IOption.INCLUDE_PATH
+ || getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
// Just replace what the option reference is holding onto
this.value = new ArrayList(Arrays.asList(value));
}
else
throw new BuildException("bad value type");
}
+
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java
index 82e3627c50..8cd236cbad 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java
@@ -12,13 +12,16 @@ package org.eclipse.cdt.internal.core.build.managed;
* **********************************************************************/
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.build.managed.BuildException;
+import org.eclipse.cdt.core.build.managed.IManagedBuildPathInfo;
import org.eclipse.cdt.core.build.managed.IConfiguration;
+import org.eclipse.cdt.core.build.managed.IOption;
import org.eclipse.cdt.core.build.managed.IResourceBuildInfo;
import org.eclipse.cdt.core.build.managed.ITarget;
import org.eclipse.cdt.core.build.managed.ITool;
@@ -27,7 +30,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-public class ResourceBuildInfo implements IResourceBuildInfo {
+public class ResourceBuildInfo implements IResourceBuildInfo, IManagedBuildPathInfo {
private IResource owner;
private Map targetMap;
@@ -273,4 +276,58 @@ public class ResourceBuildInfo implements IResourceBuildInfo {
defaultTarget = target;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IBuildParseInfo#getDefinedSymbols()
+ */
+ public String[] getDefinedSymbols() {
+ // Return the include paths for the default configuration
+ ArrayList paths = new ArrayList();
+ IConfiguration config = getDefaultConfiguration(getDefaultTarget());
+ ITool[] tools = config.getTools();
+ for (int i = 0; i < tools.length; i++) {
+ ITool tool = tools[i];
+ IOption[] opts = tool.getOptions();
+ for (int j = 0; j < opts.length; j++) {
+ IOption option = opts[j];
+ if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
+ try {
+ paths.addAll(Arrays.asList(option.getDefinedSymbols()));
+ } catch (BuildException e) {
+ // we should never get here
+ continue;
+ }
+ }
+ }
+ }
+ paths.trimToSize();
+ return (String[])paths.toArray(new String[paths.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IBuildParseInfo#getIncludePaths()
+ */
+ public String[] getIncludePaths() {
+ // Return the include paths for the default configuration
+ ArrayList paths = new ArrayList();
+ IConfiguration config = getDefaultConfiguration(getDefaultTarget());
+ ITool[] tools = config.getTools();
+ for (int i = 0; i < tools.length; i++) {
+ ITool tool = tools[i];
+ IOption[] opts = tool.getOptions();
+ for (int j = 0; j < opts.length; j++) {
+ IOption option = opts[j];
+ if (option.getValueType() == IOption.INCLUDE_PATH) {
+ try {
+ paths.addAll(Arrays.asList(option.getIncludePaths()));
+ } catch (BuildException e) {
+ // we should never get here
+ continue;
+ }
+ }
+ }
+ }
+ paths.trimToSize();
+ return (String[])paths.toArray(new String[paths.size()]);
+ }
+
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
index 713663b02e..38144dee07 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
@@ -233,14 +233,32 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
break;
case IOption.STRING_LIST :
- String cmd = option.getCommand();
+ String listCmd = option.getCommand();
String[] list = option.getStringListValue();
for (int j = 0; j < list.length; j++) {
String temp = list[j];
- buf.append(cmd + temp + WHITE_SPACE);
+ buf.append(listCmd + temp + WHITE_SPACE);
}
break;
+ case IOption.INCLUDE_PATH :
+ String incCmd = option.getCommand();
+ String[] paths = option.getIncludePaths();
+ for (int j = 0; j < paths.length; j++) {
+ String temp = paths[j];
+ buf.append(incCmd + temp + WHITE_SPACE);
+ }
+ break;
+
+ case IOption.PREPROCESSOR_SYMBOLS :
+ String defCmd = option.getCommand();
+ String[] symbols = option.getDefinedSymbols();
+ for (int j = 0; j < symbols.length; j++) {
+ String temp = symbols[j];
+ buf.append(defCmd + temp + WHITE_SPACE);
+ }
+ break;
+
default :
break;
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
index 57bbfb4808..c388d54088 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
@@ -168,6 +168,24 @@ public class ToolReference implements ITool {
}
break;
+ case IOption.INCLUDE_PATH :
+ String incCmd = option.getCommand();
+ String[] paths = option.getIncludePaths();
+ for (int j = 0; j < paths.length; j++) {
+ String temp = paths[j];
+ buf.append(incCmd + temp + WHITE_SPACE);
+ }
+ break;
+
+ case IOption.PREPROCESSOR_SYMBOLS :
+ String defCmd = option.getCommand();
+ String[] symbols = option.getDefinedSymbols();
+ for (int j = 0; j < symbols.length; j++) {
+ String temp = symbols[j];
+ buf.append(defCmd + temp + WHITE_SPACE);
+ }
+ break;
+
default :
break;
}
diff --git a/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd b/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
index fce56ce834..022f635c19 100644
--- a/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
+++ b/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
@@ -118,7 +118,9 @@
<attribute name="valueType" use="default" value="string">
<annotation>
<documentation>
- An option can be one of the following types; &apos;string&apos; for catch-all entries for options that cannot be easily defined any other way, &apos;string list&apos; for entries that consist of a list of values such as defined symbols or paths, &apos;boolean&apos; for options that have two values, and &apos;enumerated&apos; for options that are one-of a list of values.
+ General options can be one of the following types; &apos;string&apos; for catch-all entries for options that cannot be easily defined any other way, &apos;string list&apos; for entries that consist of a list of values such as defined symbols or paths, &apos;boolean&apos; for options that have two values, and &apos;enumerated&apos; for options that are one-of a list of values.
+
+Two additional types exist to flag options of special relevance to the build model; &apos;include&apos;, and &apos;definedSymbols&apos;. You can pre-populate with optionValues, and they will display in the UI the same way the &apos;StringList&apos; options do. The build model will look specifically for these value types when clients query for include paths and preprocessor defines.
</documentation>
</annotation>
<simpleType>
@@ -131,6 +133,10 @@
</enumeration>
<enumeration value="enumerated">
</enumeration>
+ <enumeration value="includePath">
+ </enumeration>
+ <enumeration value="definedSymbols">
+ </enumeration>
</restriction>
</simpleType>
</attribute>
diff --git a/core/org.eclipse.cdt.ui.tests/ChangeLog b/core/org.eclipse.cdt.ui.tests/ChangeLog
index 0f64ba36ff..f10cfa8fe1 100644
--- a/core/org.eclipse.cdt.ui.tests/ChangeLog
+++ b/core/org.eclipse.cdt.ui.tests/ChangeLog
@@ -1,3 +1,6 @@
+2003-06-20 Sean Evoy
+ Moved the ManagedBuildInfo extension point to the plugin file in org.eclipse.cdt.core.tests
+
2003-06-17 Brent Nicolle
Added Interface tests of IStructure.java.
diff --git a/core/org.eclipse.cdt.ui.tests/plugin.xml b/core/org.eclipse.cdt.ui.tests/plugin.xml
index eb64199269..69a13d4d06 100644
--- a/core/org.eclipse.cdt.ui.tests/plugin.xml
+++ b/core/org.eclipse.cdt.ui.tests/plugin.xml
@@ -22,107 +22,4 @@
</requires>
- <extension
- id="buildTest"
- name="Tools for Build Test"
- point="org.eclipse.cdt.core.ManagedBuildInfo">
- <target
- isTest="true"
- name="Test Root"
- defaultExtension="toor"
- isAbstract="false"
- id="test.root">
- <tool
- sources="foo,bar"
- name="Root Tool"
- outputs="toor"
- command="doIt"
- id="root.tool">
- <optionCategory
- owner="root.tool"
- name="Category"
- id="category">
- </optionCategory>
- <option
- name="List Option in Top"
- command="-L"
- valueType="stringList"
- id="list.option">
- <optionValue
- value="a">
- </optionValue>
- <optionValue
- value="b">
- </optionValue>
- </option>
- <option
- defaultValue="false"
- name="Boolean Option in Top"
- command="-b"
- valueType="boolean"
- id="boolean.option">
- </option>
- <option
- defaultValue="x"
- name="String Option in Category"
- category="category"
- valueType="string"
- id="string.option">
- </option>
- <option
- name="Enumerated Option in Category"
- category="category"
- valueType="enumerated"
- id="enumerated.option">
- <optionEnum
- name="Default Enum"
- isDefault="true"
- command="-e1"
- id="default.enum.option">
- </optionEnum>
- <optionEnum
- name="Another Enum"
- command="-e2"
- id="another.enum.option">
- </optionEnum>
- </option>
- </tool>
- <configuration
- name="Root Config"
- id="root.config">
- </configuration>
- <configuration
- name="Root Override Config"
- id="root.override.config">
- <toolRef
- id="root.tool">
- <optionRef
- defaultValue="y"
- id="string.option">
- </optionRef>
- <optionRef
- defaultValue="true"
- id="boolean.option">
- </optionRef>
- </toolRef>
- </configuration>
- </target>
- <target
- isTest="true"
- name="Test Sub"
- parent="test.root"
- defaultExtension="bus"
- isAbstract="false"
- id="test.sub">
- <configuration
- name="Sub Config"
- id="sub.config">
- </configuration>
- <tool
- name="Sub Tool"
- id="tool.sub">
- </tool>
- </target>
- </extension>
-
</plugin>
diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog
index 400fe948b9..1d3776710b 100644
--- a/core/org.eclipse.cdt.ui/ChangeLog
+++ b/core/org.eclipse.cdt.ui/ChangeLog
@@ -1,3 +1,19 @@
+2003-06-20 Sean Evoy
+ Added (again) the icons required for the new managed project wizard and property pages
+ * icons/full/build16/config-command.gif
+ * icons/full/build16/config-librarian.gif
+ * icons/full/build16/config-tool.gif
+ * icons/full/wizban/newmngc_app.gif
+ * icons/full/wizban/newmngcc_app.gif
+
+ Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=38665
+ * build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java
+
+ Adjusted the Option settings store and pages to properly handle new option types needed
+ to implement parser interface for include paths and defined symbols.
+ * build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
+ * build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java
+
2003-06-18 David Inglis
fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=39053
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
index 0e6a61a10e..9f916cd7d0 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
@@ -1,5 +1,6 @@
package org.eclipse.cdt.ui.build.properties;
+import org.eclipse.cdt.core.build.managed.BuildException;
import org.eclipse.cdt.core.build.managed.IConfiguration;
import org.eclipse.cdt.core.build.managed.IOption;
import org.eclipse.cdt.core.build.managed.IOptionCategory;
@@ -58,27 +59,36 @@ public class BuildToolSettingsPage extends FieldEditorPreferencePage {
// Figure out which type the option is and add a proper field editor for it
switch (opt.getValueType()) {
case IOption.STRING :
- StringFieldEditor stringField = new StringFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
- addField(stringField);
- break;
+ StringFieldEditor stringField = new StringFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
+ addField(stringField);
+ break;
case IOption.BOOLEAN :
- BooleanFieldEditor booleanField = new BooleanFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
- addField(booleanField);
- break;
+ BooleanFieldEditor booleanField = new BooleanFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
+ addField(booleanField);
+ break;
case IOption.ENUMERATED :
- BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(opt.getId(), opt.getName(), opt.getApplicableValues(), opt.getSelectedEnum(), getFieldEditorParent());
- addField(comboField);
- break;
+ String sel;
+ try {
+ sel = opt.getSelectedEnum();
+ } catch (BuildException e) {
+ // If we get this exception, then the option type is wrong
+ break;
+ }
+ BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(opt.getId(), opt.getName(), opt.getApplicableValues(), sel, getFieldEditorParent());
+ addField(comboField);
+ break;
case IOption.STRING_LIST :
- BuildOptionListFieldEditor listField = new BuildOptionListFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
- addField(listField);
- break;
+ case IOption.INCLUDE_PATH :
+ case IOption.PREPROCESSOR_SYMBOLS :
+ BuildOptionListFieldEditor listField = new BuildOptionListFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
+ addField(listField);
+ break;
// case IOption.SUMMARY :
// SummaryFieldEditor summaryField = new SummaryFieldEditor(opt.getId(), opt.getName(), category.getTool(), getFieldEditorParent());
// addField(summaryField);
// break;
default :
- break;
+ break;
}
}
}
@@ -117,6 +127,8 @@ public class BuildToolSettingsPage extends FieldEditorPreferencePage {
ManagedBuildManager.setOption(configuration, option, strVal);
break;
case IOption.STRING_LIST :
+ case IOption.INCLUDE_PATH :
+ case IOption.PREPROCESSOR_SYMBOLS :
String listStr = getPreferenceStore().getString(option.getId());
String[] listVal = BuildToolsSettingsStore.parseString(listStr);
ManagedBuildManager.setOption(configuration, option, listVal);
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java
index 31aa7e609a..67f3bc5ff6 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java
@@ -194,6 +194,7 @@ public class BuildToolsSettingsStore implements IPreferenceStore {
try {
value = new Boolean(opt.getBooleanValue());
} catch (BuildException e) {
+ // Exception occurs if there's an option value type mismatch
break;
}
optionMap.put(name, value);
@@ -207,7 +208,7 @@ public class BuildToolsSettingsStore implements IPreferenceStore {
case IOption.STRING :
try {
value = opt.getStringValue();
- } catch (BuildException e1) {
+ } catch (BuildException e) {
break;
}
optionMap.put(name, value);
@@ -216,7 +217,23 @@ public class BuildToolsSettingsStore implements IPreferenceStore {
case IOption.STRING_LIST :
try {
value = createList(opt.getStringListValue());
- } catch (BuildException e2) {
+ } catch (BuildException e) {
+ break;
+ }
+ optionMap.put(name, value);
+ break;
+ case IOption.INCLUDE_PATH :
+ try {
+ value = createList(opt.getIncludePaths());
+ } catch (BuildException e) {
+ break;
+ }
+ optionMap.put(name, value);
+ break;
+ case IOption.PREPROCESSOR_SYMBOLS :
+ try {
+ value = createList(opt.getDefinedSymbols());
+ } catch (BuildException e) {
break;
}
optionMap.put(name, value);
@@ -239,36 +256,6 @@ public class BuildToolsSettingsStore implements IPreferenceStore {
return (String)s;
}
return getDefaultString(name);
-
-// Object s = optionMap.get(name);
-// if (s instanceof IOption) {
-// IOption option = (IOption) s;
-// String [] values = null;
-// String list = null;
-// try {
-// switch (option.getValueType()) {
-// // Return the enumerated options in a semicolon-separated list
-// case IOption.ENUMERATED :
-// values = option.getApplicableValues();
-// list = createList(values);
-// break;
-// // Just return the string
-// case IOption.STRING :
-// list = option.getStringValue();
-// break;
-// // Return the list values in a semicolon-spearated string
-// case IOption.STRING_LIST :
-// values = option.getStringListValue();
-// list = createList(values);
-// default:
-// break;
-// }
-// } catch (BuildException e) {
-// return getDefaultString(name);
-// }
-// return list == null ? getDefaultString(name) : list;
-// }
-// return getDefaultString(name);
}
/**
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java
index 120811bc90..9a1f3f8a0d 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java
@@ -127,6 +127,9 @@ public class CProjectPlatformPage extends WizardPage {
}
});
+ // Select the first target in the list
+ handleTargetSelection();
+
// Do the nasty
setErrorMessage(null);
setMessage(null);
diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif
new file mode 100644
index 0000000000..f966fc39d9
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif
new file mode 100644
index 0000000000..0daf085c73
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif
new file mode 100644
index 0000000000..beefb8ee95
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif
new file mode 100644
index 0000000000..85e3f72d33
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index 43194461a8..f9055aa7a2 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -230,7 +230,7 @@
<!-- Managed Make Builder Projects -->
<wizard
name="%MngCCWizard.name"
- icon="icons/full/ctool16/newmngcc_app.gif"
+ icon="icons/full/wizban/newmngcc_app.gif"
category="org.eclipse.cdt.ui.newCCWizards"
class="org.eclipse.cdt.ui.build.wizards.ManagedCCWizard"
project="true"
@@ -242,7 +242,7 @@
</wizard>
<wizard
name="%MngCWizard.name"
- icon="icons/full/ctool16/newmngcc_app.gif"
+ icon="icons/full/wizban/newmngcc_app.gif"
category="org.eclipse.cdt.ui.newCWizards"
class="org.eclipse.cdt.ui.build.wizards.ManagedCWizard"
project="true"
@@ -625,7 +625,7 @@
name="Defined Symbols"
category="cygwin.compiler.category.preprocessor"
command="-D"
- valueType="stringList"
+ valueType="definedSymbols"
id="cygwin.preprocessor.def.symbols">
</option>
<option
@@ -706,7 +706,7 @@
name="Include Paths"
category="cygwin.compiler.category.general"
command="-I"
- valueType="stringList"
+ valueType="includePath"
id="cygwin.compiler.general.include.paths">
</option>
<option

Back to the top