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 # be recompiled. If multiple paths are separated by comma, convert that into a
# space separated list. # space separated list.
JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER))) 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. # Get the complete module source path.
MODULESOURCEPATH := $(call GetModuleSrcPath) MODULESOURCEPATH := $(call GetModuleSrcPath)
@ -496,7 +503,8 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \ SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
MODULE := $(MODULE), \ MODULE := $(MODULE), \
SRC := $(wildcard $(MODULE_SRC_DIRS)), \ 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), \ BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \ HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
ADD_JAVAC_FLAGS := \ ADD_JAVAC_FLAGS := \

View File

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