Merge "Do not install host snapshot modules with existing prebuilts."
This commit is contained in:
@@ -111,6 +111,7 @@ JSON_TO_BP = {
|
|||||||
'Required': 'required',
|
'Required': 'required',
|
||||||
'Filename': 'filename',
|
'Filename': 'filename',
|
||||||
'CrateName': 'crate_name',
|
'CrateName': 'crate_name',
|
||||||
|
'Prebuilt': 'prebuilt',
|
||||||
}
|
}
|
||||||
|
|
||||||
SANITIZER_VARIANT_PROPS = {
|
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
|
All host modules are created as a cc_prebuilt_binary
|
||||||
blueprint module with the prefer attribute set to true.
|
blueprint module with the prefer attribute set to true.
|
||||||
|
|
||||||
|
Modules that already have a prebuilt are not created.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
mod: JSON definition of the module
|
mod: JSON definition of the module
|
||||||
install_dir: installation directory of the host snapshot
|
install_dir: installation directory of the host snapshot
|
||||||
"""
|
"""
|
||||||
rust_proc_macro = mod.pop('RustProcMacro', False)
|
rust_proc_macro = mod.pop('RustProcMacro', False)
|
||||||
prop = convert_json_data_to_bp_prop(mod, install_dir)
|
prop = convert_json_data_to_bp_prop(mod, install_dir)
|
||||||
|
if 'prebuilt' in prop:
|
||||||
|
return
|
||||||
|
|
||||||
if not rust_proc_macro:
|
if not rust_proc_macro:
|
||||||
prop['host_supported'] = True
|
prop['host_supported'] = True
|
||||||
prop['device_supported'] = False
|
prop['device_supported'] = False
|
||||||
prop['stl'] = 'none'
|
prop['stl'] = 'none'
|
||||||
|
|
||||||
prop['prefer'] = True
|
prop['prefer'] = True
|
||||||
## Move install file to host source file
|
## Move install file to host source file
|
||||||
prop['target'] = dict()
|
prop['target'] = dict()
|
||||||
@@ -449,7 +456,8 @@ def gen_host_bp_file(install_dir):
|
|||||||
props = json.load(rfp)
|
props = json.load(rfp)
|
||||||
for mod in props:
|
for mod in props:
|
||||||
prop = convert_json_host_data_to_bp(mod, install_dir)
|
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):
|
def gen_bp_files(image, vndk_dir, install_dir, snapshot_version):
|
||||||
"""Generates Android.bp for each archtecture.
|
"""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:
|
with open(output, 'w') as f:
|
||||||
f.write('vsdk_host_tools = [ \n')
|
f.write('vsdk_host_tools = [ \n')
|
||||||
for m in sorted(used_modules):
|
for m in sorted(used_modules):
|
||||||
f.write(' "%s", \n' % m)
|
f.write(' "%s",\n' % m)
|
||||||
f.write('] \n')
|
f.write('] \n')
|
||||||
|
|
||||||
def check_module_usage(install_dir, ninja_binary, image, ninja_file, goals,
|
def check_module_usage(install_dir, ninja_binary, image, ninja_file, goals,
|
||||||
|
|||||||
Reference in New Issue
Block a user