mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 910096 - Treat js/src differently from other "static" directories. r=gps
This commit is contained in:
parent
602c5092f9
commit
c87e058ada
@ -3,5 +3,5 @@
|
||||
# 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/.
|
||||
|
||||
add_tier_dir('js', 'js/src', static=True)
|
||||
add_tier_dir('js', 'js/src', external=True)
|
||||
|
||||
|
@ -174,7 +174,8 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
|
||||
if 'TIERS' in sandbox:
|
||||
for tier in sandbox['TIERS']:
|
||||
o.tier_dirs[tier] = sandbox['TIERS'][tier]['regular']
|
||||
o.tier_dirs[tier] = sandbox['TIERS'][tier]['regular'] + \
|
||||
sandbox['TIERS'][tier]['external']
|
||||
o.tier_static_dirs[tier] = sandbox['TIERS'][tier]['static']
|
||||
|
||||
yield o
|
||||
|
@ -212,7 +212,7 @@ class MozbuildSandbox(Sandbox):
|
||||
|
||||
Sandbox.exec_file(self, path)
|
||||
|
||||
def _add_tier_directory(self, tier, reldir, static=False):
|
||||
def _add_tier_directory(self, tier, reldir, static=False, external=False):
|
||||
"""Register a tier directory with the build."""
|
||||
if isinstance(reldir, text_type):
|
||||
reldir = [reldir]
|
||||
@ -221,9 +221,13 @@ class MozbuildSandbox(Sandbox):
|
||||
self['TIERS'][tier] = {
|
||||
'regular': [],
|
||||
'static': [],
|
||||
'external': [],
|
||||
}
|
||||
|
||||
key = 'static' if static else 'regular'
|
||||
key = 'static' if static else 'external' if external else 'regular'
|
||||
if external and static:
|
||||
raise Exception('Only one of external or static can be set at the '
|
||||
'same time')
|
||||
|
||||
for path in reldir:
|
||||
if path in self['TIERS'][tier][key]:
|
||||
|
@ -414,7 +414,7 @@ FUNCTIONS = {
|
||||
include('/elsewhere/foo.build')
|
||||
"""),
|
||||
|
||||
'add_tier_dir': ('_add_tier_directory', (str, [str, list], bool),
|
||||
'add_tier_dir': ('_add_tier_directory', (str, [str, list], bool, bool),
|
||||
"""Register a directory for tier traversal.
|
||||
|
||||
This is the preferred way to populate the TIERS variable.
|
||||
@ -443,6 +443,10 @@ FUNCTIONS = {
|
||||
|
||||
# Register a directory as having static content (no dependencies).
|
||||
add_tier_dir('base', 'foo', static=True)
|
||||
|
||||
# Register a directory as having external content (same as static
|
||||
# content, but traversed with export, libs, and tools subtiers.
|
||||
add_tier_dir('base', 'bar', external=True)
|
||||
"""),
|
||||
|
||||
'warning': ('_warning', (str,),
|
||||
|
@ -169,7 +169,7 @@ class TestSandbox(unittest.TestCase):
|
||||
sandbox.exec_source('add_tier_dir("t1", "foo")', 'foo.py')
|
||||
|
||||
self.assertEqual(sandbox['TIERS']['t1'],
|
||||
{'regular': ['foo'], 'static': []})
|
||||
{'regular': ['foo'], 'static': [], 'external': []})
|
||||
|
||||
def test_add_tier_dir_regular_list(self):
|
||||
sandbox = self.sandbox()
|
||||
@ -177,7 +177,7 @@ class TestSandbox(unittest.TestCase):
|
||||
sandbox.exec_source('add_tier_dir("t1", ["foo", "bar"])', 'foo.py')
|
||||
|
||||
self.assertEqual(sandbox['TIERS']['t1'],
|
||||
{'regular': ['foo', 'bar'], 'static': []})
|
||||
{'regular': ['foo', 'bar'], 'static': [], 'external': []})
|
||||
|
||||
def test_add_tier_dir_static(self):
|
||||
sandbox = self.sandbox()
|
||||
@ -185,7 +185,15 @@ class TestSandbox(unittest.TestCase):
|
||||
sandbox.exec_source('add_tier_dir("t1", "foo", static=True)', 'foo.py')
|
||||
|
||||
self.assertEqual(sandbox['TIERS']['t1'],
|
||||
{'regular': [], 'static': ['foo']})
|
||||
{'regular': [], 'static': ['foo'], 'external': []})
|
||||
|
||||
def test_add_tier_dir_static(self):
|
||||
sandbox = self.sandbox()
|
||||
|
||||
sandbox.exec_source('add_tier_dir("t1", "foo", external=True)', 'foo.py')
|
||||
|
||||
self.assertEqual(sandbox['TIERS']['t1'],
|
||||
{'regular': [], 'static': [], 'external': ['foo']})
|
||||
|
||||
def test_tier_order(self):
|
||||
sandbox = self.sandbox()
|
||||
|
Loading…
Reference in New Issue
Block a user