From 0f2ab4603852855b046f99c035da42e51651c9a9 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 18 May 2017 13:42:40 -0700 Subject: [PATCH] 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 --- core/cleanbuild.mk | 82 ---------------------------------------------- core/config.mk | 3 +- core/main.mk | 2 -- 3 files changed, 1 insertion(+), 86 deletions(-) diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk index b7109f60bc..0e1c88d33e 100644 --- a/core/cleanbuild.mk +++ b/core/cleanbuild.mk @@ -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 diff --git a/core/config.mk b/core/config.mk index badb9b1fc5..8b7ea24a3d 100644 --- a/core/config.mk +++ b/core/config.mk @@ -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 \ diff --git a/core/main.mk b/core/main.mk index f22e63d11e..1b7d013984 100644 --- a/core/main.mk +++ b/core/main.mk @@ -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: