Skip to contentSkip to conversation

Run each command in separate shell and close it accordingly

PATCH New Ioana Grigoropol 1 participant 1 message Jan 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Run each command in separate shell and close it accordingly

--needs more testing

---
 plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF       |    1 +
 .../src/org/yocto/bc/bitbake/ShellSession.java     |   10 +-
 .../org/yocto/bc/remote/utils/RemoteHelper.java    |  289 ++++++++++++++++----
 .../bc/remote/utils/YoctoRunnableWithProgress.java |    7 +-
 .../bc/ui/wizards/NewBitBakeFileRecipeWizard.java  |    3 +-
 .../ui/wizards/NewBitBakeFileRecipeWizardPage.java |   78 +++---
 6 files changed, 295 insertions(+), 93 deletions(-)
plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF +1 -0
index 1f0e63e..4e57f33 100644
@@ -29,6 +29,7 @@ Import-Package: org.eclipse.cdt.managedbuilder.core,
  org.eclipse.rse.core,
  org.eclipse.rse.core.model,
  org.eclipse.rse.core.subsystems,
+ org.eclipse.rse.internal.services.local.shells,
  org.eclipse.rse.services,
  org.eclipse.rse.services.clientserver.messages,
  org.eclipse.rse.services.files,
plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java +7 -3
index 6441029..449994c 100644
@@ -87,8 +87,11 @@ public class ShellSession {
 	private void initializeShell(IProgressMonitor monitor) throws IOException {
 		try {
 			if (root != null) {
-				RemoteHelper.runCommandRemote(projectInfo.getConnection(), new YoctoCommand("source " + initCmd, root.getAbsolutePath(), ""));
-				RemoteHelper.runCommandRemote(projectInfo.getConnection(), new YoctoCommand(exportCmd, root.getAbsolutePath(), ""));
+				IHost connection = projectInfo.getConnection();
+//				RemoteHelper.runCommandRemote(projectInfo.getConnection(), new YoctoCommand("source " + initCmd, root.getAbsolutePath(), ""));
+				RemoteHelper.handleRunCommandRemote(connection, new YoctoCommand("source " + initCmd, root.getAbsolutePath(), ""), monitor);
+//				RemoteHelper.runCommandRemote(projectInfo.getConnection(), new YoctoCommand(exportCmd, root.getAbsolutePath(), ""));
+				RemoteHelper.handleRunCommandRemote(connection,  new YoctoCommand(exportCmd, root.getAbsolutePath(), ""), monitor);
 			} else {
 				throw new Exception("Root file not found!");
 			}
@@ -107,7 +110,8 @@ public class ShellSession {
 
 		try {
 			if (projectInfo.getConnection() != null) {
-				hasErrors = RemoteHelper.runCommandRemote(projectInfo.getConnection(), new YoctoCommand(command, root.getAbsolutePath() + "/build/", ""));
+//				hasErrors = RemoteHelper.runCommandRemote(projectInfo.getConnection(), new YoctoCommand(command, root.getAbsolutePath() + "/build/", ""));
+				RemoteHelper.handleRunCommandRemote(projectInfo.getConnection(), new YoctoCommand(command, root.getAbsolutePath() + "/build/", ""), new NullProgressMonitor());
 //				return RemoteHelper.getProcessBuffer(projectInfo.getConnection()).getMergedOutputLines();
 				return root.getAbsolutePath() + "/build/";
 			}
plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java +234 -55

333 lines not on this page · raw message

plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoRunnableWithProgress.java +4 -3
index b6ed2b8..82ba0ba 100644
@@ -20,7 +20,7 @@ public class YoctoRunnableWithProgress extends YoctoHostShellProcessAdapter
 	private String cmd;
 	private String args;
 	private IProgressMonitor monitor;
-	
+
 	public YoctoRunnableWithProgress(IHostShell hostShell,
 			ProcessStreamBuffer processStreamBuffer,
 			CommandResponseHandler commandResponseHandler) throws IOException {
@@ -33,7 +33,7 @@ public class YoctoRunnableWithProgress extends YoctoHostShellProcessAdapter
 		try {
 			this.monitor = monitor;
 			this.monitor.beginTask(taskName, RemoteHelper.TOTALWORKLOAD);
-			
+
 			if (!remoteConnection.isOpen()) {
 				try {
 					remoteConnection.open(monitor);
@@ -48,7 +48,8 @@ public class YoctoRunnableWithProgress extends YoctoHostShellProcessAdapter
 
 			try {
 				IHost connection = RemoteHelper.getRemoteConnectionByName(remoteConnection.getName());
-                RemoteHelper.runCommandRemote(connection, new YoctoCommand(cmd, "", args));
+//                RemoteHelper.runCommandRemote(connection, new YoctoCommand(cmd, "", args));
+				RemoteHelper.handleRunCommandRemote(connection, new YoctoCommand(cmd, "", args), monitor);
 			} catch (Exception e) {
 				e.printStackTrace();
 			} finally {
plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizard.java +2 -1
index 7345b77..66c4b9d 100644
@@ -204,7 +204,8 @@ public class NewBitBakeFileRecipeWizard extends Wizard implements INewWizard {
 			public void run(IProgressMonitor monitor) throws InvocationTargetException {
 				try {
 					doFinish(element, monitor);
-					RemoteHelper.runCommandRemote(connection, new YoctoCommand("rm -rf " + element.getMetaDir() + "/temp", "", ""));
+//					RemoteHelper.runCommandRemote(connection, new YoctoCommand("rm -rf " + element.getMetaDir() + "/temp", "", ""));
+					RemoteHelper.handleRunCommandRemote(connection, new YoctoCommand("rm -rf " + element.getMetaDir() + "/temp", "", ""), monitor);
 				} catch (Exception e) {
 					throw new InvocationTargetException(e);
 				} finally {
plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java +47 -31

168 lines not on this page · raw message

Signature · 1 line
1.7.9.5