1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00
This commit is contained in:
David Inglis 2006-05-15 14:07:07 +00:00
parent a8d10ae99f
commit b2265fc025

View file

@ -49,6 +49,7 @@ import org.eclipse.core.runtime.SubProgressMonitor;
* @author vhirsl
*/
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_CONSOLE_ID = MakeCorePlugin.getUniqueIdentifier() + ".ExternalScannerInfoProviderConsole"; //$NON-NLS-1$
private static final String LANG_ENV_VAR = "LANG"; //$NON-NLS-1$
@ -164,32 +165,31 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
protected boolean initialize() {
IProject currProject = resource.getProject();
IMakeBuilderInfo info;
IPath workingDirectory = null;
try {
info = MakeCorePlugin.createBuildInfo(resource.getProject(), MakeBuilder.BUILDER_ID);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e);
}
IPath workingDirectory = info.getBuildLocation();
if (workingDirectory != null && !workingDirectory.isEmpty()) {
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();
}
}
if (workingDirectory == null) {
} 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 = resource.getProject().getLocation();
fWorkingDirectory = workingDirectory;
fCompileCommand = new Path(buildInfo.getProviderRunCommand(providerId));
fCompileArguments = ScannerConfigUtil.tokenizeStringWithQuotes(buildInfo.getProviderRunArguments(providerId), "\"");//$NON-NLS-1$
return (fCompileCommand != null);
}
/**
* Add additional arguments. For example: tso - target specific options
* Base class implementation returns compileArguments.
@ -239,10 +239,10 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
Enumeration names = props.propertyNames();
if (names != null) {
while (names.hasMoreElements()) {
String key = (String) names.nextElement();
String key = (String)names.nextElement();
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;
}