mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-09-29 23:40:46 +00:00
22 lines
669 B
Plaintext
22 lines
669 B
Plaintext
|
import cc.tweaked.gradle.CCTweakedPlugin
|
||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||
|
|
||
|
plugins {
|
||
|
kotlin("jvm")
|
||
|
}
|
||
|
|
||
|
kotlin {
|
||
|
jvmToolchain {
|
||
|
languageVersion.set(CCTweakedPlugin.JAVA_VERSION)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
tasks.withType(KotlinCompile::class.java).configureEach {
|
||
|
// So technically we shouldn't need to do this as the toolchain sets it above. However, the option only appears
|
||
|
// to be set when the task executes, so doesn't get picked up by IDEs.
|
||
|
kotlinOptions.jvmTarget = when {
|
||
|
CCTweakedPlugin.JAVA_VERSION.asInt() > 8 -> CCTweakedPlugin.JAVA_VERSION.toString()
|
||
|
else -> "1.${CCTweakedPlugin.JAVA_VERSION.asInt()}"
|
||
|
}
|
||
|
}
|