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 <timvp@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
This commit is contained in:
Jason Macnak 2021-01-08 11:49:18 -08:00 коммит произвёл Commit Bot
Родитель 2e9706d80d
Коммит 2c65da28a2
2 изменённых файлов: 7 добавлений и 24 удалений

Просмотреть файл

@ -312,7 +312,7 @@ def merge_bps(bps_for_abis):
return common_bp 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 = {} bps_for_abis = {}
blueprint_type = "" blueprint_type = ""
for abi in abi_targets: 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['sdk_version'] = sdk_version
bp['stl'] = stl bp['stl'] = stl
if copy_to_vendor: if target in root_targets:
bp['vendor'] = True bp['vendor'] = True
if relative_install_path is not None: bp['target'] = {'android': {'relative_install_path': 'egl'}}
assert copy_to_vendor
bp['target'] = {'android': {'relative_install_path': relative_install_path}}
bps_for_abis[abi] = bp bps_for_abis[abi] = bp
common_bp = merge_bps(bps_for_abis) common_bp = merge_bps(bps_for_abis)
@ -446,14 +444,11 @@ def action_target_to_blueprint(target, build_info):
return blueprint_type, bp 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: for abi in abi_targets:
gn_type = build_info[abi][target]['type'] gn_type = build_info[abi][target]['type']
if gn_type in blueprint_library_target_types: 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)
return library_target_to_blueprint(target, build_info, True, relative_install_path)
else:
return library_target_to_blueprint(target, build_info, False, None)
elif gn_type in blueprint_gen_types: elif gn_type in blueprint_gen_types:
return action_target_to_blueprint(target, build_info[abi]) return action_target_to_blueprint(target, build_info[abi])
else: else:
@ -489,13 +484,7 @@ def main():
'gn_json_' + fixed_abi, 'gn_json_' + fixed_abi,
help=fixed_abi + help=fixed_abi +
'gn desc in json format. Generated with \'gn desc <out_dir> --format=json "*"\'.') 'gn desc in json format. Generated with \'gn desc <out_dir> --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()) args = vars(parser.parse_args())
copy_to_vendor = args['copy_to_vendor_partition']
build_info = {} build_info = {}
for abi in abi_targets: for abi in abi_targets:
@ -512,13 +501,7 @@ def main():
blueprint_targets = [] blueprint_targets = []
for target in targets_to_write: for target in targets_to_write:
blueprint_targets.append( blueprint_targets.append(gn_target_to_blueprint(target, build_info))
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))
# Add APKs with all of the root libraries # Add APKs with all of the root libraries
blueprint_targets.append(('filegroup', { blueprint_targets.append(('filegroup', {

Просмотреть файл

@ -105,7 +105,7 @@ python scripts/generate_android_bp.py \
${GN_OUTPUT_DIRECTORY}/desc.arm.json \ ${GN_OUTPUT_DIRECTORY}/desc.arm.json \
${GN_OUTPUT_DIRECTORY}/desc.arm64.json \ ${GN_OUTPUT_DIRECTORY}/desc.arm64.json \
${GN_OUTPUT_DIRECTORY}/desc.x86.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} rm -rf ${GN_OUTPUT_DIRECTORY}
git add Android.bp git add Android.bp