From 3abc2a392664fd08288d39513fc41182af7fefaf Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 8 Jul 2014 22:11:06 -0700 Subject: Copy over aidl info for modules not loaded by the current build That way we don't lose the record if user is running mm/mmm. Change-Id: I1e1a8b99b4f659b73f73d89f409a24aa36464066 --- core/post_clean.mk | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'core/post_clean.mk') diff --git a/core/post_clean.mk b/core/post_clean.mk index 746ec2f..9f15b6d 100644 --- a/core/post_clean.mk +++ b/core/post_clean.mk @@ -59,12 +59,16 @@ current_all_packages_config := previous_aidl_config := $(TARGET_OUT_COMMON_INTERMEDIATES)/previous_aidl_config.mk current_aidl_config := $(TARGET_OUT_COMMON_INTERMEDIATES)/current_aidl_config.mk -$(shell rm -rf $(current_aidl_config) && mkdir -p $(dir $(current_aidl_config))) +$(shell rm -rf $(current_aidl_config) \ + && mkdir -p $(dir $(current_aidl_config))\ + && touch $(current_aidl_config)) -include $(previous_aidl_config) intermediates_to_clean := +modules_with_aidl_files := $(foreach p, $(ALL_MODULES), \ $(if $(ALL_MODULES.$(p).AIDL_FILES),\ + $(eval modules_with_aidl_files += $(p))\ $(shell echo 'AIDL_FILES.$(p) := $(ALL_MODULES.$(p).AIDL_FILES)' >> $(current_aidl_config)))\ $(if $(filter-out $(ALL_MODULES.$(p).AIDL_FILES),$(AIDL_FILES.$(p))),\ $(eval intermediates_to_clean += $(ALL_MODULES.$(p).INTERMEDIATE_SOURCE_DIR)))) @@ -75,8 +79,17 @@ $(shell rm -rf $(intermediates_to_clean)) intermediates_to_clean := endif +# For modules not loaded by the current build (e.g. you are running mm/mmm), +# we copy the info from the previous bulid. +$(foreach p, $(filter-out $(modules_with_aidl_files),$(MODULES_WITH_AIDL_FILES)),\ + $(shell echo 'AIDL_FILES.$(p) := $(AIDL_FILES.$(p))' >> $(current_aidl_config))) +MODULES_WITH_AIDL_FILES := $(sort $(MODULES_WITH_AIDL_FILES) $(modules_with_aidl_files)) +$(shell echo 'MODULES_WITH_AIDL_FILES := $(MODULES_WITH_AIDL_FILES)' >> $(current_aidl_config)) + # Now current becomes previous. $(shell mv -f $(current_aidl_config) $(previous_aidl_config)) +MODULES_WITH_AIDL_FILES := +modules_with_aidl_files := previous_aidl_config := current_aidl_config := -- cgit v1.1