Search in sources :

Example 1 with FlexDebugProcess

use of com.intellij.lang.javascript.flex.debug.FlexDebugProcess in project intellij-plugins by JetBrains.

the class FlexBaseRunner method launchDebugProcess.

protected RunContentDescriptor launchDebugProcess(final Module module, final FlexBuildConfiguration bc, final BCBasedRunnerParameters params, final ExecutionEnvironment env) throws ExecutionException {
    final XDebugSession debugSession = XDebuggerManager.getInstance(module.getProject()).startSession(env, new XDebugProcessStarter() {

        @Override
        @NotNull
        public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
            try {
                if (params instanceof FlexUnitRunnerParameters) {
                    return new FlexDebugProcess(session, bc, params) {

                        @NotNull
                        @Override
                        public ExecutionConsole createConsole() {
                            try {
                                return createFlexUnitRunnerConsole(session.getProject(), env, getProcessHandler());
                            } catch (ExecutionException e) {
                                Logger.getInstance(FlexBaseRunner.class.getName()).error(e);
                            }
                            return super.createConsole();
                        }
                    };
                }
                return new FlexDebugProcess(session, bc, params);
            } catch (IOException e) {
                iosStopForwardTcpPortIfNeeded(bc, params);
                throw new ExecutionException(e.getMessage(), e);
            }
        }
    });
    debugSession.addSessionListener(new XDebugSessionListener() {

        @Override
        public void sessionStopped() {
            iosStopForwardTcpPortIfNeeded(bc, params);
        }
    });
    return debugSession.getRunContentDescriptor();
}
Also used : FlexUnitRunnerParameters(com.intellij.lang.javascript.flex.flexunit.FlexUnitRunnerParameters) FlexDebugProcess(com.intellij.lang.javascript.flex.debug.FlexDebugProcess) ExecutionConsole(com.intellij.execution.ui.ExecutionConsole) IOException(java.io.IOException) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)1 FlexDebugProcess (com.intellij.lang.javascript.flex.debug.FlexDebugProcess)1 FlexUnitRunnerParameters (com.intellij.lang.javascript.flex.flexunit.FlexUnitRunnerParameters)1 IOException (java.io.IOException)1 NotNull (org.jetbrains.annotations.NotNull)1