Conditionally apply Kotlin if not using JDK 9

Kotlin does not yet work with JDK 9, so we need to disable the Kotlin
plugin if we are using JDK 9.
This commit is contained in:
Rob Winch 2017-06-13 09:45:27 -05:00
parent 03133630cb
commit f092ae567b
1 changed files with 10 additions and 8 deletions

View File

@ -109,15 +109,17 @@ configure(allprojects) { project ->
apply from: "${gradleScriptDir}/ide.gradle"
apply from: "${gradleScriptDir}/sniffer.gradle"
apply plugin: "kotlin"
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check"]
if(!JavaVersion.current().java9Compatible) {
apply plugin: "kotlin"
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check"]
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check"]
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xskip-runtime-version-check"]
}
}
configurations.all {