Search in sources :

Example 16 with RunManager

use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.

the class FlexRenameTest method testRunConfigUpdatedOnBcRename.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testRunConfigUpdatedOnBcRename() throws Exception {
    final RunManager runManager = RunManager.getInstance(myProject);
    FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeTest.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "SomeTest", "testSomething", true);
    FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass", true);
    final String newBcName = "Abcde";
    FlexTestUtils.modifyBuildConfiguration(myModule, configuration -> configuration.setName(newBcName));
    assertEquals(newBcName, FlexBuildConfigurationManager.getInstance(myModule).getActiveConfiguration().getName());
    FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeTest.testSomething()", "", "SomeTest", "testSomething");
    FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass");
}
Also used : RunManager(com.intellij.execution.RunManager)

Example 17 with RunManager

use of com.intellij.execution.RunManager 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)

Example 18 with RunManager

use of com.intellij.execution.RunManager 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)

Aggregations

RunManager (com.intellij.execution.RunManager)18 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)11 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)3 Nullable (org.jetbrains.annotations.Nullable)3 JSTestOptions (com.intellij.lang.javascript.JSTestOptions)2 Project (com.intellij.openapi.project.Project)2 NotNull (org.jetbrains.annotations.NotNull)2 AndroidRunConfiguration (com.android.tools.idea.run.AndroidRunConfiguration)1 AndroidRunConfigurationBase (com.android.tools.idea.run.AndroidRunConfigurationBase)1 AndroidRunConfigurationType (com.android.tools.idea.run.AndroidRunConfigurationType)1 TargetSelectionMode (com.android.tools.idea.run.TargetSelectionMode)1 PhoneGapConfigurationType (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapConfigurationType)1 PhoneGapRunConfiguration (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapRunConfiguration)1 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)1 ConfigurationType (com.intellij.execution.configurations.ConfigurationType)1 WebBrowser (com.intellij.ide.browsers.WebBrowser)1 UsageDescriptor (com.intellij.internal.statistic.beans.UsageDescriptor)1 JavaScriptDebugConfiguration (com.intellij.javascript.debugger.execution.JavaScriptDebugConfiguration)1 PreferableRunConfiguration (com.intellij.javascript.testFramework.PreferableRunConfiguration)1 FlashRunConfiguration (com.intellij.lang.javascript.flex.run.FlashRunConfiguration)1