Commit 308d9816 authored by Georg Koppen's avatar Georg Koppen Committed by Matthew Finkel
Browse files

Bug 40083: Make locale ordering in BuildConfig deterministic

parent 46227efe
......@@ -608,16 +608,22 @@ task buildTranslationArray {
// This isn't running as a task, instead the array is build when the gradle file is parsed.
def foundLocales = new StringBuilder()
def languageCodes = []
foundLocales.append("new String[]{")
fileTree("src/main/res").visit { FileVisitDetails details ->
def languageCode = details.file.parent.tokenize(File.separator).last().replaceAll('values-','').replaceAll('-r','-')
languageCode = (languageCode == "values") ? "en-US" : languageCode
// The order of files in a `FileTree` is not stable, even on a single
// computer. Thus we need to sort the `languageCode`s. See: fenix#40083.
languageCodes.each {
def foundLocalesString = foundLocales.toString().replaceAll(',}','}')
android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment