Java Code Examples for com.intellij.execution.RunManager#createConfiguration()
The following examples show how to use
com.intellij.execution.RunManager#createConfiguration() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskUtils.java From JHelper with GNU Lesser General Public License v3.0 | 6 votes |
private static void createConfigurationForTask(Project project, TaskData taskData) { TaskConfigurationType configurationType = new TaskConfigurationType(); ConfigurationFactory factory = configurationType.getConfigurationFactories()[0]; RunManager manager = RunManager.getInstance(project); TaskConfiguration taskConfiguration = new TaskConfiguration( project, factory ); taskConfiguration.setFromTaskData(taskData); RunnerAndConfigurationSettings configuration = manager.createConfiguration( taskConfiguration, factory ); manager.addConfiguration(configuration, true); manager.setSelectedConfiguration(configuration); }
Example 2
Source File: HaxeModuleBuilder.java From intellij-haxe with Apache License 2.0 | 6 votes |
private void createDefaultRunConfiguration(Module module, String buildHxmlPath) { HaxeModuleSettings settings = HaxeModuleSettings.getInstance(module); settings.setHaxeTarget(HaxeTarget.INTERP); settings.setBuildConfig(HaxeConfiguration.HXML.asBuildConfigValue()); settings.setHxmlPath(buildHxmlPath); RunManager manager = RunManager.getInstance(module.getProject()); HaxeRunConfigurationType configType = HaxeRunConfigurationType.getInstance(); if(manager.getConfigurationsList(configType).isEmpty()) { ConfigurationFactory factory = configType.getConfigurationFactories()[0]; HaxeApplicationConfiguration config = (HaxeApplicationConfiguration)factory.createTemplateConfiguration(module.getProject()); config.setName("Execute"); config.setModule(module); RunnerAndConfigurationSettings runSettings = manager.createConfiguration(config, factory); manager.addConfiguration(runSettings, false); manager.setSelectedConfiguration(runSettings); } }
Example 3
Source File: HaxeProjectConfigurationUpdater.java From intellij-haxe with Apache License 2.0 | 6 votes |
private void setupHxmlRunConfigurations(Module module) { RunManager manager = RunManager.getInstance(module.getProject()); HaxeRunConfigurationType configType = HaxeRunConfigurationType.getInstance(); ConfigurationFactory factory = configType.getConfigurationFactories()[0]; HaxeModuleSettings settings = HaxeModuleSettings.getInstance(module); String hxmlPath = settings.getHxmlPath(); if(hxmlPath != null && !hxmlPath.isEmpty()) { HaxeApplicationConfiguration config = (HaxeApplicationConfiguration)factory.createTemplateConfiguration(module.getProject()); config.setName(module.getName() + " " + new File(hxmlPath).getName()); config.setModule(module); RunnerAndConfigurationSettings runSettings = manager.createConfiguration(config, factory); manager.addConfiguration(runSettings, false); manager.setSelectedConfiguration(runSettings); } }
Example 4
Source File: AndroidSyncTest.java From intellij with Apache License 2.0 | 5 votes |
public TestProjectArguments createTestProjectArguments() { Sdk android25 = MockSdkUtil.registerSdk(workspace, "25"); RunManager runManager = RunManagerImpl.getInstanceImpl(getProject()); RunnerAndConfigurationSettings runnerAndConfigurationSettings = runManager.createConfiguration( "Blaze Android Binary Run Configuration", BlazeCommandRunConfigurationType.getInstance().getFactory()); runManager.addConfiguration(runnerAndConfigurationSettings, false); BlazeCommandRunConfiguration configuration = (BlazeCommandRunConfiguration) runnerAndConfigurationSettings.getConfiguration(); TargetInfo target = TargetInfo.builder( Label.create("//java/com/android:app"), ANDROID_BINARY.getKind().getKindString()) .build(); configuration.setTargetInfo(target); workspace.createFile( new WorkspacePath("java/com/google/Source.java"), "package com.google;", "public class Source {}"); workspace.createFile( new WorkspacePath("java/com/google/Other.java"), "package com.google;", "public class Other {}"); VirtualFile javaRoot = workspace.createDirectory(new WorkspacePath("java/com/google")); TargetMap targetMap = targetMap( android_library("//java/com/google:lib") .java_toolchain_version("8") .res("res/values/strings.xml") .src("Source.java", "Other.java"), android_binary("//java/com/android:app")); return new TestProjectArguments(android25, targetMap, javaRoot); }
Example 5
Source File: BlazeRunConfigurationFactory.java From intellij with Apache License 2.0 | 5 votes |
/** Constructs and initializes {@link RunnerAndConfigurationSettings} for the given rule. */ public RunnerAndConfigurationSettings createForTarget( Project project, RunManager runManager, Label target) { ConfigurationFactory factory = getConfigurationFactory(); RunConfiguration configuration = factory.createTemplateConfiguration(project, runManager); setupConfiguration(configuration, target); return runManager.createConfiguration(configuration, factory); }