1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 17:25:38 +02:00

Bug 344646 - Use EFSExtensionManager to get project paths

This commit is contained in:
Vivian Kong 2011-05-04 15:02:18 +00:00
parent 514f88bf08
commit eb723acf87
4 changed files with 13 additions and 6 deletions

View file

@ -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<IPath>();
fErrors = new ArrayList<Problem>();
this.project = project;
fBaseDirectory = project.getLocation();
fBaseDirectory = new Path(EFSExtensionManager.getDefault().getPathFromURI(project.getLocationURI()));
if (workingDirectory != null) {
pushDirectory(workingDirectory);
}

View file

@ -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,

View file

@ -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)

View file

@ -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<postProcessors.length; i++) {