Move dataclean and installclean to soong_ui

This can be a little faster, but also means that we don't need to call
kati/ninja twice when we need to handle the automatic installclean.

Test: m -j installclean
Test: m -j dataclean
Change-Id: I8f5e5544bcf30c58bf9abee30a37256cb18436ac
This commit is contained in:
Dan Willemsen 2017-05-18 13:42:40 -07:00
parent 34b3a41217
commit 0f2ab46038
3 changed files with 1 additions and 86 deletions

View File

@ -144,88 +144,6 @@ INTERNAL_CLEAN_BUILD_VERSION :=
endif # if not ONE_SHOT_MAKEFILE dont_bother NO_ANDROID_CLEANSPEC
#
# installclean logic
#
# The files/dirs to delete during an installclean.
#
# Deletes all of the installed files -- the intent is to remove files
# that may no longer be installed, either because the user previously
# installed them, or they were previously installed by default but no
# longer are.
#
# This is faster than a full clean, since we're not deleting the
# intermediates. Instead of recompiling, we can just copy the results.
#
# Host bin, frameworks, and lib* are intentionally omitted, since
# otherwise we'd have to rebuild any generated files created with those
# tools.
installclean_files := \
$(HOST_OUT)/obj/NOTICE_FILES \
$(HOST_OUT)/obj/PACKAGING \
$(HOST_OUT)/coverage \
$(HOST_OUT)/cts \
$(HOST_OUT)/nativetest* \
$(HOST_OUT)/sdk \
$(HOST_OUT)/sdk_addon \
$(HOST_OUT)/testcases \
$(HOST_OUT)/vts \
$(HOST_CROSS_OUT)/bin \
$(HOST_CROSS_OUT)/coverage \
$(HOST_CROSS_OUT)/lib* \
$(HOST_CROSS_OUT)/nativetest* \
$(PRODUCT_OUT)/*.img \
$(PRODUCT_OUT)/*.ini \
$(PRODUCT_OUT)/*.txt \
$(PRODUCT_OUT)/*.xlb \
$(PRODUCT_OUT)/*.zip \
$(PRODUCT_OUT)/kernel \
$(PRODUCT_OUT)/data \
$(PRODUCT_OUT)/skin \
$(PRODUCT_OUT)/obj/NOTICE_FILES \
$(PRODUCT_OUT)/obj/PACKAGING \
$(PRODUCT_OUT)/recovery \
$(PRODUCT_OUT)/root \
$(PRODUCT_OUT)/system \
$(PRODUCT_OUT)/system_other \
$(PRODUCT_OUT)/vendor \
$(PRODUCT_OUT)/oem \
$(PRODUCT_OUT)/obj/FAKE \
$(PRODUCT_OUT)/breakpad \
$(PRODUCT_OUT)/cache \
$(PRODUCT_OUT)/coverage \
$(PRODUCT_OUT)/installer \
$(PRODUCT_OUT)/odm \
$(PRODUCT_OUT)/sysloader \
$(PRODUCT_OUT)/testcases \
# The files/dirs to delete during a dataclean, which removes any files
# in the staging and emulator data partitions.
dataclean_files := \
$(PRODUCT_OUT)/data/* \
$(PRODUCT_OUT)/data-qemu/* \
$(PRODUCT_OUT)/userdata-qemu.img
# make sure *_OUT is set so that we won't result in deleting random parts
# of the filesystem.
ifneq (2,$(words $(HOST_OUT) $(PRODUCT_OUT)))
$(error both HOST_OUT and PRODUCT_OUT should be set at this point.)
endif
# Define the rules for commandline invocation.
.PHONY: dataclean
dataclean: FILES := $(dataclean_files)
dataclean:
$(hide) rm -rf $(FILES)
@echo "Deleted emulator userdata images."
.PHONY: installclean
installclean: FILES := $(installclean_files)
installclean: dataclean
$(hide) rm -rf $(FILES)
@echo "Deleted images and staging directories."
###########################################################
.PHONY: clean-jack-files

View File

@ -856,8 +856,7 @@ endef
# These goals don't need to collect and include Android.mks/CleanSpec.mks
# in the source tree.
dont_bother_goals := dataclean installclean \
help out \
dont_bother_goals := out \
snod systemimage-nodeps \
stnod systemtarball-nodeps \
userdataimage-nodeps userdatatarball-nodeps \

View File

@ -1130,8 +1130,6 @@ endif # samplecode in $(MAKECMDGOALS)
.PHONY: findbugs
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
# The rules for dataclean and installclean are defined in cleanbuild.mk.
#xxx scrape this from ALL_MODULE_NAME_TAGS
.PHONY: modules
modules: