Remove platform comparisons based on string dictionary order (KT-30356)
Comparison was changed in https://github.com/JetBrains/kotlin/commit/fac356c690891236dc7a97d82c2a6a8e1d33bcfd#diff-0895a6eaf69b9fd4d43f83db9889d103R109
#KT-30356 Fixed
Original commit: 03c6e23448
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
*/
|
||||
|
||||
@file:JvmName("JvmIdePlatformUtil")
|
||||
|
||||
package org.jetbrains.kotlin.platform.impl
|
||||
|
||||
import com.intellij.util.text.VersionComparatorUtil
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||
import org.jetbrains.kotlin.config.JvmTarget
|
||||
@@ -18,7 +20,9 @@ object JvmIdePlatformKind : IdePlatformKind<JvmIdePlatformKind>() {
|
||||
override fun platformByCompilerArguments(arguments: CommonCompilerArguments): IdePlatform<JvmIdePlatformKind, CommonCompilerArguments>? {
|
||||
return if (arguments is K2JVMCompilerArguments) {
|
||||
val jvmTarget = arguments.jvmTarget ?: JvmTarget.DEFAULT.description
|
||||
JvmIdePlatformKind.platforms.firstOrNull { it.version.description >= jvmTarget }
|
||||
platforms.firstOrNull { platform ->
|
||||
VersionComparatorUtil.COMPARATOR.compare(platform.version.description, jvmTarget) >= 0
|
||||
}
|
||||
} else null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user