diff --git a/core/base_rules.mk b/core/base_rules.mk index 87df47267..3d5f51df8 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -354,7 +354,7 @@ endif # java_resource_file_groups ## PRIVATE java vars ###################################### -ifneq ($(strip $(all_java_sources)$(all_res_assets))$(LOCAL_STATIC_JAVA_LIBRARIES),) +ifneq ($(strip $(all_java_sources)$(all_res_assets))$(LOCAL_STATIC_JAVA_LIBRARIES)$(filter true,$(LOCAL_SOURCE_FILES_ALL_GENERATED)),) full_static_java_libs := \ $(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \ diff --git a/core/host_java_library.mk b/core/host_java_library.mk index 5e35b90b4..ca27f28a4 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk @@ -23,6 +23,9 @@ LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX) LOCAL_IS_HOST_MODULE := true LOCAL_BUILT_MODULE_STEM := javalib.jar +# base_rules.mk looks at this +all_res_assets := + ifeq ($(LOCAL_BUILD_HOST_DEX),true) ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) LOCAL_JAVA_LIBRARIES := $(sort core-hostdex $(LOCAL_JAVA_LIBRARIES)) diff --git a/core/java.mk b/core/java.mk index 0ec9af9f1..1c4558ff3 100644 --- a/core/java.mk +++ b/core/java.mk @@ -19,7 +19,7 @@ endif #PDK # but generated source files in its LOCAL_INTERMEDIATE_SOURCE_DIR. # You have to set up the dependency in some other way. ifeq (,$(strip $(LOCAL_SRC_FILES)$(all_res_assets)$(LOCAL_STATIC_JAVA_LIBRARIES))$(filter true,$(LOCAL_SOURCE_FILES_ALL_GENERATED))) -$(warning $(LOCAL_PATH): Target java module does not define any source or resource files) +$(error $(LOCAL_PATH): Target java module does not define any source or resource files) endif LOCAL_NO_STANDARD_LIBRARIES:=$(strip $(LOCAL_NO_STANDARD_LIBRARIES)) diff --git a/core/java_library.mk b/core/java_library.mk index 67c1bcb5a..9dbd79b43 100644 --- a/core/java_library.mk +++ b/core/java_library.mk @@ -18,10 +18,9 @@ ifneq (true,$(LOCAL_IS_STATIC_JAVA_LIBRARY)) ifneq (,$(LOCAL_RESOURCE_DIR)) $(error $(LOCAL_PATH): Target java libraries may not set LOCAL_RESOURCE_DIR) endif -endif - -#xxx base_rules.mk looks at this +# base_rules.mk looks at this all_res_assets := +endif LOCAL_BUILT_MODULE_STEM := javalib.jar diff --git a/core/static_java_library.mk b/core/static_java_library.mk index c3c5c8688..cdb98f01f 100644 --- a/core/static_java_library.mk +++ b/core/static_java_library.mk @@ -59,6 +59,8 @@ LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_ endif # all_resources endif # LOCAL_RESOURCE_DIR +all_res_assets := $(all_resources) + include $(BUILD_SYSTEM)/java_library.mk ifneq (,$(all_resources))