1 @file:JvmName("KotlinVersion") 2 isKotlinVersionAtLeastnull3fun isKotlinVersionAtLeast(kotlinVersion: String, atLeastMajor: Int, atLeastMinor: Int, atLeastPatch: Int): Boolean { 4 val (major, minor) = kotlinVersion 5 .split('.') 6 .take(2) 7 .map { it.toInt() } 8 val patch = kotlinVersion.substringAfterLast('.').substringBefore('-').toInt() 9 return when { 10 major > atLeastMajor -> true 11 major < atLeastMajor -> false 12 else -> (minor == atLeastMinor && patch >= atLeastPatch) || minor > atLeastMinor 13 } 14 } 15