[Gradle] Replace deprecated String::capitalize with capitalizeAsciiOnly

This should prevent issues when ascii characters are uppercased or
lowercased on users machines with their locales.

For example in Turkish locale:
* 'i' uppercases to 'İ'
* 'I' lowercases to 'ı'

^KT-38712 Verification Pending
This commit is contained in:
Anton Lakotka
2022-12-07 10:41:39 +01:00
committed by Space Team
parent 7ef858b2fe
commit 1d041b7ef4
11 changed files with 27 additions and 15 deletions
@@ -5,6 +5,8 @@
package org.jetbrains.kotlin.gradle.plugin
import java.util.*
enum class KotlinJsCompilerType {
LEGACY,
IR,
@@ -33,5 +35,5 @@ fun String.removeJsCompilerSuffix(compilerType: KotlinJsCompilerType): String {
return truncatedString
}
return removeSuffix(compilerType.lowerName.capitalize())
return removeSuffix(compilerType.lowerName.capitalize(Locale.ENGLISH))
}