use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-community by JetBrains.
the class XDebuggerTree method isUnderRemoteDebug.
public boolean isUnderRemoteDebug() {
DataContext context = DataManager.getInstance().getDataContext(this);
ExecutionEnvironment env = LangDataKeys.EXECUTION_ENVIRONMENT.getData(context);
if (env != null && env.getRunProfile() instanceof RemoteRunProfile) {
return true;
}
return false;
}
use of com.intellij.execution.runners.ExecutionEnvironment in project android by JetBrains.
the class HotswapAction method doPerform.
@Override
protected void doPerform(@NotNull AnActionEvent e, @NotNull Project project) {
RunnerAndConfigurationSettings settings = RunManager.getInstance(project).getSelectedConfiguration();
if (settings == null) {
InstantRunManager.LOG.warn("Hotswap Action could not locate current run config settings");
return;
}
AndroidSessionInfo session = getAndroidSessionInfo(project, settings);
if (session == null) {
InstantRunManager.LOG.warn("Hotswap Action could not locate an existing session for selected run config.");
return;
}
Executor executor = getExecutor(session.getExecutorId());
if (executor == null) {
InstantRunManager.LOG.warn("Hotswap Action could not identify executor");
return;
}
ExecutionEnvironmentBuilder builder = ExecutionEnvironmentBuilder.createOrNull(executor, settings);
if (builder == null) {
InstantRunManager.LOG.warn("Hotswap Action could not construct an env");
return;
}
ExecutionEnvironment env = builder.activeTarget().dataContext(e.getDataContext()).build();
InstantRunUtils.setInvokedViaHotswapAction(env, true);
InstantRunManager.LOG.info("Invoking hotswap launch");
ProgramRunnerUtil.executeConfiguration(env, false, true);
}
use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-plugins by JetBrains.
the class DartTestEventsConverterTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myNodes = new HashMap<>();
final ExecutionEnvironment environment = new ExecutionEnvironment();
myMockResettablePrinter = new MockPrinter(true);
TestConsoleProperties consoleProperties = createConsoleProperties();
myConsole = new MyConsoleView(consoleProperties, environment);
myConsole.initUI();
myResultsViewer = myConsole.getResultsViewer();
myEventsConverter = new DartTestEventsConverter(DartTestRunningState.DART_FRAMEWORK_NAME, consoleProperties, DartUrlResolver.getInstance(getProject(), getSourceRoot()));
myEventsProcessor = new DartTestEventsProcessor(consoleProperties.getProject(), DartTestRunningState.DART_FRAMEWORK_NAME);
myEventsProcessor.addEventsListener(myResultsViewer);
myEventsConverter.setProcessor(myEventsProcessor);
myTreeModel = myResultsViewer.getTreeView() == null ? null : (DefaultTreeModel) myResultsViewer.getTreeView().getModel();
assertNotNull(myTreeModel);
myParentNode = (DefaultMutableTreeNode) myTreeModel.getRoot();
myEventsProcessor.onStartTesting();
}
use of com.intellij.execution.runners.ExecutionEnvironment 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.execution.runners.ExecutionEnvironment in project intellij-leiningen-plugin by derkork.
the class LeiningenRunConfigurationType method runConfiguration.
public static void runConfiguration(Project project, LeiningenRunnerParameters params, DataContext context) {
RunnerAndConfigurationSettings configSettings = createRunnerAndConfigurationSettings(params, project);
ProgramRunner runner = RunnerRegistry.getInstance().findRunnerById(DefaultRunExecutor.EXECUTOR_ID);
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ExecutionEnvironment env = new ExecutionEnvironment(executor, runner, configSettings, project);
try {
runner.execute(env, new ProgramRunner.Callback() {
public void processStarted(RunContentDescriptor runContentDescriptor) {
final ProcessHandler runContentDescriptorProcessHandler = runContentDescriptor.getProcessHandler();
if (runContentDescriptorProcessHandler != null) {
runContentDescriptorProcessHandler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
LocalFileSystem.getInstance().refreshWithoutFileWatcher(true);
}
});
}
}
});
} catch (ExecutionException e) {
}
}
Aggregations