jlleitschuh
08/18/2017, 2:45 PMcheck or build task if you have subprojects that apply the java plugin but the root project doesn't apply the java plugin?
val checkTask = task("check") {
    description = "Check all sub-projects"
    group = "verification"
}
val buildTask = task("build") {
    description = "Build all sub-projects"
    group = "build"
    dependsOn(checkTask)
}
configure(javaProjects + kotlinProjects) {
    checkTask.dependsOn(tasks.getByName("check"))
    buildTask.dependsOn(tasks.getByName("build"))
}
afterEvaluate {
    checkTask.dependsOn("spotlessCheck")
}
Because the root project doesn't actually have the check or build task. Even though you can run ./gradlew build against the root project.