Fixed issues when kotlin version is based on java version, and the java version is 1.9 (only 1.6, 1.8 are supported for the 1.x series. 1.9 MUST be 9)

master
Robinson 2022-03-03 01:15:15 +01:00
parent 824a9aba08
commit 01d4fa1f80
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 11 additions and 1 deletions

View File

@ -521,7 +521,17 @@ open class StaticMethodsAndTools(private val project: Project) {
kotlinJavaVersion: JavaVersion = javaVersion,
kotlinActions: KotlinJvmOptions.() -> Unit = {}) {
val javaVer = javaVersion.toString()
val kotlinJavaVer = kotlinJavaVersion.toString()
val kotlinJavaVer = kotlinJavaVersion.toString().also {
if (it.startsWith("1.")) {
if (it == "1.6" || it == "1.8") {
it
} else {
it.substring(2)
}
} else {
it
}
}
val kotlinVer: String = try {
if (hasKotlin) {