Search in sources :

Example 1 with PhoneGapRunConfiguration

use of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapRunConfiguration 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

PhoneGapConfigurationType (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapConfigurationType)1 PhoneGapRunConfiguration (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.runner.PhoneGapRunConfiguration)1 RunManager (com.intellij.execution.RunManager)1 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1