8169069: Module system implementation refresh (11/2016)
Co-authored-by: Mandy Chung <mandy.chung@oracle.com> Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com> Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com> Reviewed-by: alanb, mchung
This commit is contained in:
parent
e76a548743
commit
18af38e927
@ -5093,7 +5093,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
|||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1479120453
|
DATE_WHEN_GENERATED=1479992729
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -31196,6 +31196,12 @@ $as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\"
|
|||||||
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
|
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
|
||||||
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
|
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
|
||||||
fi
|
fi
|
||||||
|
# Workaround for using different imported module-info.java in Jake due to a
|
||||||
|
# change in format. Remove once new format is standard in JDK 9 and javafx
|
||||||
|
# delivers just that.
|
||||||
|
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
|
||||||
|
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
|
||||||
|
fi
|
||||||
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
|
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
|
||||||
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
|
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
|
||||||
fi
|
fi
|
||||||
|
@ -126,6 +126,12 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_IMPORT_MODULES],
|
|||||||
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
|
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
|
||||||
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
|
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
|
||||||
fi
|
fi
|
||||||
|
# Workaround for using different imported module-info.java in Jake due to a
|
||||||
|
# change in format. Remove once new format is standard in JDK 9 and javafx
|
||||||
|
# delivers just that.
|
||||||
|
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
|
||||||
|
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
|
||||||
|
fi
|
||||||
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
|
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
|
||||||
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
|
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
|
||||||
fi
|
fi
|
||||||
|
@ -427,7 +427,7 @@ var getJibProfilesDependencies = function (input, common) {
|
|||||||
jtreg: {
|
jtreg: {
|
||||||
server: "javare",
|
server: "javare",
|
||||||
revision: "4.2",
|
revision: "4.2",
|
||||||
build_number: "b03",
|
build_number: "b04",
|
||||||
checksum_file: "MD5_VALUES",
|
checksum_file: "MD5_VALUES",
|
||||||
file: "jtreg_bin-4.2.zip",
|
file: "jtreg_bin-4.2.zip",
|
||||||
environment_name: "JT_HOME",
|
environment_name: "JT_HOME",
|
||||||
|
@ -60,8 +60,8 @@ TOOL_GENMODULEINFOSOURCE = $(JAVA_SMALL) \
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Name of data file. Keep module-info.java.ext until javafx has changed.
|
# Name of modification file.
|
||||||
MOD_FILENAME := module-info.java.extra module-info.java.ext
|
MOD_FILENAME := module-info.java.extra
|
||||||
|
|
||||||
# Construct all possible src directories for the module.
|
# Construct all possible src directories for the module.
|
||||||
MODULE_CLASSES_DIRS := $(call FindModuleSrcDirs, $(MODULE))
|
MODULE_CLASSES_DIRS := $(call FindModuleSrcDirs, $(MODULE))
|
||||||
@ -74,74 +74,24 @@ ifneq ($(MOD_FILES), )
|
|||||||
# Only make this call if modification files are found for this module
|
# Only make this call if modification files are found for this module
|
||||||
ALL_MODULES := $(call FindAllModules)
|
ALL_MODULES := $(call FindAllModules)
|
||||||
|
|
||||||
# Read the contents of all the files into a variable. Replace space with / to
|
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java: \
|
||||||
# let space represent new lines in the variable as $(shell) normalizes all
|
$(firstword $(call FindAllModuleInfos, $(MODULE))) \
|
||||||
# whitespace.
|
$(BUILD_TOOLS_JDK) \
|
||||||
$(foreach f, $(MOD_FILES), \
|
$(MOD_FILES) \
|
||||||
$(eval MOD_FILE_CONTENTS += $(shell $(GREP) -v -e ".\*" -e "//" $f | $(TR) ' ' '/')))
|
$(call DependOnVariable, ALL_MODULES)
|
||||||
|
|
||||||
# Separate the modifications into qualified exports and the rest
|
|
||||||
MODS_QUALIFIED_EXPORTS := $(call containing, /to/, $(MOD_FILE_CONTENTS))
|
|
||||||
MODS_REST := $(filter-out $(MODS_QUALIFIED_EXPORTS), $(MOD_FILE_CONTENTS))
|
|
||||||
|
|
||||||
# Filter the contents for modules that are actually being built
|
|
||||||
ALL_MODULES_FILTER := $(addprefix %/, $(addsuffix ;, $(ALL_MODULES)))
|
|
||||||
MODIFICATIONS := $(filter $(ALL_MODULES_FILTER), $(MODS_QUALIFIED_EXPORTS)) \
|
|
||||||
$(MODS_REST)
|
|
||||||
|
|
||||||
# Returns non empty if the package exists in the current module
|
|
||||||
# Param 1 - Name of package with dots
|
|
||||||
PackageExists = \
|
|
||||||
$(strip $(wildcard $(addsuffix $(subst .,/,/$(strip $1)), \
|
|
||||||
$(MODULE_CLASSES_DIRS) \
|
|
||||||
$(addsuffix /$(MODULE), $(IMPORT_MODULES_CLASSES)) \
|
|
||||||
$(JDK_OUTPUTDIR)/modules/$(MODULE) \
|
|
||||||
)))
|
|
||||||
|
|
||||||
# Convert the modification lines into arguments for the modification tool.
|
|
||||||
# Filter out modifications for non existing to-modules.
|
|
||||||
$(foreach line, $(MODIFICATIONS), \
|
|
||||||
$(eval split_line := $(subst /,$(SPACE),$(line))) \
|
|
||||||
$(eval command := $(word 1, $(split_line))) \
|
|
||||||
$(if $(filter $(command), exports), \
|
|
||||||
$(eval package := $(patsubst %;,%,$(word 2, $(split_line)))) \
|
|
||||||
$(if $(call PackageExists, $(package)), \
|
|
||||||
$(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
|
|
||||||
$(if $(to_module), \
|
|
||||||
$(eval ARGS += -$(command) $(package)/$(to_module)) \
|
|
||||||
, \
|
|
||||||
$(eval ARGS += -$(command) $(package)) \
|
|
||||||
) \
|
|
||||||
) \
|
|
||||||
, \
|
|
||||||
$(if $(filter $(command), provides), \
|
|
||||||
$(eval provider := $(patsubst %;,%,$(word 2, $(split_line)))) \
|
|
||||||
$(eval class := $(patsubst %;,%,$(word 4, $(split_line)))) \
|
|
||||||
$(eval ARGS += -$(command) $(provider)/$(class)) \
|
|
||||||
, \
|
|
||||||
$(error A module-info.extra in $(MODULE) contains invalid command $(command)) \
|
|
||||||
) \
|
|
||||||
) \
|
|
||||||
)
|
|
||||||
|
|
||||||
ifneq ($(ARGS), )
|
|
||||||
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java: \
|
|
||||||
$(firstword $(call FindAllModuleInfos, $(MODULE))) \
|
|
||||||
$(BUILD_TOOLS_JDK) \
|
|
||||||
$(call DependOnVariable, ARGS)
|
|
||||||
$(MKDIR) -p $(@D)
|
$(MKDIR) -p $(@D)
|
||||||
$(RM) $@ $@.tmp
|
$(RM) $@ $@.tmp
|
||||||
$(TOOL_GENMODULEINFOSOURCE) $(ARGS) -o $@.tmp $<
|
$(TOOL_GENMODULEINFOSOURCE) -o $@.tmp \
|
||||||
|
--source-file $< \
|
||||||
|
--modules $(call CommaList, $(ALL_MODULES)) \
|
||||||
|
$(MOD_FILES)
|
||||||
$(MV) $@.tmp $@
|
$(MV) $@.tmp $@
|
||||||
|
|
||||||
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
|
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
else
|
||||||
|
# If no modifications are found for this module, remove any module-info.java
|
||||||
# If no modifications are found for this module, remove any module-info.java
|
# created by a previous build since that is no longer valid.
|
||||||
# created by a previous build since that is no longer valid.
|
|
||||||
ifeq ($(MODIFICATIONS), )
|
|
||||||
ifneq ($(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java), )
|
ifneq ($(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java), )
|
||||||
$(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java)
|
$(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java)
|
||||||
endif
|
endif
|
||||||
|
@ -33,7 +33,7 @@ include MakeBase.gmk
|
|||||||
# Allow custom to overwrite.
|
# Allow custom to overwrite.
|
||||||
JAVADOC_SOURCE_DIRS = \
|
JAVADOC_SOURCE_DIRS = \
|
||||||
$(SUPPORT_OUTPUTDIR)/gensrc/* \
|
$(SUPPORT_OUTPUTDIR)/gensrc/* \
|
||||||
$(if $(IMPORT_MODULES_SRC), $(IMPORT_MODULES_SRC)/*) \
|
$(addsuffix /*, $(IMPORT_MODULES_SRC)) \
|
||||||
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
|
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
|
||||||
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
|
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
|
||||||
$(JDK_TOPDIR)/src/*/share/classes \
|
$(JDK_TOPDIR)/src/*/share/classes \
|
||||||
|
@ -171,12 +171,15 @@ SRC_SUBDIRS += share/classes
|
|||||||
|
|
||||||
# Find all module-info.java files for the current build target platform and
|
# Find all module-info.java files for the current build target platform and
|
||||||
# configuration.
|
# configuration.
|
||||||
|
# TODO: The $(firstword call is part of a workaround for using different
|
||||||
|
# imported module-info.java in Jake due to a change in format. Remove once
|
||||||
|
# new format is standard in JDK 9 and javafx delivers just that.
|
||||||
# Param 1 - Module to find for, set to * for finding all
|
# Param 1 - Module to find for, set to * for finding all
|
||||||
FindAllModuleInfos = \
|
FindAllModuleInfos = \
|
||||||
$(wildcard \
|
$(wildcard \
|
||||||
$(foreach sub, $(SRC_SUBDIRS), \
|
$(foreach sub, $(SRC_SUBDIRS), \
|
||||||
$(patsubst %,%/$(strip $1)/$(sub)/module-info.java, $(TOP_SRC_DIRS))) \
|
$(patsubst %,%/$(strip $1)/$(sub)/module-info.java, $(TOP_SRC_DIRS))) \
|
||||||
$(patsubst %,%/$(strip $1)/module-info.java, $(IMPORT_MODULES_SRC)))
|
$(patsubst %,%/$(strip $1)/module-info.java, $(firstword $(IMPORT_MODULES_SRC))))
|
||||||
|
|
||||||
# Find module-info.java files in the specific source dir
|
# Find module-info.java files in the specific source dir
|
||||||
# Param 1 - Src dir to find module-info.java files in
|
# Param 1 - Src dir to find module-info.java files in
|
||||||
@ -244,7 +247,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
|||||||
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
|
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
|
||||||
/requires/ { sub(/;/, ""); \
|
/requires/ { sub(/;/, ""); \
|
||||||
sub(/requires/, ""); \
|
sub(/requires/, ""); \
|
||||||
sub(/public/, ""); \
|
sub(/transitive/, ""); \
|
||||||
sub(/\/\/.*/, ""); \
|
sub(/\/\/.*/, ""); \
|
||||||
sub(/\/\*.*\*\//, ""); \
|
sub(/\/\*.*\*\//, ""); \
|
||||||
gsub(/^ +\*.*/, ""); \
|
gsub(/^ +\*.*/, ""); \
|
||||||
|
@ -453,8 +453,6 @@ public class WhiteBox {
|
|||||||
Object[] packages);
|
Object[] packages);
|
||||||
public native void AddModuleExports(Object from_module, String pkg, Object to_module);
|
public native void AddModuleExports(Object from_module, String pkg, Object to_module);
|
||||||
public native void AddReadsModule(Object from_module, Object source_module);
|
public native void AddReadsModule(Object from_module, Object source_module);
|
||||||
public native boolean CanReadModule(Object asking_module, Object source_module);
|
|
||||||
public native boolean IsExportedToModule(Object from_module, String pkg, Object to_module);
|
|
||||||
public native void AddModulePackage(Object module, String pkg);
|
public native void AddModulePackage(Object module, String pkg);
|
||||||
public native void AddModuleExportsToAllUnnamed(Object module, String pkg);
|
public native void AddModuleExportsToAllUnnamed(Object module, String pkg);
|
||||||
public native void AddModuleExportsToAll(Object module, String pkg);
|
public native void AddModuleExportsToAll(Object module, String pkg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user