Skip to content

Commit 05b449b

Browse files
cortinicofacebook-github-bot
authored andcommitted
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
1 parent 022f188 commit 05b449b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ import com.facebook.react.utils.detectedCliPath
1717
import com.facebook.react.utils.detectedEntryFile
1818
import com.facebook.react.utils.detectedHermesCommand
1919
import java.io.File
20+
import java.util.*
2021
import org.gradle.api.Project
2122
import org.gradle.api.tasks.Copy
2223

2324
private const val REACT_GROUP = "react"
2425

2526
@Suppress("SpreadOperator")
2627
internal fun Project.configureReactTasks(variant: BaseVariant, config: ReactAppExtension) {
27-
val targetName = variant.name.capitalize()
28+
val targetName = variant.name.capitalize(Locale.ROOT)
2829
val isRelease = variant.isRelease
2930
val targetPath = variant.dirName
3031

@@ -239,4 +240,4 @@ private fun BaseVariant.checkBundleEnabled(config: ReactAppExtension): Boolean {
239240
}
240241

241242
private val BaseVariant.isRelease: Boolean
242-
get() = name.toLowerCase().contains("release")
243+
get() = name.toLowerCase(Locale.ROOT).contains("release")

0 commit comments

Comments
 (0)