當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。