diff --git a/org.eclipse.dartboard/assets/messages.properties b/org.eclipse.dartboard/assets/messages.properties index c16ed4d..fc7c7ad 100644 --- a/org.eclipse.dartboard/assets/messages.properties +++ b/org.eclipse.dartboard/assets/messages.properties @@ -1,4 +1,5 @@ Console_Name=Dart Terminal +Pub_Console_Name=Pub Terminal Launch_DebugNotSupported_Title=Debug is not yet supported Launch_DebugNotSupported_Body=Debug launch is not yet supported. Please use the standard run config. Launch_NoProjectSelected_Title=No project selected diff --git a/org.eclipse.dartboard/src/org/eclipse/dartboard/Messages.java b/org.eclipse.dartboard/src/org/eclipse/dartboard/Messages.java index a632329..6803a76 100644 --- a/org.eclipse.dartboard/src/org/eclipse/dartboard/Messages.java +++ b/org.eclipse.dartboard/src/org/eclipse/dartboard/Messages.java @@ -19,6 +19,7 @@ public class Messages extends NLS { public static String Console_Name; + public static String Pub_Console_Name; public static String Launch_DebugNotSupported_Title; public static String Launch_DebugNotSupported_Body; public static String Launch_NoProjectSelected_Title; diff --git a/org.eclipse.dartboard/src/org/eclipse/dartboard/pub/PubService.java b/org.eclipse.dartboard/src/org/eclipse/dartboard/pub/PubService.java index 3e6ece4..066f85f 100644 --- a/org.eclipse.dartboard/src/org/eclipse/dartboard/pub/PubService.java +++ b/org.eclipse.dartboard/src/org/eclipse/dartboard/pub/PubService.java @@ -13,9 +13,7 @@ *******************************************************************************/ package org.eclipse.dartboard.pub; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; @@ -27,13 +25,16 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.dartboard.Messages; import org.eclipse.dartboard.util.PubUtil; import org.eclipse.dartboard.util.StatusUtil; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.Launch; +import org.eclipse.debug.core.model.IProcess; import org.eclipse.osgi.util.NLS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -101,22 +102,11 @@ public void get(IProject project, boolean offline) { return StatusUtil.createError(Messages.PubSync_CouldNotStartProcess, exception); } - try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { - SubMonitor mo = SubMonitor.convert(monitor, 100); - - String taskName; - while ((taskName = reader.readLine()) != null) { - // We only want updates to the progress bar if one of the 2 operations are - // started. Not for every dependency added or compilation step done. - if (taskName.equalsIgnoreCase(Messages.PubSync_Task_ResolvingDependencies) - || taskName.equalsIgnoreCase(Messages.PubSync_Task_PrecompilingExecutables)) { - mo.split(50); - mo.setTaskName(taskName); - } - } - } catch (IOException exception) { - return StatusUtil.createError(Messages.PubSync_CouldNotStartProcess, exception); - } + Launch launch = new Launch(null, ILaunchManager.RUN_MODE, null); + DebugPlugin.getDefault().getLaunchManager().addLaunch(launch); + + IProcess runtimeProcess = DebugPlugin.newProcess(launch, process, Messages.Pub_Console_Name); + launch.addProcess(runtimeProcess); return Status.OK_STATUS; });