From dca3186b8440e547c29c8ab110fc699c157aec84 Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Wed, 3 Apr 2019 08:59:49 -0700 Subject: [PATCH] Skip unneeded notice files for ETC modules. Non-installable, non-library modules can still have notice files attached if they are bundled in an apex module, in which case the current make setting would generate an error. This change makes it just ignore them silently if the module is ETC. Other classes will still trigger an error. Test: manual build + TreeHugger Change-Id: Ic7931f990369f744c8de62956a1a0a9c0451d6ab --- core/notice_files.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/notice_files.mk b/core/notice_files.mk index e687ab2f68..c3147341b4 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -38,6 +38,8 @@ else endif endif +installed_notice_file := + ifdef notice_file ifdef my_register_name @@ -71,12 +73,17 @@ else endif module_installed_filename := \ $(patsubst $(PRODUCT_OUT)/%,%,$($(my_prefix)OUT_JAVA_LIBRARIES))/$(module_leaf) + else ifeq ($(LOCAL_MODULE_CLASS),ETC) + # ETC modules may be uninstallable, yet still have a NOTICE file. e.g. apex components + module_installed_filename := else $(error Cannot determine where to install NOTICE file for $(LOCAL_MODULE)) endif # JAVA_LIBRARIES endif # STATIC_LIBRARIES endif +ifdef module_installed_filename + # In case it's actually a host file module_installed_filename := $(patsubst $(HOST_OUT)/%,%,$(module_installed_filename)) module_installed_filename := $(patsubst $(HOST_CROSS_OUT)/%,%,$(module_installed_filename)) @@ -110,10 +117,8 @@ $(LOCAL_BUILT_MODULE): | $(installed_notice_file) endif # JAVA_LIBRARIES endif # TARGET_BUILD_APPS -else -# NOTICE file does not exist -installed_notice_file := -endif +endif # module_installed_filename +endif # notice_file # Create a predictable, phony target to build this notice file. # Define it even if the notice file doesn't exist so that other