Bug 818246 - Part 6: Support XPIDL_MODULE in moz.build; r=gps

This commit is contained in:
Mike Shal 2013-03-12 10:08:00 -07:00
parent 0d33ac5f93
commit fc8734bd9f
6 changed files with 16 additions and 2 deletions

View File

@ -76,6 +76,8 @@ class TreeMetadataEmitter(object):
passthru = VariablePassthru(sandbox)
if sandbox['XPIDL_SOURCES']:
passthru.variables['XPIDLSRCS'] = sandbox['XPIDL_SOURCES']
if sandbox['XPIDL_MODULE']:
passthru.variables['XPIDL_MODULE'] = sandbox['XPIDL_MODULE']
if passthru.variables:
yield passthru

View File

@ -149,6 +149,14 @@ VARIABLES = {
Entries must be files that exist. Entries are almost certainly .idl
files.
"""),
'XPIDL_MODULE': (unicode, "",
"""XPCOM Interface Definition Module Name.
This is the name of the .xpt file that is created by linking
XPIDL_SOURCES together. If unspecified, it defaults to be the same as
MODULE.
"""),
}
# The set of functions exposed to the sandbox.

View File

@ -2,3 +2,4 @@
# http://creativecommons.org/publicdomain/zero/1.0/
XPIDL_SOURCES = ['foo.idl', 'bar.idl', 'biz.idl']
XPIDL_MODULE = 'module_name'

View File

@ -129,6 +129,7 @@ class TestRecursiveMakeBackend(BackendTester):
'XPIDLSRCS += bar.idl',
'XPIDLSRCS += biz.idl',
])
self.assertEqual(lines[5], 'XPIDL_MODULE := module_name')
if __name__ == '__main__':

View File

@ -2,4 +2,4 @@
# http://creativecommons.org/publicdomain/zero/1.0/
XPIDL_SOURCES += ['foo.idl', 'bar.idl', 'biz.idl']
XPIDL_MODULE = 'module_name'

View File

@ -121,10 +121,12 @@ class TestEmitterBasic(unittest.TestCase):
self.assertIsInstance(objs[1], VariablePassthru)
variables = objs[1].variables
self.assertEqual(len(variables), 1)
self.assertEqual(len(variables), 2)
self.assertIn('XPIDLSRCS', variables)
self.assertEqual(variables['XPIDLSRCS'],
['foo.idl', 'bar.idl', 'biz.idl'])
self.assertIn('XPIDL_MODULE', variables)
self.assertEqual(variables['XPIDL_MODULE'], 'module_name')
if __name__ == '__main__':