Add sdk modules list in build artifacts root.

Add list of all the sdk supported modules in sdk-modules.txt. This file
should generate for all builds (even when only non-sdk modules build is
requested).
The file only contains modules which are requested by the build, and
supports sdk.

Bug: 242316893

Test: Generate sdk-modules.txt in the dist directory root.
Test: atest --host mainline_modules_sdks_test --no-bazel-mode

Change-Id: Ic8aa3c63209717e1076c4c51f1232dd5afcdd6d4
This commit is contained in:
Gurpreet Singh
2023-06-12 13:11:04 +01:00
parent ee3e424d51
commit d822398d79
2 changed files with 86 additions and 0 deletions

View File

@@ -1269,6 +1269,13 @@ class SdkDistProducer:
shutil.copy(sdk_gantry_metadata_json_path,
sdk_dist_gantry_metadata_json_path)
def dist_generate_sdk_supported_modules_file(self, modules):
sdk_modules_file = os.path.join(self.dist_dir, "sdk-modules.txt")
with open(sdk_modules_file, "w", encoding="utf8") as file:
for module in modules:
if module in MAINLINE_MODULES:
file.write(aosp_to_google_name(module.apex) + "\n")
def populate_unbundled_dist(self, build_release, modules, snapshots_dir):
build_release_dist_dir = os.path.join(self.mainline_sdks_dir,
build_release.sub_dir)
@@ -1532,6 +1539,7 @@ def main(args):
modules += PLATFORM_SDKS_FOR_MAINLINE
producer = create_producer(args.tool_path)
producer.dist_generate_sdk_supported_modules_file(modules)
producer.produce_dist(modules, build_releases)