use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-plugins by JetBrains.
the class DartProjectTemplate method createCmdLineRunConfiguration.
static void createCmdLineRunConfiguration(@NotNull final Module module, @NotNull final VirtualFile mainDartFile) {
DartModuleBuilder.runWhenNonModalIfModuleNotDisposed(() -> {
final RunManager runManager = RunManager.getInstance(module.getProject());
final RunnerAndConfigurationSettings settings = runManager.createRunConfiguration("", DartCommandLineRunConfigurationType.getInstance().getConfigurationFactories()[0]);
final DartCommandLineRunConfiguration runConfiguration = (DartCommandLineRunConfiguration) settings.getConfiguration();
runConfiguration.getRunnerParameters().setFilePath(mainDartFile.getPath());
runConfiguration.getRunnerParameters().setWorkingDirectory(DartCommandLineRunnerParameters.suggestDartWorkingDir(module.getProject(), mainDartFile));
settings.setName(runConfiguration.suggestedName());
runManager.addConfiguration(settings, false);
runManager.setSelectedConfiguration(settings);
}, module);
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project android by JetBrains.
the class AndroidJavaDebugger method attachToClient.
@Override
public void attachToClient(@NotNull Project project, @NotNull Client client) {
String debugPort = getClientDebugPort(client);
String runConfigName = String.format(RUN_CONFIGURATION_NAME_PATTERN, debugPort);
// Try to find existing debug session
if (hasExistingDebugSession(project, debugPort, runConfigName)) {
return;
}
// Create run configuration
RemoteConfigurationType remoteConfigurationType = RemoteConfigurationType.getInstance();
ConfigurationFactory factory = remoteConfigurationType.getFactory();
RunnerAndConfigurationSettings runSettings = RunManager.getInstance(project).createRunConfiguration(runConfigName, factory);
RemoteConfiguration configuration = (RemoteConfiguration) runSettings.getConfiguration();
configuration.HOST = "localhost";
configuration.PORT = debugPort;
configuration.USE_SOCKET_TRANSPORT = true;
configuration.SERVER_MODE = false;
ProgramRunnerUtil.executeConfiguration(project, runSettings, DefaultDebugExecutor.getDebugExecutorInstance());
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-plugins by JetBrains.
the class KarmaRunConfiguration method getTemplateRunConfiguration.
@Nullable
private static KarmaRunConfiguration getTemplateRunConfiguration(@NotNull Project project) {
if (project.isDisposed()) {
return null;
}
RunManager runManager = RunManager.getInstance(project);
RunnerAndConfigurationSettings templateSettings = runManager.getConfigurationTemplate(KarmaConfigurationType.getFactory());
RunConfiguration rc = templateSettings.getConfiguration();
if (rc instanceof KarmaRunConfiguration) {
return (KarmaRunConfiguration) rc;
}
LOG.warn("No Karma template run configuration found: " + rc);
return null;
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-plugins by JetBrains.
the class RubyMotionUtilExt method createAndAddRakeConfiguration.
private static RunnerAndConfigurationSettings createAndAddRakeConfiguration(final String taskFullName, final Module module, final RunManager runManager) {
final RunnerAndConfigurationSettings settings = RakeRunConfigurationType.getInstance().getRakeFactory().createConfigurationSettings(module, taskFullName, ArrayUtil.EMPTY_STRING_ARRAY, Collections.emptyMap());
runManager.addConfiguration(settings, false);
return settings;
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-plugins by JetBrains.
the class PhoneGapProjectTemplateGenerator method createRunConfiguration.
private static void createRunConfiguration(@NotNull Project project, @NotNull PhoneGapProjectSettings settings) {
final RunManager runManager = RunManager.getInstance(project);
PhoneGapConfigurationType configurationType = ConfigurationTypeUtil.findConfigurationType(PhoneGapConfigurationType.class);
RunnerAndConfigurationSettings configuration = runManager.createRunConfiguration(PhoneGapBundle.message("phonegap.project.template.create.run.configuration.title"), configurationType.getConfigurationFactories()[0]);
PhoneGapRunConfiguration runConfiguration = (PhoneGapRunConfiguration) configuration.getConfiguration();
runConfiguration.setExecutable(settings.executable);
runConfiguration.setWorkDir(project.getBasePath());
runConfiguration.setPlatform(SystemInfo.isMac ? PhoneGapRunConfigurationEditor.PLATFORM_IOS : PhoneGapRunConfigurationEditor.PLATFORM_ANDROID);
runConfiguration.setCommand(PhoneGapCommandLine.COMMAND_EMULATE);
runManager.addConfiguration(configuration, false);
runManager.setSelectedConfiguration(configuration);
}
Aggregations