diff options
author | Anton Hansson <hansson@google.com> | 2022-04-28 14:02:47 +0000 |
---|---|---|
committer | Anton Hansson <hansson@google.com> | 2022-04-29 08:50:46 +0000 |
commit | f258d0368f74085681b76a19aeb2ac6e5c714685 (patch) | |
tree | 1179aae2f466ccd9ba38fcdadee04564a8ac9752 | |
parent | 9ea376ddb288d03225157e538fd4e574fa973947 (diff) | |
download | common-f258d0368f74085681b76a19aeb2ac6e5c714685.tar.gz |
Address review comments on finalize_sdk.py
- Keep the Android.bp -- but rename to Android.bp.auto
- Use 'or' instead of 'if not'
Bug: 222050148
Test: Run finalize_sdk.py
Change-Id: I919c3d37916d3854cd0c8d59fddb8a1420f429b9
-rwxr-xr-x | tools/finalize_sdk.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/finalize_sdk.py b/tools/finalize_sdk.py index 84fd762e..c045295e 100755 --- a/tools/finalize_sdk.py +++ b/tools/finalize_sdk.py @@ -90,9 +90,7 @@ build_target = BUILD_TARGET_TRAIN if args.bid[0] == 'T' else BUILD_TARGET_CONTIN branch_name = 'finalize-%d' % args.finalize_sdk cmdline = " ".join([x for x in sys.argv if x not in ['-a', '--amend_last_commit']]) commit_message = COMMIT_TEMPLATE % (args.finalize_sdk, args.bid, cmdline, args.bug) -module_names = args.modules -if not module_names: - module_names = ['*'] +module_names = args.modules or ['*'] compat_dir = COMPAT_REPO.joinpath('extensions/%d' % args.finalize_sdk) if compat_dir.is_dir(): @@ -112,8 +110,8 @@ for m in module_names: with zipfile.ZipFile(tmpdir.joinpath(f)) as zipFile: zipFile.extractall(target_dir) - # Just capture the artifacts, not the bp files of finalized versions - os.remove(target_dir.joinpath('Android.bp')) + # Disable the Android.bp, but keep it for reference / potential future use. + shutil.move(target_dir.joinpath('Android.bp'), target_dir.joinpath('Android.bp.auto')) print('Created %s' % target_dir) created_dirs[repo].add(dir) |