use of com.intellij.execution.configurations.ConfigurationFactory in project android by JetBrains.
the class AndroidRunConfigurations method createRunConfiguration.
public void createRunConfiguration(@NotNull AndroidFacet facet) {
Module module = facet.getModule();
ConfigurationFactory configurationFactory = AndroidRunConfigurationType.getInstance().getFactory();
List<RunConfiguration> configurations = RunManager.getInstance(module.getProject()).getConfigurationsList(configurationFactory.getType());
for (RunConfiguration configuration : configurations) {
if (configuration instanceof AndroidRunConfiguration && ((AndroidRunConfiguration) configuration).getConfigurationModule().getModule() == module) {
// There is already a run configuration for this module.
return;
}
}
addRunConfiguration(facet, null, TargetSelectionMode.SHOW_DIALOG, null);
}
use of com.intellij.execution.configurations.ConfigurationFactory in project android by JetBrains.
the class PostSyncProjectSetupTest method testJUnitRunConfigurationSetup.
public void testJUnitRunConfigurationSetup() {
when(myIdeInfo.isAndroidStudio()).thenReturn(true);
PostSyncProjectSetup.Request request = new PostSyncProjectSetup.Request();
mySetup.setUpProject(request, myProgressIndicator);
ConfigurationFactory configurationFactory = AndroidJUnitConfigurationType.getInstance().getConfigurationFactories()[0];
AndroidJUnitConfiguration jUnitConfiguration = new AndroidJUnitConfiguration("", getProject(), configurationFactory);
myRunManager.addConfiguration(myRunManager.createConfiguration(jUnitConfiguration, configurationFactory), true);
List<RunConfiguration> junitRunConfigurations = myRunManager.getConfigurationsList(AndroidJUnitConfigurationType.getInstance());
for (RunConfiguration runConfiguration : junitRunConfigurations) {
assertSize(1, myRunManager.getBeforeRunTasks(runConfiguration));
assertEquals(MakeBeforeRunTaskProvider.ID, myRunManager.getBeforeRunTasks(runConfiguration).get(0).getProviderId());
}
RunConfiguration runConfiguration = junitRunConfigurations.get(0);
List<BeforeRunTask> tasks = new LinkedList<>(myRunManager.getBeforeRunTasks(runConfiguration));
BeforeRunTask newTask = new MakeBeforeRunTaskProvider(getProject()).createTask(runConfiguration);
newTask.setEnabled(true);
tasks.add(newTask);
myRunManager.setBeforeRunTasks(runConfiguration, tasks, false);
mySetup.setUpProject(request, myProgressIndicator);
assertSize(2, myRunManager.getBeforeRunTasks(runConfiguration));
}
use of com.intellij.execution.configurations.ConfigurationFactory in project intellij-plugins by JetBrains.
the class SimulatorRakeConsoleModifier method createConsoleBuilder.
@NotNull
@Override
public TextConsoleBuilder createConsoleBuilder(@NotNull RakeRunConfiguration config) {
if (onDevice(config)) {
return TextConsoleBuilderFactory.getInstance().createBuilder(config.getProject());
}
final ConfigurationFactory factory = IrbRunConfigurationType.getInstance().getConfigurationFactories()[0];
final Project project = config.getProject();
return new IrbConsoleBuilder(project, (IrbRunConfiguration) factory.createTemplateConfiguration(project));
}
Aggregations