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 3445f8fd1e
commit 6a185e453d
5 changed files with 45 additions and 608 deletions

View File

@ -58,56 +58,30 @@ 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 necessary, if appropriate.)
$(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.
#
# If the local directory or one of its parents contains a MODULE_LICENSE_GPL
@ -121,27 +95,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 +512,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

View File

@ -2069,10 +2069,6 @@ endef
# when requested.
include $(BUILD_SYSTEM)/distdir.mk
# -----------------------------------------------------------------
# The modules allowed to use a user tag
include $(BUILD_SYSTEM)/user_tags.mk
# broken:
# $(foreach file,$^,$(if $(findstring,.a,$(suffix $file)),-l$(file),$(file)))

View File

@ -114,10 +114,10 @@ TARGET_COPY_OUT_RECOVERY := recovery
# variables that we need in order to locate the output files.
include $(BUILD_SYSTEM)/product_config.mk
build_variant := $(filter-out eng user userdebug tests,$(TARGET_BUILD_VARIANT))
build_variant := $(filter-out user userdebug eng tests,$(TARGET_BUILD_VARIANT))
ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
$(error must be empty or one of: eng user userdebug tests)
$(error must be empty or one of: user userdebug eng tests)
endif
# ---------------------------------------------------------------

View File

@ -224,13 +224,11 @@ include $(BUILD_SYSTEM)/definitions.mk
# Bring in dex_preopt.mk
include $(BUILD_SYSTEM)/dex_preopt.mk
ifneq ($(filter eng user userdebug,$(MAKECMDGOALS)),)
ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),)
$(info ***************************************************************)
$(info ***************************************************************)
$(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \
$(info Do not pass '$(filter user userdebug eng tests,$(MAKECMDGOALS))' on \
the make command line.)
# XXX The single quote on this line fixes gvim's syntax highlighting.
# Without which, the rest of this file is impossible to read.
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
$(info choosecombo.)
$(info ***************************************************************)
@ -279,13 +277,13 @@ endif # HAVE_SELINUX
## user/userdebug ##
user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT))
user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
enable_target_debugging := true
tags_to_install :=
ifneq (,$(user_variant))
# Target is secure in user builds.
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
tags_to_install := user
ifeq ($(user_variant),userdebug)
# Pick up some extra useful tools
tags_to_install += debug
@ -333,7 +331,7 @@ endif # !enable_target_debugging
## eng ##
ifeq ($(TARGET_BUILD_VARIANT),eng)
tags_to_install := user debug eng
tags_to_install := debug eng
ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),)
# Don't require the setup wizard on eng builds
ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
@ -345,7 +343,7 @@ endif
## tests ##
ifeq ($(TARGET_BUILD_VARIANT),tests)
tags_to_install := user debug eng tests
tags_to_install := debug eng tests
endif
## sdk ##
@ -362,7 +360,7 @@ endif
# TODO: this should be eng I think. Since the sdk is built from the eng
# variant.
tags_to_install := user debug eng
tags_to_install := debug eng
ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true
ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
else # !sdk
@ -591,44 +589,28 @@ add-required-deps :=
# -------------------------------------------------------------------
# Figure out our module sets.
#
# Of the modules defined by the component makefiles,
# determine what we actually want to build.
Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \
$(CUSTOM_MODULES))
# TODO: Remove the 3 places in the tree that use
# ALL_DEFAULT_INSTALLED_MODULES and get rid of it from this list.
ifdef FULL_BUILD
# The base list of modules to build for this product is specified
# by the appropriate product definition file, which was included
# by product_config.make.
user_PACKAGES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)
$(call expand-required-modules,user_PACKAGES,$(user_PACKAGES))
user_PACKAGES := $(call module-installed-files, $(user_PACKAGES))
product_MODULES := $(call module-installed-files, \
$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
ifeq (0,1)
$(info product_MODULES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
$(foreach p,$(product_MODULES),$(info : $(p)))
$(error done)
endif
else
# We're not doing a full build, and are probably only including
# a subset of the module makefiles. Don't try to build any modules
# requested by the product, because we probably won't have rules
# to build them.
user_PACKAGES :=
product_MODULES :=
endif
# Use tags to get the non-APPS user modules. Use the product
# definition files to get the APPS user modules.
user_MODULES := $(sort $(call get-tagged-modules,user shell_$(TARGET_SHELL)))
# Print the user modules that are not in ...PRODUCT_PACKAGES
ifeq (1,1)
$(warning Writing modules list: modules/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT).txt)
$(shell rm -f modules/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT).txt)
$(foreach m, \
$(filter-out $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
$(call module-names-for-tag-list, user)), \
$(shell echo $m >> modules/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT).txt))
endif
user_MODULES := $(user_MODULES) $(user_PACKAGES)
eng_MODULES := $(sort \
$(call get-tagged-modules,eng) \
@ -643,11 +625,16 @@ tests_MODULES := $(sort \
$(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \
)
ifeq ($(strip $(tags_to_install)),)
$(error ASSERTION FAILED: tags_to_install should not be empty)
endif
modules_to_install := $(sort $(Default_MODULES) \
$(foreach tag,$(tags_to_install),$($(tag)_MODULES)))
# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES
# and get rid of it from this list.
# TODO: The shell is chosen by magic. Do we still need this?
modules_to_install := $(sort \
$(ALL_DEFAULT_INSTALLED_MODULES) \
$(product_MODULES) \
$(foreach tag,$(tags_to_install),$($(tag)_MODULES)) \
$(call get-tagged-modules, shell_$(TARGET_SHELL)) \
$(CUSTOM_MODULES) \
)
# Some packages may override others using LOCAL_OVERRIDES_PACKAGES.
# Filter out (do not install) any overridden packages.
@ -705,15 +692,6 @@ ALL_DEFAULT_INSTALLED_MODULES :=
endif # dont_bother
# Print the modules that we think we will install
ifeq (1,1)
$(warning Writing installed file list: installed/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT).txt)
$(shell rm -f installed/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT).txt)
$(foreach m, $(modules_to_install), \
$(shell echo $m >> installed/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT).txt))
$(error stop)
endif
# These are additional goals that we build, in order to make sure that there
# is as little code as possible in the tree that doesn't build.

View File

@ -1,495 +0,0 @@
#
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This is the list of modules grandfathered to use a user tag
# DO NOT ADD ANY NEW MODULE TO THIS FILE
#
# user modules are hard to control and audit and we don't want
# to add any new such module in the system
GRANDFATHERED_USER_MODULES :=
-include vendor/google/user_tags.mk
GRANDFATHERED_USER_MODULES += \
20-dns.conf \
95-configured \
aapt \
acp \
adb \
AdbWinApi \
AdbWinUsbApi \
adbd \
aidl \
am \
android \
android-common \
android-common-carousel \
android.policy \
androidprefs \
android.test.runner \
ant \
antlr-2.7.7 \
anttasks \
apicheck \
apkcheck \
applypatch \
app_process \
archquery \
atree \
audio \
badblocks \
badblocks_host \
bb2sym \
bb_dump \
bbprof \
bcc \
bison \
bluetoothd \
bmgr \
bootanimation \
brcm_patchram_plus \
bugreport \
cfassembler \
check_stack \
check_trace \
com.android.phone.common \
com.android.vcard \
commons-compress-1.0 \
content \
copybit.qsd8k \
copybit.s5pc110 \
coverage \
cpufeatures \
cts \
CtsAppSecurityTests \
cts-dalvik-buildutil \
dasm \
dbus-daemon \
ddmlib \
ddmlib-prebuilt \
ddmlibTests \
ddms \
ddmuilib \
debuggerd \
descGen \
dexgen \
dexpreopt \
dex-tools \
dhcpcd \
dhcpcd.conf \
dhcpcd-run-hooks \
dictTest \
dnsmasq \
doclava \
draw9patch \
dumpeventlog \
dumpkey \
dump_regions \
dumpstate \
dumpsys \
dx-tests \
e2fsck \
e2fsck_host \
easymock \
easymocklib \
edify \
elftree \
emmalib \
emulator \
emulator-arm \
emulator-mips \
emulator-core \
emulator-elff \
emulator-hw \
emulator-memcheck \
emulator-tcg \
emulator-ui \
etc1tool \
eventanalyzer \
exc_dump \
fastboot \
framework \
FrameworkCoreHostTests \
frameworks-core-util-lib \
fsck_msdos \
fs_get_stats \
fw_bcm4329_apsta.bin \
fw_bcm4329.bin \
genext2fs \
gps.mahimahi \
gralloc.default \
gralloc.qsd8k \
groovy-all-1.7.0 \
grxmlcompile \
guava \
guavalib \
gzip \
hciattach \
hierarchyviewer \
hierarchyviewer1 \
hierarchyviewer2 \
hierarchyviewerlib \
hist_trace \
hosttestlib \
idegen \
ime \
init \
input \
ip \
jarjar \
javax.obex \
jcommon-1.0.12 \
jdiff \
jdwpspy \
jfreechart-1.0.9 \
jfreechart-1.0.9-swt \
jsilver \
jsr305 \
jsr305lib \
junit \
jython \
kxml2-2.3.0 \
launch-wrapper \
layoutlib \
layoutlib_api \
layoutlib_create \
layoutlib_utils \
liba2dp \
libabi \
libandroid \
libandroid_runtime \
libandroid_servers \
libarity \
libaudio \
libaudioeffect_jni \
libaudioflinger \
libaudiointerface \
libaudiopolicy \
libaudiopolicybase \
libbinder \
libbluedroid \
libbluetooth \
libbluetoothd \
libbuiltinplugin \
libbundlewrapper \
libbz \
libc \
libcamera_client \
libcameraservice \
libcamerastub \
libc_common \
libchromium_net \
libc_nomalloc \
libctest \
libcutils \
libdb \
libdbus \
libdiskconfig \
libdiskconfig_host \
libdl \
libdrm1 \
libdrm1_jni \
libebl \
libebl_arm \
libebl_sh \
libebl_mips \
libedify \
libeffects \
libEGL \
libelf \
libESR_Portable \
libESR_Shared \
libETC1 \
libext \
libext2_blkid \
libext2_blkid_host \
libext2_com_err \
libext2_com_err_host \
libext2_e2p \
libext2_e2p_host \
libext2fs \
libext2fs_host \
libext2_profile \
libext2_profile_host \
libext2_uuid \
libext2_uuid_host \
libfdlibm \
libfdlibm-host \
libFFTEm \
libfst \
libft2 \
libgdbus_static \
libgif \
libGLES_android \
libGLESv1_CM \
libGLESv2 \
libglib \
libgui \
libhardware \
libhardware_legacy \
libhost \
libhyphenation \
libiprouteutil \
libiptc \
libjnigraphics \
libjni_latinime \
libjpeg \
libjs \
liblinenoise \
libloc_api-rpc \
liblog \
libm \
libmedia \
libmedia_jni \
libmediaplayerservice \
libmincrypt \
libminelf \
libminui \
libminzip \
libmtdutils \
libmtp \
libmusicbundle \
libneo_cgi \
libneo_cs \
libneo_util \
libnetlink \
libnetutils \
libop \
libOpenSLES \
libopensles_helper \
libOpenSLESUT \
libpcap \
libpixelflinger \
libpixelflinger_static \
libpng \
libpopt \
libpower \
libprotobuf-cpp-2.3.0-full \
libprotobuf-cpp-2.3.0-lite \
libprotobuf-java-2.3.0-lite \
libprotobuf-java-2.3.0-micro \
librecovery_ui_htc \
libreference-ril \
libreverb \
libreverbwrapper \
libril \
librilproto-java \
librpc \
librtp_jni \
libsafe_iop \
libSDL \
libSDLmain \
libsensorservice \
libskia \
libskiagl \
libsonivox \
libsoundpool \
libspeex \
libsqlite \
libsqlite3_android \
libSR_AcousticModels \
libSR_AcousticState \
libSR_AudioIn \
libSR_Core \
libSR_EventLog \
libSR_G2P \
libSR_Grammar \
libSR_Nametag \
libSR_Recognizer \
libSR_Semproc \
libSR_Session \
libSR_Vocabulary \
libstagefright_aacdec \
libstagefright_aacenc \
libstagefright_amrnb_common \
libstagefright_amrnbdec \
libstagefright_amrnbenc \
libstagefright_amrwbdec \
libstagefright_amrwbenc \
libstagefright_avc_common \
libstagefright_avcdec \
libstagefright_avcenc \
libstagefright_color_conversion \
libstagefright_enc_common \
libstagefright_foundation \
libstagefright_g711dec \
libstagefright_httplive \
libstagefrighthw \
libstagefright_id3 \
libstagefright_m4vh263dec \
libstagefright_m4vh263enc \
libstagefright_matroska \
libstagefright_mp3dec \
libstagefright_mpeg2ts \
libstagefright_omx \
libstagefright_rtsp \
libstagefright_vorbisdec \
libstagefright_vpxdec \
libstagefright_yuv \
libstdc++ \
libstlport \
libstlport_static \
libstorage \
libsurfaceflinger \
libsurfaceflinger_client \
libsvoxpico \
libsystem_server \
libsysutils \
libthread_db \
libtinyxml \
libtomcrypt \
libtommath \
libttspico \
libttssynthproxy \
libui \
libunz \
libusbhost \
libutil \
libutils \
libv8 \
libvisualizer \
libvorbisidec \
libvpx \
libwebcore \
libwpa_client \
libwrapsim \
libxml2 \
libxslt \
libzipfile \
lights.kraken \
lights.qsd8k \
line_endings \
linker \
llvm-rs-link \
localize \
logcat \
logwrapper \
lsd \
make_cfst \
makedict \
make_ext4fs \
make_g2g \
makekeycodes \
make_ve_grammar \
mediaserver \
minigzip \
mkbootfs \
mkbootimg \
mke2fs \
mke2fs_host \
mksdcard \
mksnapshot \
mkstubs \
mkuserimg.sh \
mkyaffs2image \
mockrilcontroller \
monkey \
monkeyrunner \
MonkeyRunnerTest \
mtp \
mtpd \
ndc \
netcfg \
netd \
network \
ninepatch \
oauth \
obbtool \
omx_tests \
org.eclipse.core.commands_3.4.0.I20080509-2000 \
org.eclipse.equinox.common_3.4.0.v20080421-2006 \
org.eclipse.jface_3.4.2.M20090107-0800 \
org-netbeans-api-visual \
org-openide-util \
osgi \
pand \
parseStringTest \
ping \
platform.xml \
pm \
post_trace \
pppd \
preload \
profile_pid \
profile_trace \
q2dm \
q2g \
qemu-android \
racoon \
read_addr \
read_method \
read_pid \
read_trace \
resize2fs \
resize2fs_host \
rgb2565 \
rsg-generator \
run-as \
runtime \
schedtest \
screenshot \
screenshot2 \
sdcard \
sdklauncher \
sdklib \
sdkmanager \
sdkstats \
sdkuilib \
sdk_v4 \
sdk_v5 \
sdk_v6 \
sdk_v7 \
sdk_v8 \
sdptool \
service \
servicemanager \
services \
sig \
sig-check \
sig-create \
signapk \
signature-tools \
spec-progress \
sqlite3 \
stack_dump \
stringtemplate \
surfaceflinger \
svc \
swing-worker-1.1 \
swt \
system_server \
tblgen \
tc \
temp_layoutlib \
test_g2g \
test-progress \
test-progress-new \
test_swiarb \
test_zipfile \
toolbox \
traceview \
tune2fs \
tune2fs_host \
usbtest \
vdc \
vm-tests \
vold \
wdsclient \
wpa_supplicant \
yuv420sp2rgb \
zipalign