Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-03-15 17:49:38 -0400
committerAndrew Gvozdev2012-03-15 17:49:38 -0400
commit12d44ec8becdf85fbc87e8e0da7fde7bd5d3a3ac (patch)
tree91690b61832a4b28033a42d89fac50a4387fa6c6 /build/org.eclipse.cdt.managedbuilder.core
parent4c83576d7e036937a37cc0de496344020b677ee1 (diff)
downloadorg.eclipse.cdt-12d44ec8becdf85fbc87e8e0da7fde7bd5d3a3ac.tar.gz
org.eclipse.cdt-12d44ec8becdf85fbc87e8e0da7fde7bd5d3a3ac.tar.xz
org.eclipse.cdt-12d44ec8becdf85fbc87e8e0da7fde7bd5d3a3ac.zip
bug 145099: MBS Internal Builder: Switch to using the Spawner for
detecting an executable to be launched
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java49
1 files changed, 3 insertions, 46 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
index b0a23fdb09..f0ff0a7a19 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Intel Corporation and others.
+ * Copyright (c) 2006, 2012 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
@@ -20,14 +20,11 @@ import java.util.Set;
import org.eclipse.cdt.core.CommandLauncher;
import org.eclipse.cdt.core.ICommandLauncher;
-import org.eclipse.cdt.internal.core.Cygwin;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
import org.eclipse.cdt.utils.PathUtil;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
@@ -48,44 +45,6 @@ public class CommandBuilder implements IBuildModelBuilder {
private Process fProcess;
private String fErrMsg;
- private class CommandSearchLauncher extends CommandLauncher {
- @Override
- protected String[] constructCommandArray(String command, String[] commandArgs) {
- String[] args = new String[1 + commandArgs.length];
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- // find a location of the executable
- String envPathValue = fCmd.getEnvironment().get(PATH_ENV);
- IPath location = PathUtil.findProgramLocation(command, envPathValue);
- if(location != null) {
- try {
- // Handle cygwin link
- command = Cygwin.cygwinToWindowsPath(location.toString(), envPathValue);
- } catch (Exception e) {
- command = location.toString();
- }
- }
- //if not found, continue with the command passed as an argument
- }
-
- args[0] = command;
- System.arraycopy(commandArgs, 0, args, 1, commandArgs.length);
- return args;
- }
-
- @Override
- protected void printCommandLine(OutputStream os) {
- if (os != null) {
- String cmd = CommandBuilder.this.getCommandLine();
- try {
- os.write(cmd.getBytes());
- os.flush();
- } catch (IOException e) {
- // ignore;
- }
- }
- }
- }
-
protected class OutputStreamWrapper extends OutputStream {
private OutputStream fOut;
@@ -205,12 +164,10 @@ public class CommandBuilder implements IBuildModelBuilder {
}
protected ICommandLauncher createLauncher() {
-// if(isWindows())
-// return new CommandLauncher();
- return new CommandSearchLauncher();
+ return new CommandLauncher();
}
- public String getErrMsg(){
+ public String getErrMsg() {
return fErrMsg;
}

Back to the top