8055735: JDK_FILTER is broken

Reviewed-by: redestad, alanb, tbell
This commit is contained in:
Erik Joelsson 2016-06-10 16:56:29 +02:00
parent 4c4d28cabc
commit 0295c28e94
2 changed files with 203 additions and 190 deletions

View File

@ -477,6 +477,13 @@ MODULE_SRC_DIRS := $(call FindModuleSrcDirs, $(MODULE))
# be recompiled. If multiple paths are separated by comma, convert that into a
# space separated list.
JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
ifeq ($(JDK_FILTER), )
FAIL_NO_SRC := true
else
# When using JDK_FILTER, most module java compilations will end up finding
# no source files. Don't let that fail the build.
FAIL_NO_SRC := false
endif
# Get the complete module source path.
MODULESOURCEPATH := $(call GetModuleSrcPath)
@ -496,7 +503,8 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
MODULE := $(MODULE), \
SRC := $(wildcard $(MODULE_SRC_DIRS)), \
INCLUDES := $(JDK_USER_DEFINED_FILTER),\
INCLUDES := $(JDK_USER_DEFINED_FILTER), \
FAIL_NO_SRC := $(FAIL_NO_SRC), \
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
ADD_JAVAC_FLAGS := \

View File

@ -170,6 +170,8 @@ endef
# DEPENDS:=Extra dependecy
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
# KEEP_DUPS:=Do not remove duplicate file names from different source roots.
# FAIL_NO_SRC:=Set to false to not fail the build if no source files are found,
# default is true.
SetupJavaCompilation = $(NamedParamsMacroTemplate)
define SetupJavaCompilationBody
@ -246,8 +248,10 @@ define SetupJavaCompilationBody
endif
ifeq ($$(strip $$($1_SRCS)), )
ifneq ($$($1_FAIL_NO_SRC), false)
$$(error No source files found for $1)
endif
else
$1_SAFE_NAME := $$(strip $$(subst /,_, $1))
@ -471,6 +475,7 @@ define SetupJavaCompilationBody
# Add zip to target list
$1 += $$($1_SRCZIP)
endif
endif # Source files found
endef
# Use this macro to find the correct target to depend on when the original