Optimize: Reduce vendor target build files
Prevent system/% files from being built by BUILDING_SYSTEM_IMAGE
and data/% files from being built by BUILDING_USERDATA_IMAGE
1) Address issue where system/% files were
being built even when
PRODUCT_BUILD_SYSTEM_IMAGE was false.
This change reduces the ninja targets for
aosp_cf_x86_64_phone_vendor-trunk_staging-userdebug
from 140,427 to 57,303
Test:
lunch aosp_cf_x86_64_phone_vendor-trunk_staging-userdebug ; m
2) Resolve issue where data/% files were
being built during "m dist" even if
PRODUCT_BUILD_USERDATA_IMAGE was set to false
Test: Set any module to install at data partition using
LOCAL_MODULE_PATH=$(TARGET_OUT_DATA)/app
lunch aosp_cf_x86_64_phone_vendor-trunk_staging-userdebug ; m dist
Check the contents at out/target/product/vsoc_x86_64 and out/dist
Change-Id: I2a914339231d57598a6f30fc83fd8203d4107a11
diff --git a/core/main.mk b/core/main.mk
index 85fd65c..5c280da 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1860,6 +1860,11 @@
filter_out_files += $(PRODUCT_OUT)/recovery/%
endif
+# userdata.img
+ifndef BUILDING_USERDATA_IMAGE
+filter_out_files += $(PRODUCT_OUT)/data/%
+endif
+
installed_files := $(sort $(filter-out $(filter_out_files),$(filter $(PRODUCT_OUT)/%,$(modules_to_install))))
else
installed_files := $(apps_only_installed_files)