|
13 | 13 | *******************************************************************************/
|
14 | 14 | package org.eclipse.dartboard.pub;
|
15 | 15 |
|
16 |
| -import java.io.BufferedReader; |
17 | 16 | import java.io.IOException;
|
18 |
| -import java.io.InputStreamReader; |
19 | 17 | import java.util.HashMap;
|
20 | 18 | import java.util.Map;
|
21 | 19 |
|
|
27 | 25 | import org.eclipse.core.runtime.IPath;
|
28 | 26 | import org.eclipse.core.runtime.IStatus;
|
29 | 27 | import org.eclipse.core.runtime.Status;
|
30 |
| -import org.eclipse.core.runtime.SubMonitor; |
31 | 28 | import org.eclipse.core.runtime.jobs.IJobChangeEvent;
|
32 | 29 | import org.eclipse.core.runtime.jobs.Job;
|
33 | 30 | import org.eclipse.core.runtime.jobs.JobChangeAdapter;
|
34 | 31 | import org.eclipse.dartboard.Messages;
|
35 | 32 | import org.eclipse.dartboard.util.PubUtil;
|
36 | 33 | import org.eclipse.dartboard.util.StatusUtil;
|
| 34 | +import org.eclipse.debug.core.DebugPlugin; |
| 35 | +import org.eclipse.debug.core.ILaunchManager; |
| 36 | +import org.eclipse.debug.core.Launch; |
| 37 | +import org.eclipse.debug.core.model.IProcess; |
37 | 38 | import org.eclipse.osgi.util.NLS;
|
38 | 39 | import org.slf4j.Logger;
|
39 | 40 | import org.slf4j.LoggerFactory;
|
@@ -101,22 +102,11 @@ public void get(IProject project, boolean offline) {
|
101 | 102 | return StatusUtil.createError(Messages.PubSync_CouldNotStartProcess, exception);
|
102 | 103 | }
|
103 | 104 |
|
104 |
| - try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { |
105 |
| - SubMonitor mo = SubMonitor.convert(monitor, 100); |
106 |
| - |
107 |
| - String taskName; |
108 |
| - while ((taskName = reader.readLine()) != null) { |
109 |
| - // We only want updates to the progress bar if one of the 2 operations are |
110 |
| - // started. Not for every dependency added or compilation step done. |
111 |
| - if (taskName.equalsIgnoreCase(Messages.PubSync_Task_ResolvingDependencies) |
112 |
| - || taskName.equalsIgnoreCase(Messages.PubSync_Task_PrecompilingExecutables)) { |
113 |
| - mo.split(50); |
114 |
| - mo.setTaskName(taskName); |
115 |
| - } |
116 |
| - } |
117 |
| - } catch (IOException exception) { |
118 |
| - return StatusUtil.createError(Messages.PubSync_CouldNotStartProcess, exception); |
119 |
| - } |
| 105 | + Launch launch = new Launch(null, ILaunchManager.RUN_MODE, null); |
| 106 | + DebugPlugin.getDefault().getLaunchManager().addLaunch(launch); |
| 107 | + |
| 108 | + IProcess runtimeProcess = DebugPlugin.newProcess(launch, process, Messages.Console_Name); |
| 109 | + launch.addProcess(runtimeProcess); |
120 | 110 | return Status.OK_STATUS;
|
121 | 111 | });
|
122 | 112 |
|
|
0 commit comments