com.intellij.execution.filters.TextConsoleBuilderImpl Java Examples

The following examples show how to use com.intellij.execution.filters.TextConsoleBuilderImpl. 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: DaemonConsoleView.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Sets up a launcher to use a DaemonConsoleView.
 */
public static void install(@NotNull CommandLineState launcher, @NotNull ExecutionEnvironment env, @NotNull VirtualFile workDir) {
  // Create our own console builder.
  //
  // We need to filter input to this console without affecting other consoles, so we cannot use
  // a consoleFilterInputProvider.
  final GlobalSearchScope searchScope = SearchScopeProvider.createSearchScope(env.getProject(), env.getRunProfile());
  final TextConsoleBuilder builder = new TextConsoleBuilderImpl(env.getProject(), searchScope) {
    @NotNull
    @Override
    protected ConsoleView createConsole() {
      return new DaemonConsoleView(env.getProject(), searchScope);
    }
  };

  // Set up basic console filters. (More may be added later.)
  // TODO(devoncarew): Do we need this filter? What about DartConsoleFilter (for package: uris)?
  builder.addFilter(new DartRelativePathsConsoleFilter(env.getProject(), workDir.getPath()));
  launcher.setConsoleBuilder(builder);
}
 
Example #2
Source File: DaemonConsoleView.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Sets up a launcher to use a DaemonConsoleView.
 */
public static void install(@NotNull CommandLineState launcher, @NotNull ExecutionEnvironment env, @NotNull VirtualFile workDir) {
  // Create our own console builder.
  //
  // We need to filter input to this console without affecting other consoles, so we cannot use
  // a consoleFilterInputProvider.
  final GlobalSearchScope searchScope = SearchScopeProvider.createSearchScope(env.getProject(), env.getRunProfile());
  final TextConsoleBuilder builder = new TextConsoleBuilderImpl(env.getProject(), searchScope) {
    @NotNull
    @Override
    protected ConsoleView createConsole() {
      return new DaemonConsoleView(env.getProject(), searchScope);
    }
  };

  // Set up basic console filters. (More may be added later.)
  // TODO(devoncarew): Do we need this filter? What about DartConsoleFilter (for package: uris)?
  builder.addFilter(new DartRelativePathsConsoleFilter(env.getProject(), workDir.getPath()));
  launcher.setConsoleBuilder(builder);
}
 
Example #3
Source File: FastBuildRunProfileState.java    From intellij with Apache License 2.0 4 votes vote down vote up
@Override
protected ProcessHandler startProcess() throws ExecutionException {
  File outputFile = createOutputFile();
  Project project = getConfiguration().getProject();
  Label label = getLabel();
  BlazeTestUiSession testUiSession =
      BlazeTestUiSession.create(
          /* blazeFlags= */ ImmutableList.of(),
          new FastBuildTestResultFinderStrategy(
              label, getConfiguration().getTargetKind(), outputFile, getBlazeContext()));
  setConsoleBuilder(
      new TextConsoleBuilderImpl(project) {
        @Override
        protected ConsoleView createConsole() {
          return SmRunnerUtils.getConsoleView(
              project, getConfiguration(), getEnvironment().getExecutor(), testUiSession);
        }
      });

  BlazeJavaRunConfigState handlerState =
      (BlazeJavaRunConfigState) getConfiguration().getHandler().getState();

  int debugPort = -1;
  if (getExecutorType().isDebugType()) {
    debugPort = handlerState.getDebugPortState().port;
  }

  FastBuildTestEnvironmentCreator testEnvironmentCreator =
      FastBuildTestEnvironmentCreator.getInstance(Blaze.getBuildSystem(project));

  GeneralCommandLine commandLine =
      testEnvironmentCreator.createCommandLine(
          project,
          getConfiguration(),
          getFastBuildInfo(),
          outputFile,
          handlerState.getTestFilterForExternalProcesses(),
          debugPort);

  Stopwatch timer = Stopwatch.createStarted();
  OSProcessHandler processHandler = JavaCommandLineStateUtil.startProcess(commandLine);
  processHandler.addProcessListener(new LoggingProcessListener(commandLine, timer));
  return processHandler;
}