author Mike Hommey <>
Tue, 09 Feb 2016 14:36:07 +0900
changeset 284054 02840dfc6310ad181aa7c3b49ef51c3dd1d71e95
child 284057 51029f4d82d3dcb3ca3aa8cab60bf1ed29152846
permissions -rw-r--r--
Bug 1246881 - Generate a header defining MOZ_BUILDID. r=mshal

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

from __future__ import print_function, unicode_literals

import os
import sys
from datetime import datetime

def buildid_header(output):
    buildid = os.environ.get('MOZ_BUILD_DATE')
    if buildid and len(buildid) != 14:
        print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
        buildid = None
    if not buildid:
        buildid ='%Y%m%d%H%M%S')
    output.write("#define MOZ_BUILDID %s\n" % buildid)

def main(args):
    if (len(args)):
        func = globals().get(args[0])
        if func:
            return func(sys.stdout, *args[1:])

if __name__ == '__main__':