import org.gradle.api.tasks.GradleBuild

fun isProjectDir(candidate: File) =
    File(candidate, "settings.gradle").isFile

fun isCompatibleWithJDK(candidate: File) =
    candidate.name.endsWith("kotlin-1.0") && JavaVersion.current() < JavaVersion.VERSION_1_9

val subProjectTasks = rootDir
    .listFiles()
    .filter { isProjectDir(it) }
    .filter { isCompatibleWithJDK(it) }
    .map { subProjectDir ->
        task<GradleBuild>("prepare-${subProjectDir.name}") {
            dir = subProjectDir
        }
    }

defaultTasks = subProjectTasks.map { it.name }

import org.gradle.api.tasks.GradleBuild

fun isProjectDir(candidate: File) =
    File(candidate, "settings.gradle.kts").isFile

fun isCompatibleWithJDK(candidate: File) =
    candidate.name.endsWith("kotlin-1.0") && JavaVersion.current() < JavaVersion.VERSION_1_9

val subProjectTasks = rootDir
    .listFiles()
    .filter { isProjectDir(it) }
    .filter { isCompatibleWithJDK(it) }
    .map { subProjectDir ->
        task<GradleBuild>("prepare-${subProjectDir.name}") {
            dir = subProjectDir
        }
    }

defaultTasks = subProjectTasks.map { it.name }

Revert "Follow up on 4d8cba5"
Revert "Follow up on 4d8cba5"

This reverts commit fd65240af9cd715e0e51213adb0cf70d302c20a0.

blindpirate/gradle,gradle/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle-script-kotlin,robinverduijn/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,blindpirate/gradle,robinverduijn/gradle,robinverduijn/gradle,gradle/gradle-script-kotlin,robinverduijn/gradle,gradle/gradle,robinverduijn/gradle