Search in sources :

Example 1 with BlazeAndroidRunContext

use of com.google.idea.blaze.android.run.runner.BlazeAndroidRunContext in project intellij by bazelbuild.

the class BlazeAndroidBinaryRunConfigurationHandler method createRunner.

@Override
public BlazeCommandRunConfigurationRunner createRunner(Executor executor, ExecutionEnvironment environment) throws ExecutionException {
    Project project = environment.getProject();
    Module module = getModule();
    AndroidFacet facet = module != null ? AndroidFacet.getInstance(module) : null;
    ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
    BlazeAndroidRunConfigurationValidationUtil.validateExecution(module, facet, projectViewSet);
    ImmutableList<String> blazeFlags = configState.getCommonState().getExpandedBuildFlags(project, projectViewSet, BlazeCommandName.RUN);
    ImmutableList<String> exeFlags = ImmutableList.copyOf(configState.getCommonState().getExeFlagsState().getExpandedFlags());
    BlazeAndroidRunContext runContext = createRunContext(project, facet, environment, blazeFlags, exeFlags);
    return new BlazeAndroidRunConfigurationRunner(module, runContext, getCommonState().getDeployTargetManager(), getCommonState().getDebuggerManager(), configuration.getUniqueID());
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) Project(com.intellij.openapi.project.Project) BlazeAndroidRunConfigurationRunner(com.google.idea.blaze.android.run.runner.BlazeAndroidRunConfigurationRunner) Module(com.intellij.openapi.module.Module) BlazeAndroidRunContext(com.google.idea.blaze.android.run.runner.BlazeAndroidRunContext) AndroidFacet(org.jetbrains.android.facet.AndroidFacet)

Example 2 with BlazeAndroidRunContext

use of com.google.idea.blaze.android.run.runner.BlazeAndroidRunContext in project intellij by bazelbuild.

the class BlazeAndroidTestRunConfigurationHandler method createRunner.

@Override
public BlazeCommandRunConfigurationRunner createRunner(Executor executor, ExecutionEnvironment environment) throws ExecutionException {
    Project project = environment.getProject();
    Module module = getModule();
    AndroidFacet facet = module != null ? AndroidFacet.getInstance(module) : null;
    ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
    BlazeAndroidRunConfigurationValidationUtil.validateExecution(module, facet, projectViewSet);
    ImmutableList<String> blazeFlags = configState.getCommonState().getExpandedBuildFlags(project, projectViewSet, BlazeCommandName.TEST);
    ImmutableList<String> exeFlags = ImmutableList.copyOf(configState.getCommonState().getExeFlagsState().getExpandedFlags());
    BlazeAndroidRunContext runContext = createRunContext(project, facet, environment, blazeFlags, exeFlags);
    return new BlazeAndroidRunConfigurationRunner(module, runContext, getCommonState().getDeployTargetManager(), getCommonState().getDebuggerManager(), configuration.getUniqueID());
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) Project(com.intellij.openapi.project.Project) BlazeAndroidRunConfigurationRunner(com.google.idea.blaze.android.run.runner.BlazeAndroidRunConfigurationRunner) Module(com.intellij.openapi.module.Module) BlazeAndroidRunContext(com.google.idea.blaze.android.run.runner.BlazeAndroidRunContext) AndroidFacet(org.jetbrains.android.facet.AndroidFacet)

Aggregations

BlazeAndroidRunConfigurationRunner (com.google.idea.blaze.android.run.runner.BlazeAndroidRunConfigurationRunner)2 BlazeAndroidRunContext (com.google.idea.blaze.android.run.runner.BlazeAndroidRunContext)2 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)2 Module (com.intellij.openapi.module.Module)2 Project (com.intellij.openapi.project.Project)2 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)2