Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuild/core/tests/ManagedBuildCoreTests.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java27
2 files changed, 27 insertions, 10 deletions
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 cee7f06fb31..05af8f87225 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
@@ -848,6 +848,7 @@ public class ManagedBuildCoreTests extends TestCase {
String expectedCleanCmd = "del /myworld";
String expectedParserId = "org.eclipse.cdt.core.PE";
String[] expectedOSList = {"win32"};
+ String[] expectedArchList = {"all"};
assertTrue(target.isTestTarget());
if (target.getArtifactName().equals("ManagedBuildTest")) {
assertEquals(target.getArtifactExtension(), newExt);
@@ -858,6 +859,7 @@ public class ManagedBuildCoreTests extends TestCase {
assertEquals("make", target.getMakeCommand());
assertEquals(expectedParserId, target.getBinaryParserId());
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
+ assertTrue(Arrays.equals(expectedArchList, target.getTargetArchList()));
// This target defines no errors parsers.
assertNull(target.getErrorParserIds());
assertTrue(Arrays.equals(target.getErrorParserList(), CCorePlugin.getDefault().getAllErrorParsersIDs()));
@@ -1096,9 +1098,12 @@ public class ManagedBuildCoreTests extends TestCase {
assertEquals("nmake", target.getMakeCommand());
// Make sure we get the proper binary parser
assertEquals("org.eclipse.cdt.core.ELF", target.getBinaryParserId());
- // Make sure the list is inherited
+ // Make sure the os list is inherited
String[] expectedOSList = {"win32","linux","solaris"};
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
+ // Make sure the arch list is inherited
+ String[] expectedArchList = {"x86", "ppc"};
+ assertTrue(Arrays.equals(expectedArchList, target.getTargetArchList()));
// Get the 5 configurations (3 from test, 1 from test sub and 1 from this)
IConfiguration[] configs = target.getConfigurations();
@@ -1232,6 +1237,9 @@ public class ManagedBuildCoreTests extends TestCase {
assertEquals("org.eclipse.cdt.core.PE", target.getBinaryParserId());
String[] expectedOSList = {"win32","linux","solaris"};
assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList()));
+ // Make sure the list is overridden
+ String[] expectedArchList = {"x86", "ppc"};
+ assertTrue(Arrays.equals(expectedArchList, target.getTargetArchList()));
// Make sure this is a test target
assertTrue(target.isTestTarget());
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
index d02ee97bf90..ed6f7f0e69c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
@@ -112,26 +112,35 @@ public class Target extends BuildObject implements ITarget {
String os = element.getAttribute(OS_LIST);
if (os != null) {
targetOSList = new ArrayList();
- StringTokenizer tokens = new StringTokenizer(os, ","); //$NON-NLS-1$
- while (tokens.hasMoreTokens()) {
- targetOSList.add(tokens.nextToken().trim());
+ String[] osTokens = os.split(","); //$NON-NLS-1$
+ for (int i = 0; i < osTokens.length; ++i) {
+ targetOSList.add(osTokens[i].trim());
}
}
+ // Get the comma-separated list of valid Architectures
+ String arch = element.getAttribute(ARCH_LIST);
+ if (arch != null) {
+ targetArchList = new ArrayList();
+ String[] archTokens = arch.split(","); //$NON-NLS-1$
+ for (int j = 0; j < archTokens.length; ++j) {
+ targetArchList.add(archTokens[j].trim());
+ }
+ }
// Load any tool references we might have
IManagedConfigElement[] toolRefs = element.getChildren(IConfiguration.TOOLREF_ELEMENT_NAME);
- for (int i=0; i < toolRefs.length; ++i) {
- new ToolReference(this, toolRefs[i]);
+ for (int k = 0; k < toolRefs.length; ++k) {
+ new ToolReference(this, toolRefs[k]);
}
// Then load any tools defined for the target
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
- for (int j = 0; j < tools.length; ++j) {
- new Tool(this, tools[j]);
+ for (int m = 0; m < tools.length; ++m) {
+ new Tool(this, tools[m]);
}
// Then load the configurations which may have tool references
IManagedConfigElement[] configs = element.getChildren(IConfiguration.CONFIGURATION_ELEMENT_NAME);
- for (int k = 0; k < configs.length; ++k) {
- new Configuration(this, configs[k]);
+ for (int n = 0; n < configs.length; ++n) {
+ new Configuration(this, configs[n]);
}
}

Back to the top