use of com.intellij.execution.BeforeRunTask in project azure-tools-for-java by microsoft.
the class PushImageAction method runConfiguration.
@SuppressWarnings({ "deprecation", "Duplicates" })
private void runConfiguration(Module module) {
Project project = module.getProject();
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = configType.getPushImageRunConfigurationFactory();
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());
}
}
use of com.intellij.execution.BeforeRunTask in project azure-tools-for-java by microsoft.
the class RunOnDockerHostAction method runConfiguration.
@SuppressWarnings({ "deprecation", "Duplicates" })
private void runConfiguration(Module module) {
Project project = module.getProject();
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = configType.getDockerHostRunConfigurationFactory();
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