Skip to content

Commit

Permalink
Use Locale.ROOT for capitalization of variant names
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cortinico authored and facebook-github-bot committed Sep 15, 2021
1 parent 022f188 commit 05b449b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ 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

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

Expand Down Expand Up @@ -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")

0 comments on commit 05b449b

Please sign in to comment.