in tools/bundletool/bundletool_experimental.py [0:0]
def run(self):
"""Performs the operations requested by the control struct."""
output_path = self._control.get('output')
if not output_path:
raise ValueError('No output file specified.')
bundle_merge_files = self._control.get('bundle_merge_files', [])
bundle_merge_zips = self._control.get('bundle_merge_zips', [])
# Clear the output directory if it already exists.
if os.path.exists(output_path):
shutil.rmtree(output_path)
self._makedirs_safely(output_path)
for z in bundle_merge_zips:
self._add_zip_contents(z['src'], z['dest'], output_path)
for f in bundle_merge_files:
self._add_files(f['src'], f['dest'], f.get('executable', False),
output_path)
post_processor = self._control.get('post_processor')
if post_processor:
self._post_process_bundle(output_path, post_processor)
code_signing_commands = self._control.get('code_signing_commands')
if code_signing_commands:
self._sign_bundle(output_path, code_signing_commands)