Make it a fatal error if no source files for Java module.

Change-Id: Ia04158c11381b6b1687b9d5c699a9ea8ae3cb317
This commit is contained in:
Ying Wang 2013-08-28 11:16:06 -07:00
parent 5711d73ed0
commit 576e0146a9
5 changed files with 9 additions and 5 deletions

View File

@ -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), \

View File

@ -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))

View File

@ -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))

View File

@ -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

View File

@ -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))