Dist bundle modules from Soong
Dist bundle modules when requested by TARGET_BUILD_APPS.
Bug: 117295826
Test: tapas RecoveryLocalizer && m dist
Change-Id: Iad63ceafc2a60e6735b50eca65cc4859f9d71b52
diff --git a/core/main.mk b/core/main.mk
index 6ff5f93..4e933da 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1299,6 +1299,12 @@
# Dist the installed files if they exist.
apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED))
$(call dist-for-goals,apps_only, $(apps_only_installed_files))
+
+ # Dist the bundle files if they exist.
+ apps_only_bundle_files := $(foreach m,$(unbundled_build_modules),\
+ $(if $(ALL_MODULES.$(m).BUNDLE),$(ALL_MODULES.$(m).BUNDLE):$(m)-base.zip))
+ $(call dist-for-goals,apps_only, $(apps_only_bundle_files))
+
# For uninstallable modules such as static Java library, we have to dist the built file,
# as <module_name>.<suffix>
apps_only_dist_built_files := $(foreach m,$(unbundled_build_modules),$(if $(ALL_MODULES.$(m).INSTALLED),,\