mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
patch from Tianchao Li to fix bug # 136136
This commit is contained in:
parent
f721770c5e
commit
634cd9cbf1
12 changed files with 217 additions and 204 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2005 QNX Software Systems and others.
|
* Copyright (c) 2000, 2005, 2006 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -29,7 +29,6 @@ import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
||||||
import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
||||||
import org.eclipse.core.resources.IContainer;
|
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -121,6 +120,8 @@ public class MakeBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected boolean invokeMake(int kind, IMakeBuilderInfo info, IProgressMonitor monitor) {
|
protected boolean invokeMake(int kind, IMakeBuilderInfo info, IProgressMonitor monitor) {
|
||||||
boolean isClean = false;
|
boolean isClean = false;
|
||||||
IProject currProject = getProject();
|
IProject currProject = getProject();
|
||||||
|
@ -141,15 +142,7 @@ public class MakeBuilder extends ACBuilder {
|
||||||
// remove all markers for this project
|
// remove all markers for this project
|
||||||
removeAllMarkers(currProject);
|
removeAllMarkers(currProject);
|
||||||
|
|
||||||
IPath workingDirectory = info.getBuildLocation();
|
IPath workingDirectory = MakeBuilderUtil.getBuildDirectory(currProject, info);
|
||||||
if (!workingDirectory.isEmpty()) {
|
|
||||||
IResource res = currProject.getParent().findMember(workingDirectory);
|
|
||||||
if (res instanceof IContainer && res.exists()) {
|
|
||||||
workingDirectory = res.getLocation();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
workingDirectory = currProject.getLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] targets = getTargets(kind, info);
|
String[] targets = getTargets(kind, info);
|
||||||
if (targets.length != 0 && targets[targets.length - 1].equals(info.getCleanBuildTarget())) //$NON-NLS-1$
|
if (targets.length != 0 && targets[targets.length - 1].equals(info.getCleanBuildTarget())) //$NON-NLS-1$
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2006 QNX Software Systems 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
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial implementation
|
||||||
|
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.make.core;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IContainer;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
|
public class MakeBuilderUtil {
|
||||||
|
|
||||||
|
public static IPath getBuildDirectory(IProject project, IPath subPath, String builderID) {
|
||||||
|
IPath rootPath = getBuildDirectory(project, builderID);
|
||||||
|
return rootPath.append(subPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IPath getBuildDirectory(IProject project, String builderID) {
|
||||||
|
IMakeBuilderInfo info;
|
||||||
|
try {
|
||||||
|
info = MakeCorePlugin.createBuildInfo(project, builderID);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
return project.getLocation();
|
||||||
|
}
|
||||||
|
return getBuildDirectory(project, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IPath getBuildDirectory(IProject project, IMakeBuilderInfo info) {
|
||||||
|
IPath buildDirectory = info.getBuildLocation();
|
||||||
|
if (!buildDirectory.isEmpty()) {
|
||||||
|
IResource res = project.getParent().findMember(buildDirectory);
|
||||||
|
if (res instanceof IContainer && res.exists()) {
|
||||||
|
buildDirectory = res.getLocation();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
buildDirectory = project.getLocation();
|
||||||
|
}
|
||||||
|
return buildDirectory;
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,7 +41,7 @@ public class ScannerConfigBuilder extends ACBuilder {
|
||||||
*/
|
*/
|
||||||
protected IProject [] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
protected IProject [] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
|
||||||
// If auto discovery is disabled, do nothing
|
// If auto discovery is disabled, do nothing
|
||||||
boolean autodiscoveryEnabled;
|
// boolean autodiscoveryEnabled;
|
||||||
boolean autodiscoveryEnabled2;
|
boolean autodiscoveryEnabled2;
|
||||||
IScannerConfigBuilderInfo2 buildInfo2 = null;
|
IScannerConfigBuilderInfo2 buildInfo2 = null;
|
||||||
try {
|
try {
|
||||||
|
@ -72,7 +72,7 @@ public class ScannerConfigBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
catch (CoreException e) {
|
catch (CoreException e) {
|
||||||
// builder not installed or disabled
|
// builder not installed or disabled
|
||||||
autodiscoveryEnabled = false;
|
// autodiscoveryEnabled = false;
|
||||||
autodiscoveryEnabled2 = false;
|
autodiscoveryEnabled2 = false;
|
||||||
MakeCorePlugin.log(e);
|
MakeCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2005 QNX Software Systems and others.
|
* Copyright (c) 2000, 2005, 2006 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core;
|
package org.eclipse.cdt.make.internal.core;
|
||||||
|
|
||||||
|
@ -14,6 +15,7 @@ import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.make.core.MakeBuilderUtil;
|
||||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
||||||
import org.eclipse.cdt.make.core.IMakeCommonBuildInfo;
|
import org.eclipse.cdt.make.core.IMakeCommonBuildInfo;
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
|
@ -171,7 +173,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getBuildLocation() {
|
public IPath getBuildLocation() {
|
||||||
return container.getLocation();
|
return MakeBuilderUtil.getBuildDirectory(container.getProject(), container.getProjectRelativePath(), manager.getBuilderID(targetBuilderID));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBuildLocation(IPath location) throws CoreException {
|
public void setBuildLocation(IPath location) throws CoreException {
|
||||||
|
@ -292,7 +294,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
||||||
info.setEnvironment(getExpandedEnvironment());
|
info.setEnvironment(getExpandedEnvironment());
|
||||||
info.setAppendEnvironment(appendEnvironment());
|
info.setAppendEnvironment(appendEnvironment());
|
||||||
if (container != null) {
|
if (container != null) {
|
||||||
info.setBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION, container.getFullPath().toString());
|
info.setBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION, getBuildLocation().toString());
|
||||||
}
|
}
|
||||||
IMakeBuilderInfo projectInfo = MakeCorePlugin.createBuildInfo(getProject(), builderID);
|
IMakeBuilderInfo projectInfo = MakeCorePlugin.createBuildInfo(getProject(), builderID);
|
||||||
info.setErrorParsers(projectInfo.getErrorParsers());
|
info.setErrorParsers(projectInfo.getErrorParsers());
|
||||||
|
|
|
@ -18,7 +18,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.core.model.PathEntryContainerChanged;
|
import org.eclipse.cdt.core.model.PathEntryContainerChanged;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
* Copyright (c) 2004, 2005, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core.scannerconfig;
|
package org.eclipse.cdt.make.internal.core.scannerconfig;
|
||||||
|
|
||||||
|
@ -14,6 +15,8 @@ import java.io.OutputStream;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||||
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
|
import org.eclipse.cdt.make.core.MakeBuilderUtil;
|
||||||
|
import org.eclipse.cdt.make.core.MakeBuilder;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
|
@ -58,7 +61,8 @@ public class ScannerInfoConsoleParserFactory {
|
||||||
SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
|
SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
|
||||||
getSCProfileInstance(currentProject, scBuildInfo.getSelectedProfileId());
|
getSCProfileInstance(currentProject, scBuildInfo.getSelectedProfileId());
|
||||||
IScannerInfoConsoleParser clParser = profileInstance.createExternalScannerInfoParser(providerId);
|
IScannerInfoConsoleParser clParser = profileInstance.createExternalScannerInfoParser(providerId);
|
||||||
clParser.startup(currentProject, currentProject.getLocation(), collector, markerGenerator);
|
IPath buildDirectory = MakeBuilderUtil.getBuildDirectory(currentProject, MakeBuilder.BUILDER_ID);
|
||||||
|
clParser.startup(currentProject, buildDirectory, collector, markerGenerator);
|
||||||
// create an output stream sniffer
|
// create an output stream sniffer
|
||||||
return new ConsoleOutputSniffer(outputStream, errorStream, new
|
return new ConsoleOutputSniffer(outputStream, errorStream, new
|
||||||
IScannerInfoConsoleParser[] {clParser});
|
IScannerInfoConsoleParser[] {clParser});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
* Copyright (c) 2004, 2005, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
||||||
|
|
||||||
|
@ -146,13 +147,14 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
CCommandDSC cmd = fUtil.getNewCCommandDSC(genericLine.toString(), extensionsIndex > 0);
|
CCommandDSC cmd = fUtil.getNewCCommandDSC(genericLine.toString(), extensionsIndex > 0);
|
||||||
if (getProject().getLocation().isPrefixOf(pFilePath)) {
|
IPath buildDirectory = fUtil.getWorkingDirectory();
|
||||||
|
if (buildDirectory.isPrefixOf(pFilePath)) {
|
||||||
List cmdList = new ArrayList();
|
List cmdList = new ArrayList();
|
||||||
cmdList.add(cmd);
|
cmdList.add(cmd);
|
||||||
Map sc = new HashMap(1);
|
Map sc = new HashMap(1);
|
||||||
sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList);
|
sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList);
|
||||||
|
|
||||||
IPath relPath = pFilePath.removeFirstSegments(getProject().getLocation().segmentCount());
|
IPath relPath = pFilePath.removeFirstSegments(buildDirectory.segmentCount());
|
||||||
IFile file = getProject().getFile(relPath);
|
IFile file = getProject().getFile(relPath);
|
||||||
getCollector().contributeToScannerConfig(file, sc);
|
getCollector().contributeToScannerConfig(file, sc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
* Copyright (c) 2004, 2005, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
|
||||||
// First try the current working directory
|
// First try the current working directory
|
||||||
IPath cwd = getWorkingDirectory();
|
IPath cwd = getWorkingDirectory();
|
||||||
if (!cwd.isAbsolute()) {
|
if (!cwd.isAbsolute()) {
|
||||||
cwd = getProject().getLocation().append(cwd);
|
cwd = getBaseDirectory().append(cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
IPath filePath = new Path(fileName);
|
IPath filePath = new Path(fileName);
|
||||||
|
|
|
@ -28,11 +28,8 @@ import org.eclipse.core.runtime.jobs.Job;
|
||||||
public class BuildOutputReaderJob extends Job {
|
public class BuildOutputReaderJob extends Job {
|
||||||
private static final String JOB_NAME = "Build Output Reader"; //$NON-NLS-1$
|
private static final String JOB_NAME = "Build Output Reader"; //$NON-NLS-1$
|
||||||
|
|
||||||
private String inputFileName;
|
|
||||||
|
|
||||||
private IResource resource;
|
private IResource resource;
|
||||||
private IScannerConfigBuilderInfo2 buildInfo;
|
private IScannerConfigBuilderInfo2 buildInfo;
|
||||||
private boolean rc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param project
|
* @param project
|
||||||
|
|
|
@ -70,9 +70,10 @@ public class SymbolEntry {
|
||||||
public void replace(String value, boolean active) {
|
public void replace(String value, boolean active) {
|
||||||
values.put(value, Boolean.valueOf(active));
|
values.put(value, Boolean.valueOf(active));
|
||||||
}
|
}
|
||||||
private void addAll(SymbolEntry se) {
|
|
||||||
values.putAll(se.values);
|
// private void addAll(SymbolEntry se) {
|
||||||
}
|
// values.putAll(se.values);
|
||||||
|
// }
|
||||||
|
|
||||||
public void remove(String value) {
|
public void remove(String value) {
|
||||||
values.remove(value);
|
values.remove(value);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
* Copyright (c) 2004, 2005, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -22,8 +22,8 @@ import org.eclipse.cdt.core.CommandLauncher;
|
||||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||||
import org.eclipse.cdt.core.resources.IConsole;
|
import org.eclipse.cdt.core.resources.IConsole;
|
||||||
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
|
||||||
import org.eclipse.cdt.make.core.MakeBuilder;
|
import org.eclipse.cdt.make.core.MakeBuilder;
|
||||||
|
import org.eclipse.cdt.make.core.MakeBuilderUtil;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||||
|
@ -33,10 +33,8 @@ import org.eclipse.cdt.make.internal.core.StreamMonitor;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
|
||||||
import org.eclipse.core.resources.IContainer;
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
@ -49,202 +47,184 @@ import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
|
public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
|
||||||
|
private static final String EXTERNAL_SI_PROVIDER_ERROR = "ExternalScannerInfoProvider.Provider_Error"; //$NON-NLS-1$
|
||||||
private static final String EXTERNAL_SI_PROVIDER_ERROR = "ExternalScannerInfoProvider.Provider_Error"; //$NON-NLS-1$
|
|
||||||
private static final String EXTERNAL_SI_PROVIDER_CONSOLE_ID = MakeCorePlugin.getUniqueIdentifier() + ".ExternalScannerInfoProviderConsole"; //$NON-NLS-1$
|
private static final String EXTERNAL_SI_PROVIDER_CONSOLE_ID = MakeCorePlugin.getUniqueIdentifier() + ".ExternalScannerInfoProviderConsole"; //$NON-NLS-1$
|
||||||
private static final String LANG_ENV_VAR = "LANG"; //$NON-NLS-1$
|
private static final String LANG_ENV_VAR = "LANG"; //$NON-NLS-1$
|
||||||
|
|
||||||
protected IResource resource;
|
protected IResource resource;
|
||||||
protected String providerId;
|
protected String providerId;
|
||||||
protected IScannerConfigBuilderInfo2 buildInfo;
|
protected IScannerConfigBuilderInfo2 buildInfo;
|
||||||
protected IScannerInfoCollector collector;
|
protected IScannerInfoCollector collector;
|
||||||
// To be initialized by a subclass
|
// To be initialized by a subclass
|
||||||
protected IPath fWorkingDirectory;
|
protected IPath fWorkingDirectory;
|
||||||
protected IPath fCompileCommand;
|
protected IPath fCompileCommand;
|
||||||
protected String[] fCompileArguments;
|
protected String[] fCompileArguments;
|
||||||
|
|
||||||
private SCMarkerGenerator markerGenerator = new SCMarkerGenerator();
|
private SCMarkerGenerator markerGenerator = new SCMarkerGenerator();
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider#invokeProvider(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.resources.IResource, java.lang.String, org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2, org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2)
|
* @see org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider#invokeProvider(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.resources.IResource, java.lang.String, org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2, org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2)
|
||||||
*/
|
*/
|
||||||
public boolean invokeProvider(IProgressMonitor monitor,
|
public boolean invokeProvider(IProgressMonitor monitor,
|
||||||
IResource resource,
|
IResource resource,
|
||||||
String providerId,
|
String providerId,
|
||||||
IScannerConfigBuilderInfo2 buildInfo,
|
IScannerConfigBuilderInfo2 buildInfo,
|
||||||
IScannerInfoCollector collector) {
|
IScannerInfoCollector collector) {
|
||||||
// initialize fields
|
// initialize fields
|
||||||
this.resource = resource;
|
this.resource = resource;
|
||||||
this.providerId = providerId;
|
this.providerId = providerId;
|
||||||
this.buildInfo = buildInfo;
|
this.buildInfo = buildInfo;
|
||||||
this.collector = collector;
|
this.collector = collector;
|
||||||
|
|
||||||
|
IProject currentProject = resource.getProject();
|
||||||
|
// call a subclass to initialize protected fields
|
||||||
|
if (!initialize()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (monitor == null) {
|
||||||
|
monitor = new NullProgressMonitor();
|
||||||
|
}
|
||||||
|
monitor.beginTask(MakeMessages.getString("ExternalScannerInfoProvider.Reading_Specs"), 100); //$NON-NLS-1$
|
||||||
|
|
||||||
|
try {
|
||||||
|
IConsole console = CCorePlugin.getDefault().getConsole(EXTERNAL_SI_PROVIDER_CONSOLE_ID);
|
||||||
|
console.start(currentProject);
|
||||||
|
OutputStream cos = console.getOutputStream();
|
||||||
|
|
||||||
IProject currentProject = resource.getProject();
|
// Before launching give visual cues via the monitor
|
||||||
// call a subclass to initialize protected fields
|
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Reading_Specs")); //$NON-NLS-1$
|
||||||
if (!initialize()) {
|
|
||||||
return false;
|
String errMsg = null;
|
||||||
}
|
CommandLauncher launcher = new CommandLauncher();
|
||||||
if (monitor == null) {
|
// Print the command for visual interaction.
|
||||||
monitor = new NullProgressMonitor();
|
launcher.showCommand(true);
|
||||||
}
|
|
||||||
monitor.beginTask(MakeMessages.getString("ExternalScannerInfoProvider.Reading_Specs"), 100); //$NON-NLS-1$
|
|
||||||
|
|
||||||
try {
|
// add additional arguments
|
||||||
IConsole console = CCorePlugin.getDefault().getConsole(EXTERNAL_SI_PROVIDER_CONSOLE_ID);
|
// subclass can change default behavior
|
||||||
console.start(currentProject);
|
|
||||||
OutputStream cos = console.getOutputStream();
|
|
||||||
|
|
||||||
// Before launching give visual cues via the monitor
|
|
||||||
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Reading_Specs")); //$NON-NLS-1$
|
|
||||||
|
|
||||||
String errMsg = null;
|
|
||||||
CommandLauncher launcher = new CommandLauncher();
|
|
||||||
// Print the command for visual interaction.
|
|
||||||
launcher.showCommand(true);
|
|
||||||
|
|
||||||
// add additional arguments
|
|
||||||
// subclass can change default behavior
|
|
||||||
String[] compileArguments = prepareArguments(
|
String[] compileArguments = prepareArguments(
|
||||||
buildInfo.isUseDefaultProviderCommand(providerId));
|
buildInfo.isUseDefaultProviderCommand(providerId));
|
||||||
|
|
||||||
String ca = coligate(compileArguments);
|
String ca = coligate(compileArguments);
|
||||||
|
|
||||||
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Invoking_Command") //$NON-NLS-1$
|
|
||||||
+ fCompileCommand.toString() + ca);
|
|
||||||
cos = new StreamMonitor(new SubProgressMonitor(monitor, 70), cos, 100);
|
|
||||||
|
|
||||||
|
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Invoking_Command") //$NON-NLS-1$
|
||||||
|
+ fCompileCommand.toString() + ca);
|
||||||
|
cos = new StreamMonitor(new SubProgressMonitor(monitor, 70), cos, 100);
|
||||||
|
|
||||||
ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.getESIProviderOutputSniffer(
|
ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.getESIProviderOutputSniffer(
|
||||||
cos, cos, currentProject, providerId, buildInfo, collector, markerGenerator);
|
cos, cos, currentProject, providerId, buildInfo, collector, markerGenerator);
|
||||||
OutputStream consoleOut = (sniffer == null ? cos : sniffer.getOutputStream());
|
OutputStream consoleOut = (sniffer == null ? cos : sniffer.getOutputStream());
|
||||||
OutputStream consoleErr = (sniffer == null ? cos : sniffer.getErrorStream());
|
OutputStream consoleErr = (sniffer == null ? cos : sniffer.getErrorStream());
|
||||||
TraceUtil.outputTrace("Default provider is executing command:", fCompileCommand.toString() + ca, ""); //$NON-NLS-1$ //$NON-NLS-2$
|
TraceUtil.outputTrace("Default provider is executing command:", fCompileCommand.toString() + ca, ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
Process p = launcher.execute(fCompileCommand, compileArguments, setEnvironment(launcher), fWorkingDirectory);
|
Process p = launcher.execute(fCompileCommand, compileArguments, setEnvironment(launcher), fWorkingDirectory);
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
try {
|
try {
|
||||||
// Close the input of the Process explicitely.
|
// Close the input of the Process explicitely.
|
||||||
// We will never write to it.
|
// We will never write to it.
|
||||||
p.getOutputStream().close();
|
p.getOutputStream().close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
if (launcher.waitAndRead(consoleOut, consoleErr, new SubProgressMonitor(monitor, 0)) != CommandLauncher.OK) {
|
if (launcher.waitAndRead(consoleOut, consoleErr, new SubProgressMonitor(monitor, 0)) != CommandLauncher.OK) {
|
||||||
errMsg = launcher.getErrorMessage();
|
errMsg = launcher.getErrorMessage();
|
||||||
}
|
}
|
||||||
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Parsing_Output")); //$NON-NLS-1$
|
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Parsing_Output")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
errMsg = launcher.getErrorMessage();
|
errMsg = launcher.getErrorMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errMsg != null) {
|
if (errMsg != null) {
|
||||||
String errorDesc = MakeMessages.getFormattedString(EXTERNAL_SI_PROVIDER_ERROR,
|
String errorDesc = MakeMessages.getFormattedString(EXTERNAL_SI_PROVIDER_ERROR,
|
||||||
fCompileCommand.toString() + ca);
|
fCompileCommand.toString() + ca);
|
||||||
markerGenerator.addMarker(currentProject, -1, errorDesc, IMarkerGenerator.SEVERITY_WARNING, null);
|
markerGenerator.addMarker(currentProject, -1, errorDesc, IMarkerGenerator.SEVERITY_WARNING, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Creating_Markers")); //$NON-NLS-1$
|
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Creating_Markers")); //$NON-NLS-1$
|
||||||
consoleOut.close();
|
consoleOut.close();
|
||||||
consoleErr.close();
|
consoleErr.close();
|
||||||
cos.close();
|
cos.close();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
monitor.done();
|
monitor.done();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization of protected fields.
|
* Initialization of protected fields.
|
||||||
* Subclasses are most likely to override default implementation.
|
* Subclasses are most likely to override default implementation.
|
||||||
*
|
*
|
||||||
* @param currentProject
|
* @param currentProject
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected boolean initialize() {
|
protected boolean initialize() {
|
||||||
|
|
||||||
IProject currProject = resource.getProject();
|
IProject currProject = resource.getProject();
|
||||||
IPath workingDirectory = null;
|
//fWorkingDirectory = resource.getProject().getLocation();
|
||||||
try {
|
fWorkingDirectory = MakeBuilderUtil.getBuildDirectory(currProject, MakeBuilder.BUILDER_ID);
|
||||||
IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(resource.getProject(), MakeBuilder.BUILDER_ID);
|
|
||||||
workingDirectory = info.getBuildLocation();
|
|
||||||
if (!workingDirectory.isEmpty()) {
|
|
||||||
IResource res = currProject.getParent().findMember(workingDirectory);
|
|
||||||
if (res instanceof IContainer && res.exists()) {
|
|
||||||
workingDirectory = res.getLocation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
|
||||||
// TODO - FIXME
|
|
||||||
// ignore, we need to change this so that the correct
|
|
||||||
// working directory can be provided
|
|
||||||
}
|
|
||||||
if (workingDirectory == null || workingDirectory.isEmpty()) {
|
|
||||||
workingDirectory = currProject.getLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
// fWorkingDirectory = resource.getProject().getLocation();
|
|
||||||
fWorkingDirectory = workingDirectory;
|
|
||||||
fCompileCommand = new Path(buildInfo.getProviderRunCommand(providerId));
|
fCompileCommand = new Path(buildInfo.getProviderRunCommand(providerId));
|
||||||
fCompileArguments = ScannerConfigUtil.tokenizeStringWithQuotes(buildInfo.getProviderRunArguments(providerId), "\"");//$NON-NLS-1$
|
fCompileArguments = ScannerConfigUtil.tokenizeStringWithQuotes(buildInfo.getProviderRunArguments(providerId), "\"");//$NON-NLS-1$
|
||||||
return (fCompileCommand != null);
|
return (fCompileCommand != null);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
|
/**
|
||||||
* Add additional arguments. For example: tso - target specific options
|
* Add additional arguments. For example: tso - target specific options
|
||||||
* Base class implementation returns compileArguments.
|
* Base class implementation returns compileArguments.
|
||||||
* Subclasses are most likely to override default implementation.
|
* Subclasses are most likely to override default implementation.
|
||||||
*
|
*
|
||||||
* @param isDefaultCommand
|
* @param isDefaultCommand
|
||||||
* @param collector
|
* @param collector
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected String[] prepareArguments(boolean isDefaultCommand) {
|
protected String[] prepareArguments(boolean isDefaultCommand) {
|
||||||
return fCompileArguments;
|
return fCompileArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array
|
* @param array
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String coligate(String[] array) {
|
private String coligate(String[] array) {
|
||||||
StringBuffer sb = new StringBuffer(128);
|
StringBuffer sb = new StringBuffer(128);
|
||||||
for (int i = 0; i < array.length; ++i) {
|
for (int i = 0; i < array.length; ++i) {
|
||||||
sb.append(' ');
|
sb.append(' ');
|
||||||
sb.append(array[i]);
|
sb.append(array[i]);
|
||||||
}
|
}
|
||||||
String ca = sb.toString();
|
String ca = sb.toString();
|
||||||
return ca;
|
return ca;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param launcher
|
* @param launcher
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected String[] setEnvironment(CommandLauncher launcher) {
|
protected String[] setEnvironment(CommandLauncher launcher) {
|
||||||
// Set the environmennt, some scripts may need the CWD var to be set.
|
// Set the environmennt, some scripts may need the CWD var to be set.
|
||||||
Properties props = launcher.getEnvironment();
|
Properties props = launcher.getEnvironment();
|
||||||
props.put("CWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
|
props.put("CWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
|
||||||
props.put("PWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
|
props.put("PWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
|
||||||
// On POSIX (Linux, UNIX) systems reset LANG variable to English with UTF-8 encoding
|
// On POSIX (Linux, UNIX) systems reset LANG variable to English with UTF-8 encoding
|
||||||
// since GNU compilers can handle only UTF-8 characters. English language is chosen
|
// since GNU compilers can handle only UTF-8 characters. English language is chosen
|
||||||
// beacuse GNU compilers inconsistently handle different locales when generating
|
// beacuse GNU compilers inconsistently handle different locales when generating
|
||||||
// output of the 'gcc -v' command. Include paths with locale characters will be
|
// output of the 'gcc -v' command. Include paths with locale characters will be
|
||||||
// handled properly regardless of the language as long as the encoding is set to UTF-8.
|
// handled properly regardless of the language as long as the encoding is set to UTF-8.
|
||||||
if (props.containsKey(LANG_ENV_VAR)) {
|
if (props.containsKey(LANG_ENV_VAR)) {
|
||||||
props.put(LANG_ENV_VAR, "en_US.UTF-8"); //$NON-NLS-1$
|
props.put(LANG_ENV_VAR, "en_US.UTF-8"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
String[] env = null;
|
String[] env = null;
|
||||||
ArrayList envList = new ArrayList();
|
ArrayList envList = new ArrayList();
|
||||||
Enumeration names = props.propertyNames();
|
Enumeration names = props.propertyNames();
|
||||||
if (names != null) {
|
if (names != null) {
|
||||||
while (names.hasMoreElements()) {
|
while (names.hasMoreElements()) {
|
||||||
String key = (String)names.nextElement();
|
String key = (String) names.nextElement();
|
||||||
envList.add(key + "=" + props.getProperty(key)); //$NON-NLS-1$
|
envList.add(key + "=" + props.getProperty(key)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
env = (String[])envList.toArray(new String[envList.size()]);
|
env = (String[]) envList.toArray(new String[envList.size()]);
|
||||||
}
|
}
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
* Copyright (c) 2004, 2005, 2006 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core.scannerconfig2;
|
package org.eclipse.cdt.make.internal.core.scannerconfig2;
|
||||||
|
|
||||||
|
@ -21,14 +22,13 @@ import java.io.OutputStream;
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.resources.IConsole;
|
import org.eclipse.cdt.core.resources.IConsole;
|
||||||
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
import org.eclipse.cdt.internal.core.ConsoleOutputSniffer;
|
||||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
|
||||||
import org.eclipse.cdt.make.core.MakeBuilder;
|
import org.eclipse.cdt.make.core.MakeBuilder;
|
||||||
|
import org.eclipse.cdt.make.core.MakeBuilderUtil;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoConsoleParserFactory;
|
||||||
import org.eclipse.core.resources.IContainer;
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -64,7 +64,7 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider {
|
||||||
// output
|
// output
|
||||||
IConsole console = CCorePlugin.getDefault().getConsole(EXTERNAL_SI_PROVIDER_CONSOLE_ID);
|
IConsole console = CCorePlugin.getDefault().getConsole(EXTERNAL_SI_PROVIDER_CONSOLE_ID);
|
||||||
console.start(project);
|
console.start(project);
|
||||||
OutputStream ostream, cos;
|
OutputStream ostream;
|
||||||
try {
|
try {
|
||||||
ostream = console.getOutputStream();
|
ostream = console.getOutputStream();
|
||||||
}
|
}
|
||||||
|
@ -73,22 +73,7 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
// get build location
|
// get build location
|
||||||
IPath buildDirectory = null;
|
IPath buildDirectory = MakeBuilderUtil.getBuildDirectory(project, MakeBuilder.BUILDER_ID);
|
||||||
try {
|
|
||||||
IMakeBuilderInfo makeInfo = MakeCorePlugin.createBuildInfo(project, MakeBuilder.BUILDER_ID);
|
|
||||||
if (!makeInfo.getBuildLocation().isEmpty()) {
|
|
||||||
IResource res = project.getParent().findMember(makeInfo.getBuildLocation());
|
|
||||||
if (res instanceof IContainer && res.exists()) {
|
|
||||||
buildDirectory = res.getLocation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buildDirectory == null) {
|
|
||||||
buildDirectory = project.getLocation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (CoreException e) {
|
|
||||||
MakeCorePlugin.log(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.
|
ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.
|
||||||
getMakeBuilderOutputSniffer(ostream, null, project, buildDirectory, buildInfo, markerGenerator, collector);
|
getMakeBuilderOutputSniffer(ostream, null, project, buildDirectory, buildInfo, markerGenerator, collector);
|
||||||
|
|
Loading…
Add table
Reference in a new issue