[Esbox-commits] r398 - in trunk: org.indt.esbox.core org.indt.esbox.core/META-INF org.indt.esbox.core/src/org/indt/esbox/core org.indt.esbox.core/src/org/indt/esbox/core/scratchbox org.indt.esbox.core/src/org/indt/esbox/core/tool org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh org.indt.esbox.debug/src/org/indt/esbox/debug/internal
raul at garage.maemo.org
raul at garage.maemo.org
Mon Feb 11 19:22:34 EET 2008
Author: raul
Date: 2008-02-11 19:22:22 +0200 (Mon, 11 Feb 2008)
New Revision: 398
Added:
trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/SbrshCommandLauncher.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolListener.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolEvent.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolRunnerInfo.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolProvider.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolRunner.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolProvider.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolRunner.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolProvider.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolRunner.java
Modified:
trunk/org.indt.esbox.core/META-INF/MANIFEST.MF
trunk/org.indt.esbox.core/plugin.xml
trunk/org.indt.esbox.core/src/org/indt/esbox/core/ESboxException.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ESboxToolEngine.java
trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolRunner.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/CreateTargetCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetCurrentTargetCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetVesionScratchboxCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/KillallCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCompilersCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCputranspCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListDevkitsCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListSessionsCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListTargetsCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RemoveTargetCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ResetTargetCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RootstrapCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SelectTargetCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ShowTargetCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SimpleCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/AddSbrshCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java
trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java
trunk/org.indt.esbox.debug/src/org/indt/esbox/debug/internal/ESboxGDBRemoteCDIDebugger.java
Log:
refactoring. Tools were moved from launch to core. Command launcher was also modified.
Modified: trunk/org.indt.esbox.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.indt.esbox.core/META-INF/MANIFEST.MF 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/META-INF/MANIFEST.MF 2008-02-11 17:22:22 UTC (rev 398)
@@ -19,4 +19,6 @@
org.indt.esbox.core.platform,
org.indt.esbox.core.scratchbox,
org.indt.esbox.core.templateengine,
- org.indt.esbox.core.tool
+ org.indt.esbox.core.tool,
+ org.indt.esbox.core.tool.oprofile,
+ org.indt.esbox.core.tool.valgrind
Modified: trunk/org.indt.esbox.core/plugin.xml
===================================================================
--- trunk/org.indt.esbox.core/plugin.xml 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/plugin.xml 2008-02-11 17:22:22 UTC (rev 398)
@@ -100,5 +100,28 @@
</run>
</builder>
</extension>
+
+ <extension
+ point="org.indt.esbox.core.tool">
+ <tool
+ id="org.indt.esbox.tool.oprofile"
+ name="OProfile">
+ <provider
+ class="org.indt.esbox.core.tool.oprofile.OProfileToolProvider">
+ </provider>
+ </tool>
+ <tool
+ id="org.indt.esbox.tool.valgrind"
+ name="Valgrind">
+ <provider
+ class="org.indt.esbox.core.tool.valgrind.ValgrindToolProvider"></provider>
+ </tool>
+ <tool
+ id="org.indt.esbox.tool.opreport"
+ name="OPreport">
+ <provider
+ class="org.indt.esbox.core.tool.oprofile.OPreportToolProvider"></provider>
+ </tool>
+ </extension>
</plugin>
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/core/ESboxException.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/ESboxException.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/ESboxException.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -20,4 +20,8 @@
public ESboxException(String message) {
super(message);
}
+
+ public ESboxException(Throwable cause) {
+ super(cause);
+ }
}
Added: trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/SbrshCommandLauncher.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/SbrshCommandLauncher.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/SbrshCommandLauncher.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.scratchbox;
+
+import java.io.IOException;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.spawner.ProcessFactory;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ *
+ */
+public class SbrshCommandLauncher extends ScratchboxCommandLauncher {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.cdt.core.CommandLauncher#execute(org.eclipse.core.runtime.IPath, java.lang.String[], java.lang.String[], org.eclipse.core.runtime.IPath)
+ */
+ public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory) {
+ try {
+ fCommandArgs = constructCommandArray(commandPath.toOSString(),args, env, changeToDirectory);
+
+ PTY pty = new PTY();
+ fProcess = ProcessFactory.getFactory().exec(fCommandArgs, new String[] {}, changeToDirectory.toFile(), new PTY());
+
+ fErrorMessage = "";
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ setErrorMessage(e.getMessage());
+ fProcess = null;
+ }
+
+ return fProcess;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.indt.esbox.core.scratchbox.ScratchboxCommandLauncher#constructCommandArray(java.lang.String, java.lang.String[], java.lang.String[], org.eclipse.core.runtime.IPath)
+ */
+ protected String[] constructCommandArray(String command,
+ String[] commandArgs, String[] env, IPath changeToDirectory)
+ throws IOException {
+
+ String argString = "";
+ // Construct commands arguments to string
+ for (int i = 0; i < commandArgs.length; i++) {
+ argString = argString.concat(" " + commandArgs[i]);
+ }
+
+ // construct whole command with exports
+ String cmd[] = constructCommandArray(command);
+
+ // Replace some pieces of original string
+ cmd[2] = cmd[2] + " " + argString;
+
+ return cmd;
+ }
+
+}
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -18,6 +18,7 @@
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.Set;
@@ -29,10 +30,12 @@
import org.eclipse.cdt.internal.core.envvar.UserDefinedEnvironmentSupplier;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Preferences;
import org.indt.esbox.core.CoreActivator;
import org.indt.esbox.core.ESboxPreferenceConstants;
import org.indt.esbox.core.env.ESboxEnvironmentVariableManager;
+import org.indt.esbox.core.tool.ToolRunnerInfo;
/**
* Launch commands inside Scratchbox.
@@ -69,42 +72,6 @@
}
/**
- * Execute a command inside Scratchbox.
- *
- * @param command
- * the command to be executed.
- * @return the process generated from the execution of the command.
- */
- public Process execInsideSbox(String command) {
- return this.execInsideSbox(command,null);
- }
-
- /**
- * Execute a command inside Scratchbox.
- *
- * @param command
- * the command to be executed.
- *
- * @param env
- * the environment variables.
- * @return the process generated from the execution of the command.
- */
- public Process execInsideSbox(String command, String[] env) {
- verifyRunScript();
- try {
- fCommandArgs = constructCommandArraySbox(command);
- fProcess = Runtime.getRuntime().exec(fCommandArgs, env);
-
- fErrorMessage = "";
- } catch (IOException e) {
- setErrorMessage(e.getMessage());
- fProcess = null;
- }
-
- return fProcess;
- }
-
- /**
* Construct an array of parameters.
*
* @param command
@@ -138,48 +105,6 @@
}
/**
- * Construct an array of parameters. It is supposed to execute the command
- * inside Scratchbox.
- *
- * @param command
- * the command to be executed.
- * @return an array with the correct parameters to be passed to command
- * launcher.
- */
- protected String[] constructCommandArraySbox(String command) {
- String cmdInSb = getCorrectCommandFormat(command);
-
- // construct whole command with exports
- String cmd[] = constructCommandArray();
-
- List<String> defaultEnv = getEnvironmentAsList();
- String exports = "";
-
- if (defaultEnv.size() > 0) {
- String separator = "";
- for (String variable : defaultEnv) {
- exports += separator + variable;
- separator = ",";
- }
- } else {
- exports = "PATH=$PATH";
- }
-
-
- Preferences preferences = CoreActivator.getDefault().getPluginPreferences();
- String runScriptLocation = preferences.getString(ESboxPreferenceConstants.RUN_SCRIPT_LOC.toString());
-
- // Replace some pieces of original string
- cmd[2] = cmd[2].replaceAll("\\$\\{RUN_SCRIPT_DIRECTORY\\}", runScriptLocation);
- cmd[2] = cmd[2].replaceAll("\\$\\{DIRECTORY\\}", ".");
- cmd[2] = cmd[2].replaceAll("\\$\\{EXPORTS\\}", exports);
- cmd[2] = cmd[2].replaceAll("\\$\\{COMMAND\\}", cmdInSb);
- cmd[2] = cmd[2].replaceAll("\\$\\{ARGS\\}", "");
-
- return cmd;
- }
-
- /**
* Constructs a command array that will be passed to the process. The
* environment variables and the path to run the program are delegated so
* that they are used inside the Scratchbox environment.
@@ -202,7 +127,7 @@
// characters by enclosing the export statements in quotes.
String exports = "";
- if (env.length > 0) {
+ if (env != null && env.length > 0) {
String separator = "";
for (int i = 0; i < env.length; i++) {
StringTokenizer token = new StringTokenizer(env[i], "=");
@@ -298,7 +223,7 @@
verifyRunScript();
// add platform specific arguments (shell invocation)
fCommandArgs = constructCommandArray(commandPath, args, env, changeToDirectory);
-
+
fProcess = Runtime.getRuntime().exec(fCommandArgs);
fErrorMessage = ""; //$NON-NLS-1$
} catch (IOException e) {
@@ -307,7 +232,85 @@
}
return fProcess;
}
+
+ /**
+ * Execute a command inside Scratchbox.
+ *
+ * @param command
+ * the command to be executed.
+ *
+ * @param env
+ * the environment variables.
+ * @return the process generated from the execution of the command.
+ */
+ public Process execute(String command) {
+ return execute(command,null);
+ }
+ /**
+ * Execute a command inside Scratchbox.
+ *
+ * @param command
+ * the command to be executed.
+ *
+ * @param env
+ * the environment variables.
+ * @return the process generated from the execution of the command.
+ */
+ public Process execute(String command, String[] env) {
+ verifyRunScript();
+ try {
+ fCommandArgs = constructCommandArray(command, new String[] { }, env, new Path("."));
+
+ fProcess = Runtime.getRuntime().exec(fCommandArgs);
+
+ fErrorMessage = "";
+ } catch (IOException e) {
+ setErrorMessage(e.getMessage());
+ fProcess = null;
+ }
+
+ return fProcess;
+ }
+
+ public Process execute(ToolRunnerInfo toolInfo) {
+ verifyRunScript();
+ try {
+ List<String> cmdLine = toolInfo.getCommandLine();
+ String command = cmdLine.get(0);
+ String args[] = new String[toolInfo.getCommandLine().size() - 1];
+
+ for (int i = 1; i < cmdLine.size(); i++) {
+ args[i - 1] = cmdLine.get(i);
+ }
+
+ String env[] = getEnvArray(toolInfo.getEnvVars());
+
+ fCommandArgs = constructCommandArray(command, args, env, toolInfo.getCwd());
+ fProcess = Runtime.getRuntime().exec(fCommandArgs);
+
+ fErrorMessage = "";
+ } catch (IOException e) {
+ setErrorMessage(e.getMessage());
+ fProcess = null;
+ }
+
+ return fProcess;
+ }
+
+ private String[] getEnvArray(Properties env) {
+ List<String> envList = new ArrayList<String>();
+ Enumeration names = env.propertyNames();
+ if (names != null) {
+ while (names.hasMoreElements()) {
+ String key = (String) names.nextElement();
+ envList.add(key + "=" + env.getProperty(key));
+ }
+ return (String[]) envList.toArray(new String[envList.size()]);
+ }
+ return new String[] {} ;
+ }
+
private void verifyRunScript() {
Preferences preferences = CoreActivator.getDefault().getPluginPreferences();
String runScriptLocation = preferences.getString(ESboxPreferenceConstants.RUN_SCRIPT_LOC.toString());
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ESboxToolEngine.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ESboxToolEngine.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ESboxToolEngine.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.Platform;
@@ -55,13 +56,15 @@
String toolName = null;
String id = null;
+ tools = new ArrayList<ITool>();
+
for(int i=0; i<extensions.length; i++) {
- ITool tool = null;
-
+
IExtension extension = extensions[i];
IConfigurationElement[] configElements = extension.getConfigurationElements();
pluginId = extension.getNamespaceIdentifier(); // Plugin-id of the extending plugin.
for(int j=0; j<configElements.length; j++) {
+ ITool tool = null;
IConfigurationElement config = configElements[j];
toolName = config.getAttribute("name");
id = config.getAttribute("id");
@@ -69,17 +72,13 @@
IConfigurationElement[] provider = config.getChildren("provider");
IConfigurationElement[] params = config.getChildren("param");
- String className = provider[0].getAttribute("class");
IToolProvider toolProvider = null;
try {
- toolProvider = (IToolProvider) Class.forName(className).newInstance();
- } catch (ClassNotFoundException e) {
+ toolProvider = (IToolProvider) provider[0].createExecutableExtension("class");
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
+ }
tool = new Tool(toolName,id,toolProvider);
@@ -90,10 +89,11 @@
value = params[k].getAttribute("value");
IToolParam param = new ToolParam(paramName, description, value);
tool.addParam(param);
- }
+ }
+ tools.add(tool);
}
- tools.add(tool);
+
}
}
Added: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolListener.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolListener.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolListener.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool;
+
+import java.util.EventListener;
+
+/**
+ *
+ */
+public interface IToolListener extends EventListener {
+
+
+ public void toolExecuted(ToolEvent event);
+
+}
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolRunner.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolRunner.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/IToolRunner.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -10,15 +10,17 @@
*******************************************************************************/
package org.indt.esbox.core.tool;
-import org.indt.esbox.core.scratchbox.ScratchboxCommandLauncher;
+import org.indt.esbox.core.ESboxException;
/**
*
*/
public interface IToolRunner {
- public boolean runTool(String[] args);
-
- public ScratchboxCommandLauncher getCommandLauncher();
+ /** Generate the launch details for the tool */
+ public ToolRunnerInfo createToolRunnerInfo() throws ESboxException;
+ /** Handle launched process */
+ public void trackProcess(Process process) throws ESboxException;
+
}
Added: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolEvent.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolEvent.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolEvent.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool;
+
+import java.util.EventObject;
+
+/**
+ *
+ */
+public class ToolEvent extends EventObject {
+
+ public ToolEvent(Object source) {
+ super(source);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+}
Added: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolRunnerInfo.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolRunnerInfo.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/ToolRunnerInfo.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+/**
+ *
+ */
+public class ToolRunnerInfo {
+
+ /** command line (e.g. "oprofile", "mytool" ) */
+ private List<String> cmdLine;
+
+ /** new environment variables, or null if nothing needed */
+ private Properties envVars;
+
+ /** current directory to go to (host-relative, e.g. project path) */
+ private IPath cwd;
+
+ /** if true, send output to the console */
+ private boolean sendToConsole;
+
+ /** if sendToConsole==true, then this is the console name */
+ private String consoleName;
+
+ /** if sendToConsole==true, then create a new console */
+ private boolean brandNew;
+
+ public ToolRunnerInfo() {
+ setCommandLine(new ArrayList<String>());
+ setEnvVars(new Properties());
+ setCwd(new Path("."));
+ }
+
+ // ********* Get commands *********
+
+ public List<String> getCommandLine() {
+ return cmdLine;
+ }
+
+ public Properties getEnvVars() {
+ return envVars;
+ }
+
+ public IPath getCwd() {
+ return cwd;
+ }
+
+ public boolean isSendToConsole() {
+ return sendToConsole;
+ }
+
+ public String getConsoleName() {
+ return consoleName;
+ }
+
+ public boolean isBrandNew() {
+ return brandNew;
+ }
+
+ // ********* Set commands *********
+
+ public void setCommandLine(List<String> cmdLine) {
+ this.cmdLine = cmdLine;
+ }
+
+ public void setEnvVars(Properties envVars) {
+ this.envVars = envVars;
+ }
+
+ public void setCwd(IPath cwd) {
+ this.cwd = cwd;
+ }
+
+ public void setSendToConsole(boolean sendToConsole) {
+ this.sendToConsole = sendToConsole;
+ }
+
+ public void setConsoleName(String consoleName) {
+ this.consoleName = consoleName;
+ }
+
+ public void setBrandNew(boolean brandNew) {
+ this.brandNew = brandNew;
+ }
+
+
+
+}
Copied: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolProvider.java (from rev 396, trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/core/tool/OPreportToolProvider.java)
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolProvider.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolProvider.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool.oprofile;
+
+import org.indt.esbox.core.tool.IToolProvider;
+import org.indt.esbox.core.tool.IToolRunner;
+
+/**
+ *
+ */
+public class OPreportToolProvider implements IToolProvider {
+
+ /* (non-Javadoc)
+ * @see org.indt.esbox.core.tool.IToolProvider#getRunner()
+ */
+ public IToolRunner getRunner() {
+ return OPreportToolRunner.getInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see org.indt.esbox.core.tool.IToolProvider#isInstalled()
+ */
+ public boolean isInstalled() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}
Copied: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolRunner.java (from rev 396, trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/core/tool/OPreportToolRunner.java)
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolRunner.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OPreportToolRunner.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool.oprofile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.indt.esbox.core.ESboxException;
+import org.indt.esbox.core.tool.IToolListener;
+import org.indt.esbox.core.tool.IToolRunner;
+import org.indt.esbox.core.tool.ToolEvent;
+import org.indt.esbox.core.tool.ToolRunnerInfo;
+
+/**
+ *
+ */
+public class OPreportToolRunner implements IToolRunner {
+
+ private static final String OPREPORT = "opreport";
+
+ private static List<IToolListener> listeners;
+
+ private static OPreportToolRunner singleton;
+
+ private OPreportToolRunner() {
+ listeners = new ArrayList<IToolListener>();
+ }
+
+ public static synchronized OPreportToolRunner getInstance() {
+ if (singleton == null)
+ singleton = new OPreportToolRunner();
+ return singleton;
+ }
+
+ public ToolRunnerInfo createToolRunnerInfo() throws ESboxException {
+ ToolRunnerInfo runnerInfo = new ToolRunnerInfo();
+ List<String> commandLine = runnerInfo.getCommandLine();
+ commandLine.add(OPREPORT);
+ runnerInfo.setBrandNew(false);
+ runnerInfo.setSendToConsole(false);
+ runnerInfo.setConsoleName(null);
+ return runnerInfo;
+ }
+
+ public void trackProcess(Process process) throws ESboxException {
+ sendToolExecutedSignal(process);
+ }
+
+ public synchronized void addListener(IToolListener l) {
+ if (!listeners.contains(l))
+ listeners.add(l);
+ }
+
+ public synchronized boolean removeListener(IToolListener l) {
+ return listeners.remove(l);
+ }
+
+ public void sendToolExecutedSignal(Process process) {
+ ToolEvent event = new ToolEvent(process);
+ for (IToolListener listener : listeners) {
+ listener.toolExecuted(event);
+ }
+ }
+
+}
Copied: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolProvider.java (from rev 396, trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/core/tool/OProfileToolProvider.java)
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolProvider.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolProvider.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool.oprofile;
+
+import org.indt.esbox.core.tool.IToolProvider;
+import org.indt.esbox.core.tool.IToolRunner;
+
+/**
+ *
+ */
+public class OProfileToolProvider implements IToolProvider {
+
+ /* (non-Javadoc)
+ * @see org.indt.esbox.core.tool.IToolProvider#getRunner()
+ */
+ public IToolRunner getRunner() {
+ return OProfileToolRunner.getInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see org.indt.esbox.core.tool.IToolProvider#isInstalled()
+ */
+ public boolean isInstalled() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+
+}
Copied: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolRunner.java (from rev 396, trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/core/tool/OProfileToolRunner.java)
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolRunner.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/oprofile/OProfileToolRunner.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool.oprofile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.indt.esbox.core.ESboxException;
+import org.indt.esbox.core.tool.IToolListener;
+import org.indt.esbox.core.tool.IToolRunner;
+import org.indt.esbox.core.tool.ToolEvent;
+import org.indt.esbox.core.tool.ToolRunnerInfo;
+
+/**
+ *
+ */
+public class OProfileToolRunner implements IToolRunner {
+
+ private static final String OPROFILE = "opcontrol";
+
+ private static List<IToolListener> listeners;
+
+ private static OProfileToolRunner singleton;
+
+ private OProfileToolRunner() {
+ listeners = new ArrayList<IToolListener>();
+ }
+
+ public static synchronized OProfileToolRunner getInstance() {
+ if (singleton == null)
+ singleton = new OProfileToolRunner();
+ return singleton;
+ }
+
+ public ToolRunnerInfo createToolRunnerInfo() throws ESboxException {
+ ToolRunnerInfo runnerInfo = new ToolRunnerInfo();
+ List<String> commandLine = runnerInfo.getCommandLine();
+ commandLine.add(OPROFILE);
+ runnerInfo.setBrandNew(false);
+ runnerInfo.setSendToConsole(false);
+ runnerInfo.setConsoleName(null);
+ return runnerInfo;
+ }
+
+ public void trackProcess(Process process) throws ESboxException {
+ sendToolExecutedSignal(process);
+ }
+
+ public synchronized void addListener(IToolListener l) {
+ if (!listeners.contains(l))
+ listeners.add(l);
+ }
+
+ public synchronized boolean removeListener(IToolListener l) {
+ return listeners.remove(l);
+ }
+
+ public void sendToolExecutedSignal(Process process) {
+ ToolEvent event = new ToolEvent(process);
+ for (IToolListener listener : listeners) {
+ listener.toolExecuted(event);
+ }
+ }
+
+}
Copied: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolProvider.java (from rev 396, trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/core/tool/ValgrindToolProvider.java)
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolProvider.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolProvider.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool.valgrind;
+
+import org.indt.esbox.core.tool.IToolProvider;
+import org.indt.esbox.core.tool.IToolRunner;
+
+/**
+ *
+ */
+public class ValgrindToolProvider implements IToolProvider {
+
+ /* (non-Javadoc)
+ * @see org.indt.esbox.core.tool.IToolProvider#getRunner()
+ */
+ public IToolRunner getRunner() {
+ return ValgrindToolRunner.getInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see org.indt.esbox.core.tool.IToolProvider#isInstalled()
+ */
+ public boolean isInstalled() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}
Copied: trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolRunner.java (from rev 396, trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/core/tool/ValgrindToolRunner.java)
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolRunner.java (rev 0)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/tool/valgrind/ValgrindToolRunner.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * 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:
+ * Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.indt.esbox.core.tool.valgrind;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.indt.esbox.core.ESboxException;
+import org.indt.esbox.core.tool.IToolListener;
+import org.indt.esbox.core.tool.IToolRunner;
+import org.indt.esbox.core.tool.ToolEvent;
+import org.indt.esbox.core.tool.ToolRunnerInfo;
+
+/**
+ *
+ */
+public class ValgrindToolRunner implements IToolRunner {
+
+ private static final String VALGRIND = "valgrind";
+
+ private static List<IToolListener> listeners;
+
+ private static ValgrindToolRunner singleton;
+
+ private ValgrindToolRunner() {
+ listeners = new ArrayList<IToolListener>();
+ }
+
+ public static synchronized ValgrindToolRunner getInstance() {
+ if (singleton == null)
+ singleton = new ValgrindToolRunner();
+ return singleton;
+ }
+
+ public ToolRunnerInfo createToolRunnerInfo() throws ESboxException {
+ ToolRunnerInfo runnerInfo = new ToolRunnerInfo();
+ List<String> commandLine = runnerInfo.getCommandLine();
+ commandLine.add(VALGRIND);
+ runnerInfo.setBrandNew(false);
+ runnerInfo.setSendToConsole(false);
+ runnerInfo.setConsoleName(null);
+ return runnerInfo;
+ }
+
+ public void trackProcess(Process process) throws ESboxException {
+ sendToolExecutedSignal(process);
+ }
+
+ public synchronized void addListener(IToolListener l) {
+ if (!listeners.contains(l))
+ listeners.add(l);
+ }
+
+ public synchronized boolean removeListener(IToolListener l) {
+ return listeners.remove(l);
+ }
+
+ public void sendToolExecutedSignal(Process process) {
+ ToolEvent event = new ToolEvent(process);
+ for (IToolListener listener : listeners) {
+ listener.toolExecuted(event);
+ }
+ }
+
+}
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/CreateTargetCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/CreateTargetCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/CreateTargetCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -56,7 +56,7 @@
setupTargetAction, setupActionOptionsReplaced);
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(setupTargetCommand);
+ Process process = commandLauncher.execute(setupTargetCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetCurrentTargetCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetCurrentTargetCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetCurrentTargetCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -43,7 +43,7 @@
.replaceScratchboxConfigCommand(currentTargetAction);
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(currentTargetCommand);
+ Process process = commandLauncher.execute(currentTargetCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetVesionScratchboxCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetVesionScratchboxCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/GetVesionScratchboxCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -56,7 +56,7 @@
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
Process process = commandLauncher
- .execInsideSbox(currentSboxVersionCommand);
+ .execute(currentSboxVersionCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/KillallCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/KillallCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/KillallCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -49,7 +49,7 @@
killallAction, new String[] { signalOption });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(killallCommand);
+ Process process = commandLauncher.execute(killallCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCompilersCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCompilersCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCompilersCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -48,7 +48,7 @@
listAction, new String[] { compilersOptions });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(listCompilersCommand);
+ Process process = commandLauncher.execute(listCompilersCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCputranspCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCputranspCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListCputranspCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -49,7 +49,7 @@
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
Process process = commandLauncher
- .execInsideSbox(listCputranspsCommandString);
+ .execute(listCputranspsCommandString);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListDevkitsCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListDevkitsCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListDevkitsCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -48,7 +48,7 @@
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
Process process = commandLauncher
- .execInsideSbox(listDevkitsCommandString);
+ .execute(listDevkitsCommandString);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListSessionsCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListSessionsCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListSessionsCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -49,7 +49,7 @@
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
Process process = commandLauncher
- .execInsideSbox(listSessionsCommandString);
+ .execute(listSessionsCommandString);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListTargetsCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListTargetsCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ListTargetsCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -48,7 +48,7 @@
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
Process process = commandLauncher
- .execInsideSbox(listTargetsCommandString);
+ .execute(listTargetsCommandString);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RemoveTargetCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RemoveTargetCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RemoveTargetCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -52,7 +52,7 @@
forceRemoveTargetOption });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(removeTargetCommand);
+ Process process = commandLauncher.execute(removeTargetCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ResetTargetCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ResetTargetCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ResetTargetCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -45,7 +45,7 @@
resetTargetAction, new String[] {});
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(resetTargetCommand);
+ Process process = commandLauncher.execute(resetTargetCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RootstrapCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RootstrapCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/RootstrapCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -44,7 +44,7 @@
rootstrapAction, new String[] { fileOrURL });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(rootstrapCommand);
+ Process process = commandLauncher.execute(rootstrapCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SelectTargetCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SelectTargetCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SelectTargetCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -46,7 +46,7 @@
selectTargetAction, new String[] { targetToSelect });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(selectTargetCommand);
+ Process process = commandLauncher.execute(selectTargetCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ShowTargetCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ShowTargetCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/ShowTargetCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -49,7 +49,7 @@
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
Process process = commandLauncher
- .execInsideSbox(showTargetCommandString);
+ .execute(showTargetCommandString);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SimpleCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SimpleCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/SimpleCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -34,7 +34,7 @@
"Invalid number of parameters");
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(params.get(0));
+ Process process = commandLauncher.execute(params.get(0));
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/AddSbrshCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/AddSbrshCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/AddSbrshCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -64,7 +64,7 @@
new String[] { targetDeviceAddr, localHostName });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(addCommand);
+ Process process = commandLauncher.execute(addCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -66,7 +66,7 @@
nfsOption });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(configureCommand);
+ Process process = commandLauncher.execute(configureCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -60,7 +60,7 @@
mountAction, new String[] { targetName });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(mountCommand);
+ Process process = commandLauncher.execute(mountCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -60,7 +60,7 @@
unmountAction, new String[] { targetName });
ScratchboxCommandLauncher commandLauncher = new ScratchboxCommandLauncher();
- Process process = commandLauncher.execInsideSbox(unmountCommand);
+ Process process = commandLauncher.execute(unmountCommand);
try {
process.waitFor();
Modified: trunk/org.indt.esbox.debug/src/org/indt/esbox/debug/internal/ESboxGDBRemoteCDIDebugger.java
===================================================================
--- trunk/org.indt.esbox.debug/src/org/indt/esbox/debug/internal/ESboxGDBRemoteCDIDebugger.java 2008-01-29 12:38:52 UTC (rev 397)
+++ trunk/org.indt.esbox.debug/src/org/indt/esbox/debug/internal/ESboxGDBRemoteCDIDebugger.java 2008-02-11 17:22:22 UTC (rev 398)
@@ -12,7 +12,6 @@
package org.indt.esbox.debug.internal;
import java.io.File;
-import java.io.IOException;
import org.eclipse.cdt.core.CommandLauncher;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
@@ -29,8 +28,6 @@
import org.eclipse.cdt.debug.mi.core.command.MIGDBSet;
import org.eclipse.cdt.debug.mi.core.command.MITargetSelect;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
-import org.eclipse.cdt.utils.pty.PTY;
-import org.eclipse.cdt.utils.spawner.ProcessFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -40,6 +37,7 @@
import org.indt.esbox.core.CoreActivator;
import org.indt.esbox.core.ESboxPreferenceConstants;
import org.indt.esbox.core.ErrorLogger;
+import org.indt.esbox.core.scratchbox.SbrshCommandLauncher;
import org.indt.esbox.core.scratchbox.ScratchboxCommandLauncher;
import org.indt.esbox.debug.DebugActivator;
import org.indt.esbox.debug.ui.ESboxTCPSettingsBlock;
@@ -204,7 +202,7 @@
for (int i = 0; i < tokens.length; i++)
args[i + 2] = tokens[i];
- InnerCommandLauncher launcher = new InnerCommandLauncher();
+ ScratchboxCommandLauncher launcher = new SbrshCommandLauncher();
Process process = launcher.execute(command, args, new String[] { }, new Path("."));
}
@@ -240,58 +238,5 @@
process.waitFor();
}
-
- /**
- *
- */
- class InnerCommandLauncher extends ScratchboxCommandLauncher {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.cdt.core.CommandLauncher#execute(org.eclipse.core.runtime.IPath, java.lang.String[], java.lang.String[], org.eclipse.core.runtime.IPath)
- */
- public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory) {
- try {
- fCommandArgs = constructCommandArray(commandPath.toOSString(),args, env, changeToDirectory);
-
- PTY pty = new PTY();
- fProcess = ProcessFactory.getFactory().exec(fCommandArgs, new String[] {}, changeToDirectory.toFile(), new PTY());
- fErrorMessage = "";
-
- } catch (IOException e) {
- e.printStackTrace();
- setErrorMessage(e.getMessage());
- fProcess = null;
- }
-
- return fProcess;
- }
-
- /*
- * (non-Javadoc)
- * @see org.indt.esbox.core.scratchbox.ScratchboxCommandLauncher#constructCommandArray(java.lang.String, java.lang.String[], java.lang.String[], org.eclipse.core.runtime.IPath)
- */
- protected String[] constructCommandArray(String command,
- String[] commandArgs, String[] env, IPath changeToDirectory)
- throws IOException {
-
- String argString = "";
- // Construct commands arguments to string
- for (int i = 0; i < commandArgs.length; i++) {
- argString = argString.concat(" " + commandArgs[i]);
- }
-
- // construct whole command with exports
- String cmd[] = constructCommandArray(command);
-
- // Replace some pieces of original string
- cmd[2] = cmd[2] + " " + argString;
-
- return cmd;
- }
-
-
- }
-
}
More information about the Esbox-commits
mailing list