private static void refreshProjectTasks(@NotNull Project project) {
    TaskContainer tasks = project.getTasks();
    if (tasks instanceof DefaultTaskContainer) {
      ((DefaultTaskContainer)tasks).discoverTasks();
      SortedSet<String> taskNames = tasks.getNames();
      for (String taskName : taskNames) {
        tasks.findByName(taskName);
      }
    }
  }
private static void refreshProjectTasks(@NotNull Project project)