From eb723acf8745c585c50c6b0e9abcbb5bfc6e4698 Mon Sep 17 00:00:00 2001 From: Vivian Kong Date: Wed, 4 May 2011 15:02:18 +0000 Subject: [PATCH] Bug 344646 - Use EFSExtensionManager to get project paths --- .../gnu/AbstractGCCBOPConsoleParserUtility.java | 5 +++-- .../META-INF/MANIFEST.MF | 1 + .../gnu/DefaultGCCDependencyCalculator2Commands.java | 10 +++++++--- .../makegen/gnu/GnuMakefileGenerator.java | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java index cf1bd496b26..c5948ee4d4b 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParserUtility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,6 +16,7 @@ import java.util.Vector; import org.eclipse.cdt.core.IMarkerGenerator; import org.eclipse.cdt.core.ProblemMarkerInfo; +import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; @@ -41,7 +42,7 @@ public abstract class AbstractGCCBOPConsoleParserUtility { fDirectoryStack = new Vector(); fErrors = new ArrayList(); this.project = project; - fBaseDirectory = project.getLocation(); + fBaseDirectory = new Path(EFSExtensionManager.getDefault().getPathFromURI(project.getLocationURI())); if (workingDirectory != null) { pushDirectory(workingDirectory); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF index c42fb1cef74..aab46161e00 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF +++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF @@ -17,6 +17,7 @@ Export-Package: org.eclipse.cdt.build.core.scannerconfig, org.eclipse.cdt.managedbuilder.internal.core;x-internal:=true, org.eclipse.cdt.managedbuilder.internal.envvar;x-internal:=true, org.eclipse.cdt.managedbuilder.internal.macros;x-internal:=true, + org.eclipse.cdt.managedbuilder.internal.scannerconfig;x-internal:=true, org.eclipse.cdt.managedbuilder.macros, org.eclipse.cdt.managedbuilder.makegen, org.eclipse.cdt.managedbuilder.makegen.gnu, diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java index 782cc3254eb..ef3531b09c2 100755 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 Intel Corporation and others. + * Copyright (c) 2006, 2011 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,9 +21,11 @@ import org.eclipse.cdt.managedbuilder.internal.macros.FileContextData; import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider; import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyCommands; +import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; /** * This dependency calculator uses the GCC -MMD -MF -MP -MT options in order to @@ -83,8 +85,10 @@ public class DefaultGCCDependencyCalculator2Commands implements project = rcInfo.getParent().getOwner().getProject(); } - sourceLocation = (source.isAbsolute() ? source : project.getLocation().append(source)); - outputLocation = project.getLocation().append(topBuildDirectory).append(getDependencyFiles()[0]); + IPath projectPath = new Path(EFSExtensionManager.getDefault().getPathFromURI(project.getLocationURI())); + + sourceLocation = (source.isAbsolute() ? source : projectPath.append(source)); + outputLocation = projectPath.append(topBuildDirectory).append(getDependencyFiles()[0]); // A separate rule is needed for the resource in the case where explicit file-specific macros // are referenced, or if the resource contains special characters in its path (e.g., whitespace) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java index bddefbb1c90..45e6bf1bbfb 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java @@ -73,6 +73,7 @@ import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyPreBuild; +import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; @@ -464,7 +465,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { // ToolInfoHolder h = getToolInfo(fo.getPath()); updateMonitor(ManagedMakeMessages.getFormattedString("GnuMakefileGenerator.message.postproc.dep.file", depFile.getName())); //$NON-NLS-1$ if (postProcessors != null) { - IPath absolutePath = depFile.getLocation(); + IPath absolutePath = new Path(EFSExtensionManager.getDefault().getPathFromURI(depFile.getLocationURI())); // Convert to build directory relative IPath depPath = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), absolutePath); for (int i=0; i