config/expandlibs_gen.py
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Wed, 17 Jun 2015 04:40:28 -0700
changeset 279976 9a0e53e7fcbf4510f20be2404b3b34c6107a8558
parent 218085 b9051530561e0ce8fc56b07681301b01b452c196
child 357488 362852b89f4e5a2254f26e8d601279331ff6bc2a
permissions -rw-r--r--
Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/40a9c300245a Author: Martijn <martijn.martijn@gmail.com> Desc: Merge pull request #30572 from mwargers/1112141_2 Bug 1112141 - Intermittent test_homescreen_delete_app_packaged.py TestDeleteApp.test_delete_app | StaleElementException: 2nd attempt ======== https://hg.mozilla.org/integration/gaia-central/rev/97f32c0e6764 Author: Martijn Wargers <mwargers@mozilla.com> Desc: Bug 1112141 - Intermittent test_homescreen_delete_app_packaged.py TestDeleteApp.test_delete_app | StaleElementException: 2nd attempt ======== https://hg.mozilla.org/integration/gaia-central/rev/79e9f8f0db20 Author: Borja Salguero <borjasalguero@users.noreply.github.com> Desc: Merge pull request #30515 from jpruden92/bug1173097-contacts Bug 1173097 - [Contacts][NGA] Extract 'goToSelectTag' functionality to it own .js class ======== https://hg.mozilla.org/integration/gaia-central/rev/b1608faec400 Author: jpruden92 <jorgepruden@gmail.com> Desc: Bug 1173097 - [Contacts][NGA] Extract 'goToSelectTag' functionality to it own .js class

# 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 http://mozilla.org/MPL/2.0/.

'''Given a list of object files and library names, prints a library
descriptor to standard output'''

from __future__ import with_statement
import sys
import os
import expandlibs_config as conf
from expandlibs import LibDescriptor, isObject, ensureParentDir
from optparse import OptionParser

def generate(args):
    desc = LibDescriptor()
    for arg in args:
        if isObject(arg):
            if os.path.exists(arg):
                desc['OBJS'].append(os.path.abspath(arg))
            else:
                raise Exception("File not found: %s" % arg)
        elif os.path.splitext(arg)[1] == conf.LIB_SUFFIX:
            if os.path.exists(arg) or os.path.exists(arg + conf.LIBS_DESC_SUFFIX):
                desc['LIBS'].append(os.path.abspath(arg))
            else:
                raise Exception("File not found: %s" % arg)
    return desc

if __name__ == '__main__':
    parser = OptionParser()
    parser.add_option("-o", dest="output", metavar="FILE",
        help="send output to the given file")

    (options, args) = parser.parse_args()
    if not options.output:
        raise Exception("Missing option: -o")

    ensureParentDir(options.output)
    with open(options.output, 'w') as outfile:
        print >>outfile, generate(args)