# Don't bother with this extra part when explicitly building the sdk product.
building_sdk :=
endif
-current_build_config := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)
+
+# A change in the list of locales warrants an installclean, too.
+locale_list := $(subst $(space),$(comma),$(strip $(PRODUCT_LOCALES)))
+
+current_build_config := \
+ $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)-{$(locale_list)}
building_sdk :=
+locale_list :=
force_installclean := false
# Read the current state from the file, if present.
ifdef PREVIOUS_BUILD_CONFIG
ifneq "$(current_build_config)" "$(PREVIOUS_BUILD_CONFIG)"
$(info *** Build configuration changed: "$(PREVIOUS_BUILD_CONFIG)" -> "$(current_build_config)")
- force_installclean := true
+ ifneq ($(DISABLE_AUTO_INSTALLCLEAN),true)
+ force_installclean := true
+ else
+ $(info DISABLE_AUTO_INSTALLCLEAN is set; skipping auto-clean. Your tree may be in an inconsistent state.)
+ endif
endif
endif # else, this is the first build, so no need to clean.
PREVIOUS_BUILD_CONFIG :=
./$(PRODUCT_OUT)/*.xlb \
./$(PRODUCT_OUT)/*.zip \
./$(PRODUCT_OUT)/data \
+ ./$(PRODUCT_OUT)/obj/lib \
./$(PRODUCT_OUT)/obj/APPS \
./$(PRODUCT_OUT)/obj/NOTICE_FILES \
./$(PRODUCT_OUT)/obj/PACKAGING \
./$(PRODUCT_OUT)/recovery \
./$(PRODUCT_OUT)/root \
+ ./$(PRODUCT_OUT)/symbols/system/lib \
./$(PRODUCT_OUT)/system
# The files/dirs to delete during a dataclean, which removes any files