当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionEnvironment.getProject方法代码示例

本文整理汇总了Java中com.intellij.execution.runners.ExecutionEnvironment.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEnvironment.getProject方法的具体用法?Java ExecutionEnvironment.getProject怎么用?Java ExecutionEnvironment.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.runners.ExecutionEnvironment的用法示例。


在下文中一共展示了ExecutionEnvironment.getProject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRunner

import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@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());
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:27,代码来源:BlazeAndroidBinaryRunConfigurationHandler.java

示例2: createRunner

import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@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());
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:27,代码来源:BlazeAndroidTestRunConfigurationHandler.java

示例3: startDebugSession

import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public void startDebugSession(@NotNull JavaDebugConnectionData info, @NotNull ExecutionEnvironment executionEnvironment, @NotNull RemoteServer<?> server)
  throws ExecutionException {
  final Project project = executionEnvironment.getProject();
  final DebuggerPanelsManager manager = DebuggerPanelsManager.getInstance(project);
  final JavaDebugServerModeHandler serverModeHandler = info.getServerModeHandler();
  boolean serverMode = serverModeHandler != null;
  final RemoteConnection remoteConnection = new RemoteConnection(true, info.getHost(), String.valueOf(info.getPort()), serverMode);
  DebugEnvironment debugEnvironment = new RemoteServerDebugEnvironment(project, remoteConnection, executionEnvironment.getRunProfile());
  DebugUIEnvironment debugUIEnvironment = new RemoteServerDebugUIEnvironment(debugEnvironment, executionEnvironment);
  RunContentDescriptor debugContentDescriptor = manager.attachVirtualMachine(debugUIEnvironment);
  LOG.assertTrue(debugContentDescriptor != null);
  ProcessHandler processHandler = debugContentDescriptor.getProcessHandler();
  LOG.assertTrue(processHandler != null);
  if (serverMode) {
    serverModeHandler.attachRemote();
    DebuggerManager.getInstance(executionEnvironment.getProject())
      .addDebugProcessListener(processHandler, new DebugProcessAdapter() {
        public void processDetached(DebugProcess process, boolean closedByUser) {
          try {
            serverModeHandler.detachRemote();
          }
          catch (ExecutionException e) {
            LOG.info(e);
          }
        }
      });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:JavaDebuggerLauncherImpl.java

示例4: MyDebugLauncher

import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
public MyDebugLauncher(AndroidRunningState state,
                       ExecutionEnvironment environment) {
  myProject = environment.getProject();
  myRunningState = state;
  myEnvironment = environment;
  myExecutor = environment.getExecutor();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AndroidDebugRunner.java

示例5: executeBeforeRunTask

import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public boolean executeBeforeRunTask(ExecutionEnvironment env) {
  final Project project = env.getProject();
  BlazeConsolePopupBehavior consolePopupBehavior =
      BlazeUserSettings.getInstance().getSuppressConsoleForRunAction()
          ? BlazeConsolePopupBehavior.NEVER
          : BlazeConsolePopupBehavior.ALWAYS;
  return Scope.root(
      context -> {
        context
            .push(new IssuesScope(project))
            .push(new ExperimentScope())
            .push(
                new BlazeConsoleScope.Builder(project)
                    .setPopupBehavior(consolePopupBehavior)
                    .build())
            .push(new IdeaLogScope());

        BlazeAndroidRunContext runContext = env.getCopyableUserData(RUN_CONTEXT_KEY);
        if (runContext == null) {
          IssueOutput.error("Could not find run context. Please try again").submit(context);
          return false;
        }
        BlazeAndroidDeviceSelector.DeviceSession deviceSession =
            env.getCopyableUserData(DEVICE_SESSION_KEY);

        BlazeApkBuildStep buildStep = runContext.getBuildStep();
        try {
          return buildStep.build(context, deviceSession);
        } catch (Exception e) {
          LOG.error(e);
          return false;
        }
      });
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:36,代码来源:BlazeAndroidRunConfigurationRunner.java

示例6: executeTask

import com.intellij.execution.runners.ExecutionEnvironment; //导入方法依赖的package包/类
@Override
public boolean executeTask(DataContext dataContext, RunConfiguration runConfiguration, ExecutionEnvironment executionEnvironment, MuleBeforeRunTask muleBeforeRunTask)
{
    final Semaphore targetDone = new Semaphore();
    final List<Boolean> results = new ArrayList<>();

    final Project project = executionEnvironment.getProject();

    MuleConfiguration muleConfiguration = (MuleConfiguration) runConfiguration;

    Module[] modules = muleConfiguration.getModules();

    for (Module nextModule : modules) {
        //final MavenProject mavenProject = getMavenProject(runConfiguration, project);
        final MavenProject mavenProject = getMavenProject(nextModule);
        try {
            ApplicationManager.getApplication().invokeAndWait(new Runnable() {
                public void run() {
                    if (!project.isDisposed() && mavenProject != null) {
                        FileDocumentManager.getInstance().saveAllDocuments();
                        final MavenExplicitProfiles explicitProfiles = MavenProjectsManager.getInstance(project).getExplicitProfiles();
                        final MavenRunner mavenRunner = MavenRunner.getInstance(project);
                        targetDone.down();
                        (new Task.Backgroundable(project, TasksBundle.message("maven.tasks.executing"), true) {
                            public void run(@NotNull ProgressIndicator indicator) {
                                try {
                                    MavenRunnerParameters params =
                                            new MavenRunnerParameters(true, mavenProject.getDirectory(), ParametersListUtil.parse("package"), explicitProfiles.getEnabledProfiles(),
                                                    explicitProfiles.getDisabledProfiles());
                                    boolean result = mavenRunner.runBatch(Collections.singletonList(params), null, null, TasksBundle.message("maven.tasks.executing"), indicator);
                                    results.add(result);
                                } finally {
                                    targetDone.up();
                                }
                            }

                            public boolean shouldStartInBackground() {
                                return MavenRunner.getInstance(project).getSettings().isRunMavenInBackground();
                            }

                            public void processSentToBackground() {
                                MavenRunner.getInstance(project).getSettings().setRunMavenInBackground(true);
                            }
                        }).queue();
                    }
                }
            }, ModalityState.NON_MODAL);
        } catch (Exception exeception) {
            return false;
        }
        targetDone.waitFor();
    }

    boolean endResult = true;

    for (Boolean nextResult : results) {
        endResult = endResult && nextResult;
    }

    return endResult;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:62,代码来源:MuleBeforeRunTasksProvider.java


注:本文中的com.intellij.execution.runners.ExecutionEnvironment.getProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。