public static void runConfiguration( @NotNull RunnerAndConfigurationSettings configuration, @NotNull Executor executor) { ExecutionEnvironmentBuilder builder = createEnvironment(executor, configuration); if (builder != null) { ExecutionManager.getInstance(configuration.getConfiguration().getProject()) .restartRunProfile(builder.activeTarget().build()); } }
@Nullable public static ExecutionEnvironmentBuilder createEnvironment( @NotNull Executor executor, @NotNull RunnerAndConfigurationSettings settings) { try { return ExecutionEnvironmentBuilder.create(executor, settings); } catch (ExecutionException e) { handleExecutionError( settings.getConfiguration().getProject(), executor.getToolWindowId(), settings.getConfiguration().getName(), e); return null; } }