Remove support for user tags in the build system.

It is not forbidden to say LOCAL_MODULE_TAGS := user,
and if you don't say LOCAL_MODULE_TAGS, it now defaults
to optional.

Change-Id: I0a0b200bb6f1c7bf1fe3a89cdc8f69678617526c
This commit is contained in:
Joe Onorato
2012-05-22 14:08:50 -07:00
parent 8cfca47f5a
commit 529302d912
5 changed files with 49 additions and 612 deletions

View File

@@ -58,55 +58,31 @@ endif
LOCAL_UNINSTALLABLE_MODULE := $(strip $(LOCAL_UNINSTALLABLE_MODULE))
LOCAL_MODULE_TAGS := $(sort $(LOCAL_MODULE_TAGS))
ifeq (,$(LOCAL_MODULE_TAGS))
ifeq (true,$(LOCAL_UNINSTALLABLE_MODULE))
LOCAL_MODULE_TAGS := optional
else
ifneq ($(LOCAL_IS_HOST_MODULE),true)
# Installable target modules without tags fall back to user (which is changed to user eng
# below)
LOCAL_MODULE_TAGS := user
endif
endif
#$(warning default tags: $(lastword $(filter-out config/% out/%,$(MAKEFILE_LIST))))
LOCAL_MODULE_TAGS := optional
endif
# User tags are not allowed anymore. Fail early because it will not be installed
# like it used to be.
ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
$(warning *** Module name: $(LOCAL_MODULE))
$(warning *** Makefile location: $(LOCAL_MODULE_MAKEFILE))
$(warning * )
$(warning * Module is attempting to use the 'user' tag. This)
$(warning * used to cause the module to be installed automatically.)
$(warning * Now, the module must be listed in the PRODUCT_PACKAGES)
$(warning * section of a product makefile to have it installed.)
$(warning * )
$(error user tag detected on module.)
endif
# Only the tags mentioned in this test are expected to be set by module
# makefiles. Anything else is either a typo or a source of unexpected
# behaviors.
ifneq ($(filter-out user debug eng tests optional samples shell_ash shell_mksh,$(LOCAL_MODULE_TAGS)),)
ifneq ($(filter-out debug eng tests optional samples shell_ash shell_mksh,$(LOCAL_MODULE_TAGS)),)
$(warning unusual tags $(LOCAL_MODULE_TAGS) on $(LOCAL_MODULE) at $(LOCAL_PATH))
endif
ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
ifeq ($(filter $(GRANDFATHERED_USER_MODULES),$(LOCAL_MODULE)),)
$(warning *** Module name: $(LOCAL_MODULE))
$(warning *** Makefile location: $(LOCAL_PATH))
$(warning * )
$(warning * Each module must use a LOCAL_MODULE_TAGS in its)
$(warning * Android.mk. Possible tags declared by a module:)
$(warning * )
$(warning * optional, debug, eng, tests, samples)
$(warning * )
$(warning * If the module is expected to be in all builds)
$(warning * of a product, then it should use the)
$(warning * "optional" tag: )
$(warning * )
$(warning * Add "LOCAL_MODULE_TAGS := optional" in the)
$(warning * Android.mk for the affected module, and add)
$(warning * the LOCAL_MODULE value for that component)
$(warning * into the PRODUCT_PACKAGES section of product)
$(warning * makefile(s) where it is necessary, if)
$(warning * appropriate.)
$(warning * )
$(warning * If the component should be in EVERY build of ALL)
$(warning * products, then add its LOCAL_MODULE value to the)
$(warning * PRODUCT_PACKAGES section of)
$(warning * build/target/product/core.mk)
$(warning * )
$(error user tag detected on new module - user tags are only supported on legacy modules)
endif
endif
# Add implicit tags.
#
@@ -121,27 +97,11 @@ ifneq ($(gpl_license_file),)
ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
endif
#
# If this module is listed on CUSTOM_MODULES, promote it to "user"
# so that it will be installed in $(TARGET_OUT).
#
ifneq (,$(filter $(LOCAL_MODULE),$(CUSTOM_MODULES)))
LOCAL_MODULE_TAGS := $(sort $(LOCAL_MODULE_TAGS) user)
endif
LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
ifneq ($(words $(LOCAL_MODULE_CLASS)),1)
$(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)")
endif
# Those used to be implicitly ignored, but aren't any more.
# As of 20100110 there are no apps with the user tag.
ifeq ($(LOCAL_MODULE_CLASS),APPS)
ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
$(warning user tag on app $(LOCAL_MODULE) at $(LOCAL_PATH) - add your app to core.mk instead)
endif
endif
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
ifdef LOCAL_IS_HOST_MODULE
partition_tag :=
@@ -554,8 +514,8 @@ ifeq ($(LOCAL_IS_HOST_MODULE),true)
ifneq ($(filter optional,$(LOCAL_MODULE_TAGS)),optional)
ALL_HOST_INSTALLED_FILES += $(LOCAL_INSTALLED_MODULE)
endif
ifneq ($(filter user debug eng tests, $(LOCAL_MODULE_TAGS)),)
$(error $(LOCAL_MODULE_MAKEFILE): Module "$(LOCAL_MODULE)" has useless module tags: $(filter user debug eng tests, $(LOCAL_MODULE_TAGS)). It will be installed anyway.)
ifneq ($(filter debug eng tests, $(LOCAL_MODULE_TAGS)),)
$(error $(LOCAL_MODULE_MAKEFILE): Module "$(LOCAL_MODULE)" has useless module tags: $(filter debug eng tests, $(LOCAL_MODULE_TAGS)). It will be installed anyway.)
endif
endif