Merge "vndk-snapshot: add version suffix for v27 files"
This commit is contained in:
@@ -129,11 +129,10 @@ class GenBuildFile(object):
|
|||||||
self._vndk_version))
|
self._vndk_version))
|
||||||
etc_buildrules = []
|
etc_buildrules = []
|
||||||
for prebuilt in self.ETC_MODULES:
|
for prebuilt in self.ETC_MODULES:
|
||||||
# Starting from P (VNDK version >= 28), ld.config.VER.txt is not
|
# ld.config.VER.txt is not installed as a prebuilt but is built and
|
||||||
# installed as a prebuilt but is built and installed from the
|
# installed from thesource tree at the time the VNDK snapshot is
|
||||||
# source tree at the time the VNDK snapshot is installed to the
|
# installed to the system.img.
|
||||||
# system.img.
|
if prebuilt == 'ld.config.txt':
|
||||||
if prebuilt == 'ld.config.txt' and self._vndk_version >= 28:
|
|
||||||
continue
|
continue
|
||||||
etc_buildrules.append(self._gen_etc_prebuilt(prebuilt))
|
etc_buildrules.append(self._gen_etc_prebuilt(prebuilt))
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,10 @@ def gather_notice_files(install_dir):
|
|||||||
shutil.rmtree(notices_dir_per_arch)
|
shutil.rmtree(notices_dir_per_arch)
|
||||||
|
|
||||||
|
|
||||||
def revise_ld_config_txt_if_needed(vndk_version):
|
def post_processe_files_if_needed(vndk_version):
|
||||||
"""For O-MR1, replaces unversioned VNDK directories with versioned ones.
|
"""For O-MR1, replaces unversioned VNDK directories with versioned ones.
|
||||||
|
Also, renames ld.config.txt, llndk.libraries.txt and vndksp.libraries.txt
|
||||||
|
files to have version suffix.
|
||||||
|
|
||||||
Unversioned VNDK directories: /system/${LIB}/vndk[-sp]
|
Unversioned VNDK directories: /system/${LIB}/vndk[-sp]
|
||||||
Versioned VNDK directories: /system/${LIB}/vndk[-sp]-27
|
Versioned VNDK directories: /system/${LIB}/vndk[-sp]-27
|
||||||
@@ -124,6 +126,13 @@ def revise_ld_config_txt_if_needed(vndk_version):
|
|||||||
Args:
|
Args:
|
||||||
vndk_version: int, version of VNDK snapshot
|
vndk_version: int, version of VNDK snapshot
|
||||||
"""
|
"""
|
||||||
|
def add_version_suffix(file_name):
|
||||||
|
logging.info('Rename {} to have version suffix'.format(vndk_version))
|
||||||
|
target_files = glob.glob(
|
||||||
|
os.path.join(utils.CONFIG_DIR_PATH_PATTERN, file_name))
|
||||||
|
for target_file in target_files:
|
||||||
|
name, ext = os.path.splitext(target_file)
|
||||||
|
os.rename(target_file, name + '.' + str(vndk_version) + ext)
|
||||||
if vndk_version == 27:
|
if vndk_version == 27:
|
||||||
logging.info('Revising ld.config.txt for O-MR1...')
|
logging.info('Revising ld.config.txt for O-MR1...')
|
||||||
re_pattern = '(system\/\${LIB}\/vndk(?:-sp)?)([:/]|$)'
|
re_pattern = '(system\/\${LIB}\/vndk(?:-sp)?)([:/]|$)'
|
||||||
@@ -136,6 +145,12 @@ def revise_ld_config_txt_if_needed(vndk_version):
|
|||||||
with open(ld_config_file, 'w') as file:
|
with open(ld_config_file, 'w') as file:
|
||||||
file.write(revised)
|
file.write(revised)
|
||||||
|
|
||||||
|
files_to_add_version_suffix = ('ld.config.txt',
|
||||||
|
'llndk.libraries.txt',
|
||||||
|
'vndksp.libraries.txt')
|
||||||
|
for file_to_rename in files_to_add_version_suffix:
|
||||||
|
add_version_suffix(file_to_rename)
|
||||||
|
|
||||||
|
|
||||||
def update_buildfiles(buildfile_generator):
|
def update_buildfiles(buildfile_generator):
|
||||||
logging.info('Generating root Android.bp file...')
|
logging.info('Generating root Android.bp file...')
|
||||||
@@ -248,7 +263,7 @@ def main():
|
|||||||
install_snapshot(args.branch, args.build, local, install_dir,
|
install_snapshot(args.branch, args.build, local, install_dir,
|
||||||
temp_artifact_dir)
|
temp_artifact_dir)
|
||||||
gather_notice_files(install_dir)
|
gather_notice_files(install_dir)
|
||||||
revise_ld_config_txt_if_needed(vndk_version)
|
post_processe_files_if_needed(vndk_version)
|
||||||
|
|
||||||
buildfile_generator = GenBuildFile(install_dir, vndk_version)
|
buildfile_generator = GenBuildFile(install_dir, vndk_version)
|
||||||
update_buildfiles(buildfile_generator)
|
update_buildfiles(buildfile_generator)
|
||||||
|
|||||||
Reference in New Issue
Block a user