private boolean executeCompileTasks(@NotNull final CompileContext context, final boolean beforeTasks) {
    if (myProject.isDisposed()) {
      return false;
    }

    final CompilerManager manager = CompilerManager.getInstance(myProject);
    final ProgressIndicator progressIndicator = context.getProgressIndicator();
    progressIndicator.pushState();
    final Project project = context.getProject();
    try {
      List<CompileTask> tasks = beforeTasks ? manager.getBeforeTasks() : manager.getAfterTaskList();
      if (!tasks.isEmpty()) {
        final StructuredIdeActivity activity = BuildUsageCollector.logCompileTasksStarted(project, beforeTasks);
        progressIndicator.setText(
          JavaCompilerBundle.message(beforeTasks ? "progress.executing.precompile.tasks" : "progress.executing.postcompile.tasks")
        );
        for (CompileTask task : tasks) {
          try {
            if (!task.execute(context)) {
              return false;
            }
          }
          catch (ProcessCanceledException e) {
            throw e;
          }
          catch (Throwable t) {
            LOG.error("Error executing task", t);
            context.addMessage(
              CompilerMessageCategory.INFORMATION, JavaCompilerBundle.message("error.task.0.execution.failed", task.toString()), null, -1, -1
            );
          }
        }
        BuildUsageCollector.logCompileTasksCompleted(activity, beforeTasks);
      }
    }
    finally {
      progressIndicator.popState();
      StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
      if (statusBar != null) {
        statusBar.setInfo("");
      }
    }
    return true;
  }
private boolean executeCompileTasks(@NotNull final CompileContext context, final boolean beforeTasks)