Merge "Add support for vndk llndk libraries in Android.bp" am: f205499be8 am: 9b98a3668c am: 7f9d3ffd32
Original change: https://android-review.googlesource.com/c/platform/development/+/1706410 Change-Id: I03bd385a47d52f7202b33424816bc90bcf81bd1f
This commit is contained in:
@@ -102,6 +102,8 @@ class GenBuildFile(object):
|
|||||||
self._snapshot_archs = utils.get_snapshot_archs(install_dir)
|
self._snapshot_archs = utils.get_snapshot_archs(install_dir)
|
||||||
self._root_bpfile = os.path.join(install_dir, utils.ROOT_BP_PATH)
|
self._root_bpfile = os.path.join(install_dir, utils.ROOT_BP_PATH)
|
||||||
self._common_bpfile = os.path.join(install_dir, utils.COMMON_BP_PATH)
|
self._common_bpfile = os.path.join(install_dir, utils.COMMON_BP_PATH)
|
||||||
|
self._llndk = self._parse_lib_list(
|
||||||
|
os.path.basename(self._etc_paths['llndk.libraries.txt']))
|
||||||
self._vndk_core = self._parse_lib_list(
|
self._vndk_core = self._parse_lib_list(
|
||||||
os.path.basename(self._etc_paths['vndkcore.libraries.txt']))
|
os.path.basename(self._etc_paths['vndkcore.libraries.txt']))
|
||||||
self._vndk_sp = self._parse_lib_list(
|
self._vndk_sp = self._parse_lib_list(
|
||||||
@@ -232,15 +234,26 @@ class GenBuildFile(object):
|
|||||||
vndk_core_buildrules = self._gen_vndk_shared_prebuilts(
|
vndk_core_buildrules = self._gen_vndk_shared_prebuilts(
|
||||||
self._vndk_core[arch],
|
self._vndk_core[arch],
|
||||||
arch,
|
arch,
|
||||||
|
is_llndk=False,
|
||||||
is_vndk_sp=False,
|
is_vndk_sp=False,
|
||||||
is_binder32=is_binder32,
|
is_binder32=is_binder32,
|
||||||
module_names=module_names)
|
module_names=module_names)
|
||||||
vndk_sp_buildrules = self._gen_vndk_shared_prebuilts(
|
vndk_sp_buildrules = self._gen_vndk_shared_prebuilts(
|
||||||
self._vndk_sp[arch],
|
self._vndk_sp[arch],
|
||||||
arch,
|
arch,
|
||||||
|
is_llndk=False,
|
||||||
is_vndk_sp=True,
|
is_vndk_sp=True,
|
||||||
is_binder32=is_binder32,
|
is_binder32=is_binder32,
|
||||||
module_names=module_names)
|
module_names=module_names)
|
||||||
|
include_llndk = self._vndk_version > 30
|
||||||
|
if include_llndk:
|
||||||
|
llndk_buildrules = self._gen_vndk_shared_prebuilts(
|
||||||
|
self._llndk[arch],
|
||||||
|
arch,
|
||||||
|
is_llndk=True,
|
||||||
|
is_vndk_sp=False,
|
||||||
|
is_binder32=is_binder32,
|
||||||
|
module_names=module_names)
|
||||||
|
|
||||||
with open(bpfile_path, 'w') as bpfile:
|
with open(bpfile_path, 'w') as bpfile:
|
||||||
bpfile.write(self._gen_autogen_msg('/'))
|
bpfile.write(self._gen_autogen_msg('/'))
|
||||||
@@ -248,6 +261,9 @@ class GenBuildFile(object):
|
|||||||
bpfile.write('\n'.join(vndk_core_buildrules))
|
bpfile.write('\n'.join(vndk_core_buildrules))
|
||||||
bpfile.write('\n')
|
bpfile.write('\n')
|
||||||
bpfile.write('\n'.join(vndk_sp_buildrules))
|
bpfile.write('\n'.join(vndk_sp_buildrules))
|
||||||
|
if include_llndk:
|
||||||
|
bpfile.write('\n')
|
||||||
|
bpfile.write('\n'.join(llndk_buildrules))
|
||||||
|
|
||||||
variant_include_path = os.path.join(variant_path, 'include')
|
variant_include_path = os.path.join(variant_path, 'include')
|
||||||
include_path = os.path.join(self._install_dir, arch, 'include')
|
include_path = os.path.join(self._install_dir, arch, 'include')
|
||||||
@@ -409,6 +425,7 @@ class GenBuildFile(object):
|
|||||||
def _gen_vndk_shared_prebuilts(self,
|
def _gen_vndk_shared_prebuilts(self,
|
||||||
prebuilts,
|
prebuilts,
|
||||||
arch,
|
arch,
|
||||||
|
is_llndk,
|
||||||
is_vndk_sp,
|
is_vndk_sp,
|
||||||
is_binder32,
|
is_binder32,
|
||||||
module_names):
|
module_names):
|
||||||
@@ -417,6 +434,7 @@ class GenBuildFile(object):
|
|||||||
Args:
|
Args:
|
||||||
prebuilts: list of VNDK shared prebuilts
|
prebuilts: list of VNDK shared prebuilts
|
||||||
arch: string, VNDK snapshot arch (e.g. 'arm64')
|
arch: string, VNDK snapshot arch (e.g. 'arm64')
|
||||||
|
is_llndk: bool, True if the prebuilts are LLNDK stubs
|
||||||
is_vndk_sp: bool, True if prebuilts are VNDK_SP libs
|
is_vndk_sp: bool, True if prebuilts are VNDK_SP libs
|
||||||
is_binder32: bool, True if binder interface is 32-bit
|
is_binder32: bool, True if binder interface is 32-bit
|
||||||
module_names: dict, module names for given prebuilts
|
module_names: dict, module names for given prebuilts
|
||||||
@@ -427,6 +445,7 @@ class GenBuildFile(object):
|
|||||||
bp_module = self._gen_vndk_shared_prebuilt(
|
bp_module = self._gen_vndk_shared_prebuilt(
|
||||||
prebuilt,
|
prebuilt,
|
||||||
arch,
|
arch,
|
||||||
|
is_llndk=is_llndk,
|
||||||
is_vndk_sp=is_vndk_sp,
|
is_vndk_sp=is_vndk_sp,
|
||||||
is_binder32=is_binder32,
|
is_binder32=is_binder32,
|
||||||
module_names=module_names)
|
module_names=module_names)
|
||||||
@@ -437,6 +456,7 @@ class GenBuildFile(object):
|
|||||||
def _gen_vndk_shared_prebuilt(self,
|
def _gen_vndk_shared_prebuilt(self,
|
||||||
prebuilt,
|
prebuilt,
|
||||||
arch,
|
arch,
|
||||||
|
is_llndk,
|
||||||
is_vndk_sp,
|
is_vndk_sp,
|
||||||
is_binder32,
|
is_binder32,
|
||||||
module_names):
|
module_names):
|
||||||
@@ -446,6 +466,7 @@ class GenBuildFile(object):
|
|||||||
Args:
|
Args:
|
||||||
prebuilt: string, name of prebuilt object
|
prebuilt: string, name of prebuilt object
|
||||||
arch: string, VNDK snapshot arch (e.g. 'arm64')
|
arch: string, VNDK snapshot arch (e.g. 'arm64')
|
||||||
|
is_llndk: bool, True if prebuilt is a LLNDK stub
|
||||||
is_vndk_sp: bool, True if prebuilt is a VNDK_SP lib
|
is_vndk_sp: bool, True if prebuilt is a VNDK_SP lib
|
||||||
is_binder32: bool, True if binder interface is 32-bit
|
is_binder32: bool, True if binder interface is 32-bit
|
||||||
module_names: dict, module names for given prebuilts
|
module_names: dict, module names for given prebuilts
|
||||||
@@ -571,19 +592,31 @@ class GenBuildFile(object):
|
|||||||
|
|
||||||
product_available = ''
|
product_available = ''
|
||||||
# if vndkproduct.libraries.txt is empty, make the VNDKs available to product by default.
|
# if vndkproduct.libraries.txt is empty, make the VNDKs available to product by default.
|
||||||
if not self._vndk_product[arch] or prebuilt in self._vndk_product[arch]:
|
if not self._vndk_product[arch] or prebuilt in self._vndk_product[arch] or is_llndk:
|
||||||
product_available = '{ind}product_available: true,\n'.format(
|
product_available = '{ind}product_available: true,\n'.format(
|
||||||
ind=self.INDENT)
|
ind=self.INDENT)
|
||||||
|
|
||||||
vndk_sp = ''
|
vndk_props = ''
|
||||||
if is_vndk_sp:
|
if not is_llndk:
|
||||||
vndk_sp = '{ind}{ind}support_system_process: true,\n'.format(
|
vndk_sp = ''
|
||||||
ind=self.INDENT)
|
if is_vndk_sp:
|
||||||
|
vndk_sp = '{ind}{ind}support_system_process: true,\n'.format(
|
||||||
|
ind=self.INDENT)
|
||||||
|
|
||||||
vndk_private = ''
|
vndk_private = ''
|
||||||
if prebuilt in self._vndk_private[arch]:
|
if prebuilt in self._vndk_private[arch]:
|
||||||
vndk_private = '{ind}{ind}private: true,\n'.format(
|
vndk_private = '{ind}{ind}private: true,\n'.format(
|
||||||
ind=self.INDENT)
|
ind=self.INDENT)
|
||||||
|
|
||||||
|
vndk_props = ('{ind}vndk: {{\n'
|
||||||
|
'{ind}{ind}enabled: true,\n'
|
||||||
|
'{vndk_sp}'
|
||||||
|
'{vndk_private}'
|
||||||
|
'{ind}}},\n'.format(
|
||||||
|
ind=self.INDENT,
|
||||||
|
product_available=product_available,
|
||||||
|
vndk_sp=vndk_sp,
|
||||||
|
vndk_private=vndk_private))
|
||||||
|
|
||||||
notice = get_notice_file(prebuilt)
|
notice = get_notice_file(prebuilt)
|
||||||
arch_props = get_arch_props(prebuilt, arch, src_paths)
|
arch_props = get_arch_props(prebuilt, arch, src_paths)
|
||||||
@@ -599,11 +632,7 @@ class GenBuildFile(object):
|
|||||||
'{binder32bit}'
|
'{binder32bit}'
|
||||||
'{ind}vendor_available: true,\n'
|
'{ind}vendor_available: true,\n'
|
||||||
'{product_available}'
|
'{product_available}'
|
||||||
'{ind}vndk: {{\n'
|
'{vndk_props}'
|
||||||
'{ind}{ind}enabled: true,\n'
|
|
||||||
'{vndk_sp}'
|
|
||||||
'{vndk_private}'
|
|
||||||
'{ind}}},\n'
|
|
||||||
'{notice}'
|
'{notice}'
|
||||||
'{arch_props}'
|
'{arch_props}'
|
||||||
'}}\n'.format(
|
'}}\n'.format(
|
||||||
@@ -613,8 +642,7 @@ class GenBuildFile(object):
|
|||||||
target_arch=arch,
|
target_arch=arch,
|
||||||
binder32bit=binder32bit,
|
binder32bit=binder32bit,
|
||||||
product_available=product_available,
|
product_available=product_available,
|
||||||
vndk_sp=vndk_sp,
|
vndk_props=vndk_props,
|
||||||
vndk_private=vndk_private,
|
|
||||||
notice=notice,
|
notice=notice,
|
||||||
arch_props=arch_props))
|
arch_props=arch_props))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user