Skip to content

Commit 09078a3

Browse files
nglevinluispadron
authored andcommitted
Remove root_merge_zips support from bundletool.
This hasn't been used by the Apple rules for some time. Cherry-pick: 6c4a5dc
1 parent e666266 commit 09078a3

2 files changed

Lines changed: 1 addition & 40 deletions

File tree

tools/bundletool/bundletool.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@
4343
`bundle_path`.
4444
output: The path to the uncompressed ZIP archive that should be created with
4545
the merged bundle contents.
46-
root_merge_zips: A list of dictionaries representing the ZIP archives whose
47-
contents should be merged into the archive at the root. Each dictionary
48-
contains two fields: "src", the path of the archive whose contents should
49-
be merged into the archive; and "dest", the path inside the archive where
50-
the ZIPs contents should be placed. This is used for support files, such
51-
as Swift libraries and watchOS stub executables, that must be shipped to
52-
Apple at the root of the archive as well as within the bundle itself.
5346
"""
5447

5548
import hashlib
@@ -108,7 +101,6 @@ def run(self):
108101
bundle_path = self._control.get('bundle_path', '')
109102
bundle_merge_files = self._control.get('bundle_merge_files', [])
110103
bundle_merge_zips = self._control.get('bundle_merge_zips', [])
111-
root_merge_zips = self._control.get('root_merge_zips', [])
112104
compress = self._control.get('compress', False)
113105

114106
with zipfile.ZipFile(output_path, 'w', allowZip64 = True) as out_zip:
@@ -121,9 +113,6 @@ def run(self):
121113
self._add_files(f['src'], dest, f.get('executable', False),
122114
f.get('contents_only', False), out_zip, compress)
123115

124-
for z in root_merge_zips:
125-
self._add_zip_contents(z['src'], z['dest'], out_zip, compress)
126-
127116
with zipfile.ZipFile(output_path, 'r') as test_zip:
128117
badfile = test_zip.testzip()
129118
if badfile:

tools/bundletool/bundletool_test.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ def _scratch_zip(self, name, *entries):
8787
"""Creates a scratch ZIP file with the given entries.
8888
8989
The scratch ZIP's path, which is returned by this function, can then be
90-
passed into the bunlder as one of its `bundle_merge_zips` or
91-
`root_merge_zips`.
90+
passed into the bunlder as one of its `bundle_merge_zips`.
9291
9392
Args:
9493
name: The name of the ZIP file.
@@ -234,33 +233,6 @@ def test_bundle_merge_zips_propagates_executable(self):
234233
with zipfile.ZipFile(out_zip, 'r') as z:
235234
self._assert_zip_contains(z, 'Payload/foo.app/foo.bundle/some.exe', True)
236235

237-
def test_root_merge_zips(self):
238-
support_zip = self._scratch_zip('support.zip', 'SomeSupport/some.dylib')
239-
out_zip = _run_bundler({
240-
'bundle_path': 'Payload/foo.app',
241-
'root_merge_zips': [{'src': support_zip, 'dest': '.'}],
242-
})
243-
with zipfile.ZipFile(out_zip, 'r') as z:
244-
self._assert_zip_contains(z, 'SomeSupport/some.dylib')
245-
246-
def test_root_merge_zips_with_different_destination(self):
247-
support_zip = self._scratch_zip('support.zip', 'some.dylib')
248-
out_zip = _run_bundler({
249-
'bundle_path': 'Payload/foo.app',
250-
'root_merge_zips': [{'src': support_zip, 'dest': 'SomeSupport'}],
251-
})
252-
with zipfile.ZipFile(out_zip, 'r') as z:
253-
self._assert_zip_contains(z, 'SomeSupport/some.dylib')
254-
255-
def test_root_merge_zips_propagates_executable(self):
256-
support_zip = self._scratch_zip('support.zip', '*SomeSupport/some.dylib')
257-
out_zip = _run_bundler({
258-
'bundle_path': 'Payload/foo.app',
259-
'root_merge_zips': [{'src': support_zip, 'dest': '.'}],
260-
})
261-
with zipfile.ZipFile(out_zip, 'r') as z:
262-
self._assert_zip_contains(z, 'SomeSupport/some.dylib', True)
263-
264236
def test_duplicate_files_with_same_content_are_allowed(self):
265237
foo_txt = self._scratch_file('foo.txt', 'foo')
266238
bar_txt = self._scratch_file('bar.txt', 'foo')

0 commit comments

Comments
 (0)