GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 9b94de4c 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 7ae3e24c
......@@ -680,8 +680,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)
......
......@@ -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()
}
......
Markdown is supported
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