[eclipse-poky] [PATCH 02/23] Removed references to RSE
Tim Orling
timothy.t.orling at linux.intel.com
Thu Feb 8 23:17:36 PST 2018
From: Scott Lewis <slewis at composent.com>
The following two yocto bundles can be closed:
org.yocto.docker.launcher, org.yocto.remote.utils.
Signed-off-by: Scott Lewis <slewis at composent.com>
---
plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF | 6 +-
.../src/org/yocto/bc/bitbake/ShellSession.java | 2 -
.../yocto/bc/ui/filesystem/CustomLocalFile.java | 14 ---
.../yocto/bc/ui/wizards/install/InstallWizard.java | 115 +--------------------
4 files changed, 2 insertions(+), 135 deletions(-)
delete mode 100644 plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/filesystem/CustomLocalFile.java
diff --git a/plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF b/plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF
index ebe0173c199..96e4af3446d 100644
--- a/plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.yocto.bc.ui/META-INF/MANIFEST.MF
@@ -15,10 +15,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.editors,
org.eclipse.ui.ide,
org.eclipse.ui.console,
- org.eclipse.core.filesystem,
- org.yocto.remote.utils
+ org.eclipse.core.filesystem
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Import-Package: org.eclipse.rse.core.model,
- org.eclipse.rse.services.clientserver.messages,
- org.eclipse.rse.services.files
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
index d10b124a194..0aa3a141068 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
@@ -19,8 +19,6 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Writer;
-import org.yocto.remote.utils.ICommandResponseHandler;
-
/**
* A class for Linux shell sessions.
* @author kgilmer
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/filesystem/CustomLocalFile.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/filesystem/CustomLocalFile.java
deleted file mode 100644
index 3147c37566c..00000000000
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/filesystem/CustomLocalFile.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.yocto.bc.ui.filesystem;
-
-import java.io.File;
-
-import org.eclipse.core.internal.filesystem.local.LocalFile;
-import org.yocto.remote.utils.RemoteHelper;
-
- at SuppressWarnings("restriction")
-public class CustomLocalFile extends LocalFile{
-
- public CustomLocalFile(String projName, File file) {
- super(new File(RemoteHelper.retrieveProjRootFromMetaArea(projName)));
- }
-}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
index d653bfd03fe..4970184b10d 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
@@ -11,19 +11,13 @@
*******************************************************************************/
package org.yocto.bc.ui.wizards.install;
-import java.io.BufferedReader;
-import java.io.File;
import java.io.IOException;
-import java.io.InputStreamReader;
import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
import java.util.Hashtable;
import java.util.Map;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.ui.IWorkbench;
@@ -38,13 +32,12 @@ import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
-
+import org.yocto.bc.bitbake.ICommandResponseHandler;
import org.yocto.bc.ui.Activator;
import org.yocto.bc.ui.model.ProjectInfo;
import org.yocto.bc.ui.wizards.FiniteStateWizard;
import org.yocto.bc.ui.wizards.newproject.BBConfigurationInitializeOperation;
import org.yocto.bc.ui.wizards.newproject.CreateBBCProjectOperation;
-import org.yocto.remote.utils.ICommandResponseHandler;
/**
* A wizard for installing a fresh copy of an OE system.
@@ -188,112 +181,6 @@ public class InstallWizard extends FiniteStateWizard implements
public float calWorkloadDone(String info) throws IllegalArgumentException;
}
- @SuppressWarnings("unused")
- private class LongtimeRunningTask implements IRunnableWithProgress {
- private String []cmdArray;
- private String []envp;
- private File dir;
- private ICommandResponseHandler handler;
- private Process p;
- private String taskName;
- static public final int TOTALWORKLOAD=100;
- private int reported_workload;
- ICalculatePercentage cal;
-
- public LongtimeRunningTask(String taskName,
- String []cmdArray, String []envp, File dir,
- ICommandResponseHandler handler,
- ICalculatePercentage calculator) {
- this.taskName=taskName;
- this.cmdArray=cmdArray;
- this.envp=envp;
- this.dir=dir;
- this.handler=handler;
- this.p=null;
- this.cal=calculator;
- }
-
- private void reportProgress(IProgressMonitor monitor,String info) {
- if(cal == null) {
- monitor.worked(1);
- }else {
- float percentage;
- try {
- percentage=cal.calWorkloadDone(info);
- } catch (IllegalArgumentException e) {
- //can't get percentage
- return;
- }
- int delta=(int) (TOTALWORKLOAD * percentage - reported_workload);
- if( delta > 0 ) {
- monitor.worked(delta);
- reported_workload += delta;
- }
- }
- }
-
- synchronized public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
-
- boolean cancel=false;
- reported_workload=0;
-
- try {
- monitor.beginTask(taskName, TOTALWORKLOAD);
-
- p=Runtime.getRuntime().exec(cmdArray,envp,dir);
- BufferedReader inbr = new BufferedReader(new InputStreamReader(p.getInputStream()));
- BufferedReader errbr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
- String info;
- while (!cancel) {
- if(monitor.isCanceled())
- {
- cancel=true;
- throw new InterruptedException("User Cancelled");
- }
-
- info=null;
- //reading stderr
- while (errbr.ready()) {
- info=errbr.readLine();
- //some application using stderr to print out information
- handler.response(info, false);
- }
- //reading stdout
- while (inbr.ready()) {
- info=inbr.readLine();
- handler.response(info, false);
- }
-
- //report progress
- if(info!=null)
- reportProgress(monitor,info);
-
- //check if exit
- try {
- int exitValue=p.exitValue();
- if (exitValue != 0) {
- handler.response(
- taskName + " failed with the return value " + new Integer(exitValue).toString(),
- true);
- }
- break;
- }catch (IllegalThreadStateException e) {
- }
-
- Thread.sleep(500);
- }
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- if (p != null ) {
- p.destroy();
- }
- }
- }
- }
-
private class BCCommandResponseHandler implements ICommandResponseHandler {
private MessageConsoleStream myConsoleStream;
private Boolean errorOccured = false;
--
2.13.6
More information about the eclipse-yocto
mailing list