mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 01:45:33 +02:00
some fixes to project description manager and build system to allow EFS hosted projects to function better
This commit is contained in:
parent
80485fce8a
commit
48c5584887
3 changed files with 12 additions and 9 deletions
|
@ -89,7 +89,7 @@ public abstract class AbstractGCCBOPConsoleParserUtility {
|
|||
protected void pushDirectory(IPath dir) {
|
||||
if (dir != null) {
|
||||
IPath pwd = null;
|
||||
if (fBaseDirectory.isPrefixOf(dir)) {
|
||||
if (fBaseDirectory != null && fBaseDirectory.isPrefixOf(dir)) {
|
||||
pwd = dir.removeFirstSegments(fBaseDirectory.segmentCount());
|
||||
} else {
|
||||
// check if it is a cygpath
|
||||
|
|
|
@ -89,6 +89,7 @@ import org.eclipse.cdt.internal.core.model.CElementDelta;
|
|||
import org.eclipse.cdt.internal.core.model.CModelManager;
|
||||
import org.eclipse.cdt.internal.core.settings.model.CExternalSettinsDeltaCalculator.ExtSettingsDelta;
|
||||
import org.eclipse.core.filesystem.EFS;
|
||||
import org.eclipse.core.filesystem.IFileInfo;
|
||||
import org.eclipse.core.filesystem.IFileStore;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -1963,13 +1964,15 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
|
|||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=96258
|
||||
URI location = rscFile.getLocationURI();
|
||||
if (location != null) {
|
||||
File file = toLocalFile(location, null/*no progress monitor available*/);
|
||||
if (file != null && file.exists()) {
|
||||
try {
|
||||
stream = new FileInputStream(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw ExceptionFactory.createCoreException(e);
|
||||
}
|
||||
IFileStore file = EFS.getStore(location);
|
||||
IFileInfo info = null;
|
||||
|
||||
if(file != null) {
|
||||
info = file.fetchInfo();
|
||||
}
|
||||
|
||||
if (info != null && info.exists()) {
|
||||
stream = file.openInputStream(EFS.NONE, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ public class CdtMacroSupplier extends CoreMacroSupplierBase {
|
|||
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,project.getName());
|
||||
} else if("ProjDirPath".equals(macroName)){ //$NON-NLS-1$
|
||||
IProject project = getProject(cfg);
|
||||
if(project != null)
|
||||
if(project != null && project.getLocation() != null) // in the EFS world getLocation() can return null
|
||||
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,project.getLocation().toString());
|
||||
}
|
||||
/* else if("BuildArtifactFileName".equals(macroName)){ //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue