From a8fb1e337610bb7dbfd1d70639770f7f07746bf3 Mon Sep 17 00:00:00 2001 From: Chris Recoskie Date: Tue, 26 Jul 2011 17:10:15 -0400 Subject: [PATCH] Bug 353113 - BuildDescription class does not behave properly for remote projects --- .../internal/buildmodel/BuildDescription.java | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java index 35e92962507..b760a869128 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.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 @@ -68,6 +68,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.pdomdepgen.PDOMDependencyGenerator; +import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.URIUtil; @@ -259,16 +260,7 @@ public class BuildDescription implements IBuildDescription { //return rc.getFullPath(); IPath rcLocation = rc.getLocation(); if(rcLocation == null){ - IPath fullPath = rc.getFullPath(); - rcLocation = calcLocationForFullPath(fullPath); -// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); -// IProject proj = root.getProject(fullPath.segment(0)); -// rcLocation = proj.getLocation(); -// if(rcLocation != null){ -// rcLocation = rcLocation.append(fullPath.removeFirstSegments(1)); -// } else { -// rcLocation = root.getLocation().append(fullPath); -// } + rcLocation = new Path(EFSExtensionManager.getDefault().getPathFromURI(rc.getLocationURI())); } return rcLocation; } @@ -1067,16 +1059,9 @@ public class BuildDescription implements IBuildDescription { return null; } - try { - URI newURI = new URI(projURI.getScheme(), projURI.getUserInfo(), - projURI.getHost(), projURI.getPort(), location.toString(), projURI.getQuery(), projURI - .getFragment()); - return newURI; - } catch (URISyntaxException e) { - ManagedBuilderCorePlugin.log(e); - } + URI newURI = EFSExtensionManager.getDefault().createNewURIFromPath(projURI, location.toString()); + return newURI; - return null; } private void calculateOutputs(BuildStep action, BuildIOType arg, BuildResource buildRc) throws CoreException {