OSDN Git Service

Copy over aidl info for modules not loaded by the current build
authorYing Wang <wangying@google.com>
Wed, 9 Jul 2014 05:11:06 +0000 (22:11 -0700)
committerYing Wang <wangying@google.com>
Wed, 9 Jul 2014 05:11:06 +0000 (22:11 -0700)
That way we don't lose the record if user is running mm/mmm.

Change-Id: I1e1a8b99b4f659b73f73d89f409a24aa36464066

core/post_clean.mk

index 746ec2f..9f15b6d 100644 (file)
@@ -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 :=