mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Patch for Sean Evoy:
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 commit is contained in:
parent
c7b323e4fb
commit
5f524fb890
4 changed files with 35 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -27,6 +27,8 @@ import org.eclipse.cdt.managedbuilder.core.ITarget;
|
|||
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 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
// 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 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
|||
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 class ManagedBuildTests extends TestCase {
|
|||
*/
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue