[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Work in support of bug 43051
|
Hi All,
To help out with bug 43051, I have changed the behaviour of the managed
builder when asked for scanner information. The search feature needs the
absolute paths to files. Since all the user-specified include paths
specified in the managed builder UI are either absolute or relative to the
build project directory, it is relatively easy to convert everything to
absolute paths before answering the clients of this information. This
patch has been tested on Linux and Win32 and does not break the test suite
or the indexer.
Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/ChangeLog,v
retrieving revision 1.4
diff -u -r1.4 ChangeLog
--- ChangeLog 24 Sep 2003 14:20:40 -0000 1.4
+++ ChangeLog 24 Sep 2003 20:03:55 -0000
@@ -1,3 +1,12 @@
+2003-09-24 Sean Evoy
+ Changed the implementor of IScannerInfo to answer only absolute paths when asked for
+ includes paths. Users will specify the includes paths in the managed build UI in such a way
+ that the compiler will not complain. Either they will use absolute paths, or they will specify
+ them relative to the build directory. In the second case, it is easier for the managed builder
+ to convert the paths relative to this directory into absolute paths before replying tha it is for
+ the client to figure this out.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
+
2003-09-23 Sean Evoy
All the work in this patch is for critical bug 43292. In order to manage
configurations, there had to be a method through ITarget to remove
Index: src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java,v
retrieving revision 1.2
diff -u -r1.2 ManagedBuildInfo.java
--- src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java 16 Sep 2003 21:27:58 -0000 1.2
+++ src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java 24 Sep 2003 20:03:56 -0000
@@ -27,6 +27,8 @@
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -278,6 +280,7 @@
// Return the include paths for the default configuration
ArrayList paths = new ArrayList();
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
+ IPath root = owner.getLocation().addTrailingSeparator().append(config.getName());
ITool[] tools = config.getTools();
for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
@@ -288,8 +291,17 @@
try {
// Get all the built-in paths from the option
paths.addAll(Arrays.asList(option.getBuiltIns()));
- // Get all the user-defined paths from the option
- paths.addAll(Arrays.asList(option.getIncludePaths()));
+ // Get all the user-defined paths from the option as absolute paths
+ String[] userPaths = option.getIncludePaths();
+ for (int index = 0; index < userPaths.length; ++index) {
+ IPath userPath = new Path(userPaths[index]);
+ if (userPath.isAbsolute()) {
+ paths.add(userPath.toOSString());
+ } else {
+ IPath absPath = root.addTrailingSeparator().append(userPath);
+ paths.add(absPath.makeAbsolute().toOSString());
+ }
+ }
} catch (BuildException e) {
// we should never get here, but continue anyway
continue;
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.111
diff -u -r1.111 ChangeLog
--- ChangeLog 24 Sep 2003 17:26:38 -0000 1.111
+++ ChangeLog 24 Sep 2003 20:03:25 -0000
@@ -1,3 +1,9 @@
+2003-09-24 Sean Evoy
+ Changed the implementor of IScannerInfo to answer only absolute paths when asked for
+ includes paths. As a result, the managed builder test had to be updated to expect paths
+ in an OS-specific format.
+ * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
+
2003-09-24 John Camelon
Added testBug43375() to CompleteParseASTTest.
Moved testConditionalExpressionWithReferencesB_Bug43106 from failed tests to passed tests.
Index: build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java,v
retrieving revision 1.7
diff -u -r1.7 ManagedBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java 24 Sep 2003 14:20:44 -0000 1.7
+++ build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java 24 Sep 2003 20:03:26 -0000
@@ -42,6 +42,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
public class ManagedBuildTests extends TestCase {
private static final boolean boolVal = true;
@@ -153,7 +154,11 @@
*/
public void testScannerInfoInterface(){
// These are the expected path settings
- final String[] expectedPaths = {"/usr/gnu/include", "/usr/include", "/opt/gnome/include", "C:\\home\\tester/include"};
+ final String[] expectedPaths = new String[4];
+ expectedPaths[0] = (new Path("/usr/gnu/include")).toOSString();
+ expectedPaths[1] = (new Path("/usr/include")).toOSString();
+ expectedPaths[2] = (new Path("/opt/gnome/include")).toOSString();
+ expectedPaths[3] = (new Path("C:\\home\\tester/include")).toOSString();
// Open the test project
IProject project = null;