Unverified Commit 63c189ec authored by Georg Koppen's avatar Georg Koppen Committed by Matthew Finkel
Browse files

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.
parent 7f43dd12
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -701,8 +701,11 @@ 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 :
                      (systemEnvBuildDate != null ?
                       systemEnvBuildDate.substring(4) :
                       new Date().format('MMddHHmmss'))]
        inputs.properties(values)
        expand(values)
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ object Config {
    private val fennecBaseVersionCode by lazy {
        val format = SimpleDateFormat("yyyyMMddHHmmss", Locale.US)
        val cutoff = format.parse("20141228000000")
        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()
    }