use of com.intellij.lang.javascript.flex.run.RemoteFlashRunConfiguration in project intellij-plugins by JetBrains.
the class AdlUtil method runDebugger.
// http://kb2.adobe.com/cps/407/kb407625.html
public static void runDebugger(final Module module, final Runnable postTask) throws ExecutionException {
final Project project = module.getProject();
final RunnerAndConfigurationSettings settings = RunManager.getInstance(project).createConfiguration("FlashUIDesigner", RemoteFlashRunConfigurationType.getFactory());
final RemoteFlashRunConfiguration configuration = (RemoteFlashRunConfiguration) settings.getConfiguration();
RunManagerEx.disableTasks(project, settings.getConfiguration(), CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
final Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();
ProgramRunner.Callback callback = new ProgramRunner.Callback() {
@Override
public void processStarted(final RunContentDescriptor descriptor) {
final ProcessHandler processHandler = descriptor.getProcessHandler();
assert processHandler != null;
DesignerApplication application = DesignerApplicationManager.getApplication();
if (application != null) {
Disposer.register(application, new Disposable() {
@Override
public void dispose() {
if (!project.isDisposed()) {
ApplicationManager.getApplication().invokeLater(() -> ExecutionManager.getInstance(project).getContentManager().removeRunContent(executor, descriptor));
}
processHandler.destroyProcess();
}
});
postTask.run();
}
}
};
FlexBuildConfiguration buildConfiguration = FlexBuildConfigurationManager.getInstance(module).getActiveConfiguration();
configuration.getRunnerParameters().setModuleName(module.getName());
configuration.getRunnerParameters().setBCName(buildConfiguration.getName());
final FlexRunner runner = new FlexRunner(callback, buildConfiguration);
runner.execute(new ExecutionEnvironment(executor, runner, settings, project));
}
use of com.intellij.lang.javascript.flex.run.RemoteFlashRunConfiguration in project intellij-plugins by JetBrains.
the class FlexRunner method doExecute.
@Override
protected RunContentDescriptor doExecute(@NotNull final RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {
final BCBasedRunnerParameters parameters = ((RemoteFlashRunConfiguration) env.getRunProfile()).getRunnerParameters();
RunContentDescriptor runContentDescriptor = XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
try {
return DebugPathManager.IS_DEV ? new MyFlexDebugProcessAbleToResolveFileDebugId(callback, session, buildConfiguration, parameters) : new MyFlexDebugProcess(callback, session, buildConfiguration, parameters);
} catch (IOException e) {
throw new ExecutionException(e.getMessage(), e);
} finally {
buildConfiguration = null;
}
}
}).getRunContentDescriptor();
ProcessHandler processHandler = runContentDescriptor.getProcessHandler();
assert processHandler != null;
//noinspection deprecation
processHandler.putUserData(ProcessHandler.SILENTLY_DESTROY_ON_CLOSE, true);
return runContentDescriptor;
}
Aggregations