Use Locale.ROOT for capitalization of variant names

Summary:
The IDE is complainign as we're using capitalization functions that
are not locale-independent. I'm changing this to use `Locale.ROOT`.
Once we move to Kotlin 1.5 we're going to replace those functions with newer ones.

Changelog:
[Internal] [Changed] - Use Locale.ROOT for capitalization of variant names

Reviewed By: ShikaSD

Differential Revision: D30958992

fbshipit-source-id: 225af4e7e323f143ab75bad106f3bca3db510b22
This commit is contained in:
Nicola Corti
2021-09-15 09:32:55 -07:00
committed by Facebook GitHub Bot
parent 022f188750
commit 05b449baf2
@@ -17,6 +17,7 @@ import com.facebook.react.utils.detectedCliPath
import com.facebook.react.utils.detectedEntryFile
import com.facebook.react.utils.detectedHermesCommand
import java.io.File
import java.util.*
import org.gradle.api.Project
import org.gradle.api.tasks.Copy
@@ -24,7 +25,7 @@ private const val REACT_GROUP = "react"
@Suppress("SpreadOperator")
internal fun Project.configureReactTasks(variant: BaseVariant, config: ReactAppExtension) {
val targetName = variant.name.capitalize()
val targetName = variant.name.capitalize(Locale.ROOT)
val isRelease = variant.isRelease
val targetPath = variant.dirName
@@ -239,4 +240,4 @@ private fun BaseVariant.checkBundleEnabled(config: ReactAppExtension): Boolean {
}
private val BaseVariant.isRelease: Boolean
get() = name.toLowerCase().contains("release")
get() = name.toLowerCase(Locale.ROOT).contains("release")