diff options
| author | Justin Yun <justinyun@google.com> | 2019-01-23 19:25:05 +0900 |
|---|---|---|
| committer | Justin Yun <justinyun@google.com> | 2019-01-23 19:25:05 +0900 |
| commit | b59da8f6185c00fdcb936a9b67cbc98f0cb5c158 (patch) | |
| tree | db748876639346c2721703741959818146dd06ca /vndk | |
| parent | 06c57d0ecf8d5e1a9bf00ba8729ca42b5cdb5737 (diff) | |
| download | android_development-b59da8f6185c00fdcb936a9b67cbc98f0cb5c158.tar.gz android_development-b59da8f6185c00fdcb936a9b67cbc98f0cb5c158.tar.bz2 android_development-b59da8f6185c00fdcb936a9b67cbc98f0cb5c158.zip | |
vndk-snapshot: add version suffix for v27 files
To use ld.config.txt template, change the file names of v27 config
files to include version suffix.
Bug: 74658756
Bug: 123209911
Test: PRODUCT_EXTRA_VNDK_VERSIONS=27 m -j vndk_snapshot_package
Change-Id: Icc9f9970cf95fb4e888555ec0b080c44c81a0622
Diffstat (limited to 'vndk')
| -rw-r--r-- | vndk/snapshot/gen_buildfiles.py | 9 | ||||
| -rw-r--r-- | vndk/snapshot/update.py | 19 |
2 files changed, 21 insertions, 7 deletions
diff --git a/vndk/snapshot/gen_buildfiles.py b/vndk/snapshot/gen_buildfiles.py index 9a8d4de1b..f504f552e 100644 --- a/vndk/snapshot/gen_buildfiles.py +++ b/vndk/snapshot/gen_buildfiles.py @@ -129,11 +129,10 @@ class GenBuildFile(object): self._vndk_version)) etc_buildrules = [] for prebuilt in self.ETC_MODULES: - # Starting from P (VNDK version >= 28), ld.config.VER.txt is not - # installed as a prebuilt but is built and installed from the - # source tree at the time the VNDK snapshot is installed to the - # system.img. - if prebuilt == 'ld.config.txt' and self._vndk_version >= 28: + # ld.config.VER.txt is not installed as a prebuilt but is built and + # installed from thesource tree at the time the VNDK snapshot is + # installed to the system.img. + if prebuilt == 'ld.config.txt': continue etc_buildrules.append(self._gen_etc_prebuilt(prebuilt)) diff --git a/vndk/snapshot/update.py b/vndk/snapshot/update.py index d15cf0464..2a8441ed9 100644 --- a/vndk/snapshot/update.py +++ b/vndk/snapshot/update.py @@ -115,8 +115,10 @@ def gather_notice_files(install_dir): 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. + Also, renames ld.config.txt, llndk.libraries.txt and vndksp.libraries.txt + files to have version suffix. Unversioned VNDK directories: /system/${LIB}/vndk[-sp] Versioned VNDK directories: /system/${LIB}/vndk[-sp]-27 @@ -124,6 +126,13 @@ def revise_ld_config_txt_if_needed(vndk_version): Args: 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: logging.info('Revising ld.config.txt for O-MR1...') 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: 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): logging.info('Generating root Android.bp file...') @@ -248,7 +263,7 @@ def main(): install_snapshot(args.branch, args.build, local, install_dir, temp_artifact_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) update_buildfiles(buildfile_generator) |
