diff --git a/vendor_snapshot/update.py b/vendor_snapshot/update.py index e209584b7..9563380fe 100644 --- a/vendor_snapshot/update.py +++ b/vendor_snapshot/update.py @@ -111,6 +111,7 @@ JSON_TO_BP = { 'Required': 'required', 'Filename': 'filename', 'CrateName': 'crate_name', + 'Prebuilt': 'prebuilt', } SANITIZER_VARIANT_PROPS = { @@ -406,16 +407,22 @@ def convert_json_host_data_to_bp(mod, install_dir): All host modules are created as a cc_prebuilt_binary blueprint module with the prefer attribute set to true. + Modules that already have a prebuilt are not created. + Args: mod: JSON definition of the module install_dir: installation directory of the host snapshot """ rust_proc_macro = mod.pop('RustProcMacro', False) prop = convert_json_data_to_bp_prop(mod, install_dir) + if 'prebuilt' in prop: + return + if not rust_proc_macro: prop['host_supported'] = True prop['device_supported'] = False prop['stl'] = 'none' + prop['prefer'] = True ## Move install file to host source file prop['target'] = dict() @@ -449,7 +456,8 @@ def gen_host_bp_file(install_dir): props = json.load(rfp) for mod in props: prop = convert_json_host_data_to_bp(mod, install_dir) - wfp.write(prop) + if prop: + wfp.write(prop) def gen_bp_files(image, vndk_dir, install_dir, snapshot_version): """Generates Android.bp for each archtecture. @@ -657,7 +665,7 @@ def check_host_usage(install_dir, ninja_binary, ninja_file, goals, output): with open(output, 'w') as f: f.write('vsdk_host_tools = [ \n') for m in sorted(used_modules): - f.write(' "%s", \n' % m) + f.write(' "%s",\n' % m) f.write('] \n') def check_module_usage(install_dir, ninja_binary, image, ninja_file, goals,