From 2c65da28a2ee7c56e5aab44aeb3557e163410d94 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Fri, 8 Jan 2021 11:49:18 -0800 Subject: [PATCH] Default roll_aosp.sh to copy artifacts to vendor partition ... to support using ANGLE as a native GL driver. Note: this will not affect devices installing the APK with `PRODUCT_PACKAGES += ANGLE` and will *not* also install the libs to vendor. Bug: b/147316305 Bug: angleproject:5456 Test: ./scripts/roll_aosp.sh and build in AOSP Change-Id: I98cab8d0735a4f66293ac063e0eef2ae7ddbee7b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618529 Reviewed-by: Tim Van Patten Reviewed-by: Geoff Lang Commit-Queue: Tim Van Patten --- scripts/generate_android_bp.py | 29 ++++++----------------------- scripts/roll_aosp.sh | 2 +- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/scripts/generate_android_bp.py b/scripts/generate_android_bp.py index f633714a7..d73d86907 100644 --- a/scripts/generate_android_bp.py +++ b/scripts/generate_android_bp.py @@ -312,7 +312,7 @@ def merge_bps(bps_for_abis): return common_bp -def library_target_to_blueprint(target, build_info, copy_to_vendor, relative_install_path): +def library_target_to_blueprint(target, build_info): bps_for_abis = {} blueprint_type = "" for abi in abi_targets: @@ -339,11 +339,9 @@ def library_target_to_blueprint(target, build_info, copy_to_vendor, relative_ins bp['sdk_version'] = sdk_version bp['stl'] = stl - if copy_to_vendor: + if target in root_targets: bp['vendor'] = True - if relative_install_path is not None: - assert copy_to_vendor - bp['target'] = {'android': {'relative_install_path': relative_install_path}} + bp['target'] = {'android': {'relative_install_path': 'egl'}} bps_for_abis[abi] = bp common_bp = merge_bps(bps_for_abis) @@ -446,14 +444,11 @@ def action_target_to_blueprint(target, build_info): return blueprint_type, bp -def gn_target_to_blueprint(target, build_info, copy_to_vendor, relative_install_path): +def gn_target_to_blueprint(target, build_info): for abi in abi_targets: gn_type = build_info[abi][target]['type'] if gn_type in blueprint_library_target_types: - if copy_to_vendor and gn_type == 'shared_library': - return library_target_to_blueprint(target, build_info, True, relative_install_path) - else: - return library_target_to_blueprint(target, build_info, False, None) + return library_target_to_blueprint(target, build_info) elif gn_type in blueprint_gen_types: return action_target_to_blueprint(target, build_info[abi]) else: @@ -489,13 +484,7 @@ def main(): 'gn_json_' + fixed_abi, help=fixed_abi + 'gn desc in json format. Generated with \'gn desc --format=json "*"\'.') - parser.add_argument( - '--copy-to-vendor-partition', - help='whether the shared library target will copy to the vendor partition', - action='store_true', - default=False) args = vars(parser.parse_args()) - copy_to_vendor = args['copy_to_vendor_partition'] build_info = {} for abi in abi_targets: @@ -512,13 +501,7 @@ def main(): blueprint_targets = [] for target in targets_to_write: - blueprint_targets.append( - gn_target_to_blueprint( - target, - build_info, - copy_to_vendor, - relative_install_path='egl' if copy_to_vendor and - (target in root_targets) else None)) + blueprint_targets.append(gn_target_to_blueprint(target, build_info)) # Add APKs with all of the root libraries blueprint_targets.append(('filegroup', { diff --git a/scripts/roll_aosp.sh b/scripts/roll_aosp.sh index 6885d1fe9..1564c2940 100755 --- a/scripts/roll_aosp.sh +++ b/scripts/roll_aosp.sh @@ -105,7 +105,7 @@ python scripts/generate_android_bp.py \ ${GN_OUTPUT_DIRECTORY}/desc.arm.json \ ${GN_OUTPUT_DIRECTORY}/desc.arm64.json \ ${GN_OUTPUT_DIRECTORY}/desc.x86.json \ - ${GN_OUTPUT_DIRECTORY}/desc.x64.json $@ > Android.bp + ${GN_OUTPUT_DIRECTORY}/desc.x64.json > Android.bp rm -rf ${GN_OUTPUT_DIRECTORY} git add Android.bp