Split populate_stubs out of populate_dist
Separates the logic from populate_dist which handles the legacy stubs
directory into its own populate_stubs directory. That is in preparation
for calling populate_dist multiple times to create sdk snapshots for
different build releases.
Test: atest mainline_modules_sdks_test
packages/modules/common/build/mainline_modules_sdks.sh
tree out/dist/mainline-sdks out/dist/stubs
- check that it is identical to before this change
Bug: 204763318
Change-Id: Idada531b7f88dee3fea861a059a0773bc983853d
This commit is contained in:
@@ -388,6 +388,7 @@ class SdkDistProducer:
|
||||
sdk_versions = SDK_VERSIONS
|
||||
self.build_sdks(sdk_versions, modules)
|
||||
self.populate_dist(sdk_versions, modules)
|
||||
self.populate_stubs(modules)
|
||||
|
||||
def build_sdks(self, sdk_versions, modules):
|
||||
self.snapshot_builder.build_snapshots(sdk_versions, modules)
|
||||
@@ -402,7 +403,7 @@ class SdkDistProducer:
|
||||
extract_matching_files_from_zip(
|
||||
sdk_path, dest_dir, r"sdk_library/[^/]+/[^/]+\.(txt|jar|srcjar)")
|
||||
|
||||
def populate_dist(self, sdk_versions, modules):
|
||||
def populate_stubs(self, modules):
|
||||
# TODO(b/199759953): Remove stubs once it is no longer used by gantry.
|
||||
# Clear and populate the stubs directory.
|
||||
stubs_dir = os.path.join(self.dist_dir, "stubs")
|
||||
@@ -416,6 +417,7 @@ class SdkDistProducer:
|
||||
if sdk.endswith("-sdk"):
|
||||
self.unzip_current_stubs(sdk, apex)
|
||||
|
||||
def populate_dist(self, sdk_versions, modules):
|
||||
# Clear and populate the mainline-sdks dist directory.
|
||||
sdks_dist_dir = os.path.join(self.dist_dir, "mainline-sdks")
|
||||
shutil.rmtree(sdks_dist_dir, ignore_errors=True)
|
||||
|
||||
Reference in New Issue
Block a user