private void ensureMainClassHasBeenFound(Project project, Task task) { task.dependsOn(project.getTasks().withType(FindMainClassTask.class)); }