mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 991983 - Emit absolute paths for UnifiedSources. r=gps
This helps upcoming changes, and relieves backends from path resolution. This has the side effect of chaning the order of some unified sources, which consequently breaks nsTextFormatter because it declares snprintf methods after nsStringAPI #defines it.
This commit is contained in:
parent
fc645ba14f
commit
188ce081ec
@ -779,6 +779,9 @@ class TreeMetadataEmitter(LoggingMixin):
|
|||||||
# Now sort the files to let groupby work.
|
# Now sort the files to let groupby work.
|
||||||
sorted_files = sorted(context[variable], key=canonical_suffix_for_file)
|
sorted_files = sorted(context[variable], key=canonical_suffix_for_file)
|
||||||
for canonical_suffix, files in itertools.groupby(sorted_files, canonical_suffix_for_file):
|
for canonical_suffix, files in itertools.groupby(sorted_files, canonical_suffix_for_file):
|
||||||
|
if variable.startswith('UNIFIED_'):
|
||||||
|
files = [mozpath.normpath(mozpath.join(context.srcdir, f))
|
||||||
|
for f in files]
|
||||||
arglist = [context, list(files), canonical_suffix]
|
arglist = [context, list(files), canonical_suffix]
|
||||||
if variable.startswith('UNIFIED_') and 'FILES_PER_UNIFIED_FILE' in context:
|
if variable.startswith('UNIFIED_') and 'FILES_PER_UNIFIED_FILE' in context:
|
||||||
arglist.append(context['FILES_PER_UNIFIED_FILE'])
|
arglist.append(context['FILES_PER_UNIFIED_FILE'])
|
||||||
|
@ -818,7 +818,9 @@ class TestEmitterBasic(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
for suffix, files in expected.items():
|
for suffix, files in expected.items():
|
||||||
sources = suffix_map[suffix]
|
sources = suffix_map[suffix]
|
||||||
self.assertEqual(sources.files, files)
|
self.assertEqual(
|
||||||
|
sources.files,
|
||||||
|
[mozpath.join(reader.config.topsrcdir, f) for f in files])
|
||||||
self.assertTrue(sources.have_unified_mapping)
|
self.assertTrue(sources.have_unified_mapping)
|
||||||
|
|
||||||
def test_unified_sources_non_unified(self):
|
def test_unified_sources_non_unified(self):
|
||||||
@ -840,7 +842,9 @@ class TestEmitterBasic(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
for suffix, files in expected.items():
|
for suffix, files in expected.items():
|
||||||
sources = suffix_map[suffix]
|
sources = suffix_map[suffix]
|
||||||
self.assertEqual(sources.files, files)
|
self.assertEqual(
|
||||||
|
sources.files,
|
||||||
|
[mozpath.join(reader.config.topsrcdir, f) for f in files])
|
||||||
self.assertFalse(sources.have_unified_mapping)
|
self.assertFalse(sources.have_unified_mapping)
|
||||||
|
|
||||||
def test_dist_files(self):
|
def test_dist_files(self):
|
||||||
|
@ -1308,3 +1308,5 @@ ParseString(const nsACString& aSource, char aDelimiter,
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef snprintf
|
||||||
|
Loading…
Reference in New Issue
Block a user