use of com.intellij.execution.configurations.ConfigurationFactory in project intellij-community by JetBrains.
the class PyUnitTestTask method runTestOn.
@Override
public void runTestOn(String sdkHome) throws Exception {
final Project project = getProject();
final ConfigurationFactory factory = PythonTestConfigurationType.getInstance().LEGACY_UNITTEST_FACTORY;
runConfiguration(factory, sdkHome, project);
}
use of com.intellij.execution.configurations.ConfigurationFactory in project intellij-plugins by JetBrains.
the class SimulatorRakeConsoleModifier method createConsoleBuilder.
@NotNull
@Override
public TextConsoleBuilder createConsoleBuilder(@NotNull RakeRunConfiguration config) {
if (onDevice(config)) {
return TextConsoleBuilderFactory.getInstance().createBuilder(config.getProject());
}
final ConfigurationFactory factory = IrbRunConfigurationType.getInstance().getConfigurationFactories()[0];
final Project project = config.getProject();
return new IrbConsoleBuilder(project, (IrbRunConfiguration) factory.createTemplateConfiguration(project));
}
use of com.intellij.execution.configurations.ConfigurationFactory in project azure-tools-for-java by Microsoft.
the class DeploySpringCloudAppAction method deploy.
public static void deploy(@Nullable SpringCloudApp app, @Nonnull Project project) {
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = configType.getConfigurationFactories()[0];
final String configurationName = String.format("%s: %s", factory.getName(), project.getName());
final RunnerAndConfigurationSettings existed = manager.findConfigurationByName(configurationName);
final RunnerAndConfigurationSettings settings = Objects.nonNull(existed) ? existed : manager.createConfiguration(configurationName, factory);
final SpringCloudDeploymentConfiguration configuration = ((SpringCloudDeploymentConfiguration) settings.getConfiguration());
configuration.setApp(app);
AzureTaskManager.getInstance().runLater(() -> {
if (RunDialog.editConfiguration(project, settings, DEPLOY_SPRING_CLOUD_APP_TITLE, DefaultRunExecutor.getRunExecutorInstance())) {
settings.storeInLocalWorkspace();
manager.addConfiguration(settings);
manager.setBeforeRunTasks(configuration, new ArrayList<>(manager.getBeforeRunTasks(settings.getConfiguration())));
manager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(settings, DefaultRunExecutor.getRunExecutorInstance());
}
});
}
use of com.intellij.execution.configurations.ConfigurationFactory in project azure-tools-for-java by Microsoft.
the class RunFunctionAction method runConfiguration.
private void runConfiguration(Module module) {
// todo: investigate when will module be null
if (module == null) {
return;
}
final Project project = module.getProject();
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = new FunctionRunConfigurationFactory(configType);
final RunnerAndConfigurationSettings settings = RunConfigurationUtils.getOrCreateRunConfigurationSettings(module, manager, factory);
if (RunDialog.editConfiguration(project, settings, message("function.run.configuration.title"), DefaultRunExecutor.getRunExecutorInstance())) {
final List<BeforeRunTask> tasks = new ArrayList<>(manager.getBeforeRunTasks(settings.getConfiguration()));
manager.addConfiguration(settings, false, tasks, false);
manager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(project, settings, DefaultRunExecutor.getRunExecutorInstance());
}
}
use of com.intellij.execution.configurations.ConfigurationFactory in project azure-tools-for-java by Microsoft.
the class WebAppOnLinuxAction method runConfiguration.
@SuppressWarnings({ "deprecation", "Duplicates" })
private void runConfiguration(Module module) {
Project project = module.getProject();
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = configType.getWebAppOnLinuxDeployConfigurationFactory();
RunnerAndConfigurationSettings settings = manager.findConfigurationByName(String.format("%s: %s:%s", factory.getName(), project.getName(), module.getName()));
if (settings == null) {
settings = manager.createConfiguration(String.format("%s: %s:%s", factory.getName(), project.getName(), module.getName()), factory);
}
if (RunDialog.editConfiguration(project, settings, DIALOG_TITLE, DefaultRunExecutor.getRunExecutorInstance())) {
List<BeforeRunTask> tasks = new ArrayList<>(manager.getBeforeRunTasks(settings.getConfiguration()));
manager.addConfiguration(settings, false, tasks, false);
manager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(project, settings, DefaultRunExecutor.getRunExecutorInstance());
}
}
Aggregations