[tbb-commits] [Git][tpo/applications/fenix][tor-browser-82.0.0b4-10.0-1] 2 commits: Bug 40083: Make locale ordering in BuildConfig deterministic

Matthew Finkel gitlab at torproject.org
Tue Oct 13 14:03:06 UTC 2020



Matthew Finkel pushed to branch tor-browser-82.0.0b4-10.0-1 at The Tor Project / Applications / fenix


Commits:
0c537f77 by Georg Koppen at 2020-10-13T07:43:35+00:00
Bug 40083: Make locale ordering in BuildConfig deterministic

- - - - -
4a7a5f7b by Matthew Finkel at 2020-10-13T14:02:44+00:00
Merge remote-tracking branch 'gkgl/bug_40083' into tor-browser-82.0.0b4-10.0-1

- - - - -


1 changed file:

- app/build.gradle


Changes:

=====================================
app/build.gradle
=====================================
@@ -585,16 +585,22 @@ task buildTranslationArray {
     // This isn't running as a task, instead the array is build when the gradle file is parsed.
     // https://github.com/mozilla-mobile/fenix/issues/14175
     def foundLocales = new StringBuilder()
+    def languageCodes = []
     foundLocales.append("new String[]{")
 
     fileTree("src/main/res").visit { FileVisitDetails details ->
         if(details.file.path.endsWith("/strings.xml")){
             def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-','').replaceAll('-r','-')
             languageCode = (languageCode == "values") ? "en-US" : languageCode
-            foundLocales.append("\"").append(languageCode).append("\"").append(",")
+            languageCodes.add(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.sort()
+    languageCodes.each {
+        foundLocales.append("\"").append(it).append("\"").append(",")
+    }
     foundLocales.append("}")
     def foundLocalesString = foundLocales.toString().replaceAll(',}','}')
     android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString



View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/1e797f9532beeac8882d2b3cb7abd3e4ba3dc7d1...4a7a5f7ba319971402bb2fe9e21303044ffe851e

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/1e797f9532beeac8882d2b3cb7abd3e4ba3dc7d1...4a7a5f7ba319971402bb2fe9e21303044ffe851e
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20201013/672a2bb5/attachment-0001.htm>


More information about the tbb-commits mailing list