Merge "Do not install host snapshot modules with existing prebuilts." am: 3f04ab2fb4

Original change: https://android-review.googlesource.com/c/platform/development/+/2045663

Change-Id: I7b639fc71bf3ad51aa5e0e4029eb8a149029a04f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Rob Seymour
2022-03-30 01:06:53 +00:00
committed by Automerger Merge Worker

View File

@@ -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,