void (@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); } } }