configure(subprojects.findAll { it.buildFile.exists() }) { subproj ->
    apply plugin: "kotlin"

    sourceSets {
        main {
            kotlin {
                srcDirs += "src"
            }
        }

        test {
            kotlin {
                srcDirs += "test"
            }
        }
    }

    tasks.withType(Test) {
        useJUnitPlatform()
    }

    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }

    dependencies {
        kotlinScriptDef(":game")
        implementation group: 'com.google.guava', name: 'guava', version: guavaVersion
    }
}
