Search in sources :

Example 51 with RunnerAndConfigurationSettings

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);
}
Also used : DartCommandLineRunConfiguration(com.jetbrains.lang.dart.ide.runner.server.DartCommandLineRunConfiguration) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RunManager(com.intellij.execution.RunManager)

Example 52 with RunnerAndConfigurationSettings

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());
}
Also used : RemoteConfiguration(com.intellij.execution.remote.RemoteConfiguration) ConfigurationFactory(com.intellij.execution.configurations.ConfigurationFactory) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RemoteConfigurationType(com.intellij.execution.remote.RemoteConfigurationType)

Example 53 with RunnerAndConfigurationSettings

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;
}
Also used : PreferableRunConfiguration(com.intellij.javascript.testFramework.PreferableRunConfiguration) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RunManager(com.intellij.execution.RunManager) Nullable(org.jetbrains.annotations.Nullable)

Example 54 with RunnerAndConfigurationSettings

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;
}
Also used : RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings)

Example 55 with RunnerAndConfigurationSettings

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);
}
Also used : PhoneGapConfigurationType(com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapConfigurationType) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) PhoneGapRunConfiguration(com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapRunConfiguration) RunManager(com.intellij.execution.RunManager)

Aggregations

RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)104 Project (com.intellij.openapi.project.Project)24 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)16 RunManagerEx (com.intellij.execution.RunManagerEx)14 Nullable (org.jetbrains.annotations.Nullable)14 RunManager (com.intellij.execution.RunManager)12 VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 Module (com.intellij.openapi.module.Module)10 NotNull (org.jetbrains.annotations.NotNull)9 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)7 ConfigurationType (com.intellij.execution.configurations.ConfigurationType)7 ExternalSystemRunConfiguration (com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration)7 ExternalSystemTaskExecutionSettings (com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings)6 Executor (com.intellij.execution.Executor)4 RunManagerImpl (com.intellij.execution.impl.RunManagerImpl)4 AbstractExternalSystemTaskConfigurationType (com.intellij.openapi.externalSystem.service.execution.AbstractExternalSystemTaskConfigurationType)4 ExternalSystemNode (com.intellij.openapi.externalSystem.view.ExternalSystemNode)4 RunConfigurationNode (com.intellij.openapi.externalSystem.view.RunConfigurationNode)4 PsiElement (com.intellij.psi.PsiElement)4 ConfigurationContext (com.intellij.execution.actions.ConfigurationContext)3