[tbb-commits] [Git][tpo/applications/fenix][tor-browser-81.1.1-10.0-1] 2 commits: Bug 40059: Use MOZ_BUILD_DATE for versionCode

Georg Koppen gitlab at torproject.org
Mon Sep 28 13:48:30 UTC 2020



Georg Koppen pushed to branch tor-browser-81.1.1-10.0-1 at The Tor Project / Applications / fenix


Commits:
c8fea7b4 by Georg Koppen at 2020-09-25T14:30:34+00:00
Bug 40059: Use MOZ_BUILD_DATE for versionCode

At the same time we adapt MOZ_BUILD_DATE to our needs where it is
actually used and not in tor-browser-build. This gives us more
flexibility. See: tor-browser-build#40084.

- - - - -
0a4fbe8a by Georg Koppen at 2020-09-28T13:43:59+00:00
Merge branch 'bug_40059' into tor-browser-81.1.1-10.0-1

- - - - -


2 changed files:

- app/build.gradle
- buildSrc/src/main/java/Config.kt


Changes:

=====================================
app/build.gradle
=====================================
@@ -679,9 +679,12 @@ ext.updateExtensionVersion = { task, extDir ->
         into extDir
 
         def systemEnvBuildDate = System.getenv('MOZ_BUILD_DATE')
+        // MOZ_BUILD_DATE is in the YYYYMMDDHHMMSS format. Thus, we only use a
+        // substring of it if it is available.
         def values = ['version': AndroidComponents.VERSION + "." +
-                      (systemEnvBuildDate != null ? systemEnvBuildDate :
-                      new Date().format('MMddHHmmss'))]
+                      (systemEnvBuildDate != null ?
+                       systemEnvBuildDate.substring(4) :
+                       new Date().format('MMddHHmmss'))]
         inputs.properties(values)
         expand(values)
     }


=====================================
buildSrc/src/main/java/Config.kt
=====================================
@@ -47,7 +47,7 @@ object Config {
     private val fennecBaseVersionCode by lazy {
         val format = SimpleDateFormat("YYYYMMDDHHMMSS", Locale.US)
         val cutoff = format.parse("20150801000000")
-        val build = Date()
+        val build = if (System.getenv("MOZ_BUILD_DATE") != null) format.parse(System.getenv("MOZ_BUILD_DATE")) else Date()
 
         Math.floor((build.time - cutoff.time) / (1000.0 * 60.0 * 60.0)).toInt()
     }



View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/8b0f722ffcc6d22049fb12b0d545d7b6d2fbe69f...0a4fbe8a8553bfaae9a1139bbc3fd4af024a22c0

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/8b0f722ffcc6d22049fb12b0d545d7b6d2fbe69f...0a4fbe8a8553bfaae9a1139bbc3fd4af024a22c0
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/20200928/c98ec4e2/attachment-0001.htm>


More information about the tbb-commits mailing list