8054834: Modular Source Code
Co-authored-by: Alan Bateman <alan.bateman@oracle.com> Co-authored-by: Alex Buckley <alex.buckley@oracle.com> Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com> Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com> Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com> Co-authored-by: Magnus Ihse Bursie <magnus.ihse.bursie@oracle.com> Co-authored-by: Mandy Chung <mandy.chung@oracle.com> Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com> Co-authored-by: Paul Sandoz <paul.sandoz@oracle.com> Reviewed-by: alanb, chegar, ihse, mduigou
This commit is contained in:
parent
d4142068b2
commit
5fe51a5b71
@ -30,7 +30,8 @@ default: all
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
JDK_CLASSES := $(JDK_OUTPUTDIR)/classes
|
||||
JDK_CLASSES := $(subst $(SPACE),$(PATH_SEP),$(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \
|
||||
java.base java.logging java.scripting)))
|
||||
|
||||
NASHORN_JAR := $(NASHORN_DIST)/nashorn.jar
|
||||
NASHORN_VERSION := $(JDK_VERSION)
|
||||
@ -46,19 +47,19 @@ endif
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
|
||||
JVM := $(JAVA), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := -g -source 7 -target 7 -bootclasspath $(JDK_CLASSES), \
|
||||
FLAGS := -g -source 7 -target 7 -bootclasspath "$(JDK_CLASSES)", \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
# Build nashorn into intermediate directory
|
||||
$(eval $(call SetupJavaCompilation,BUILD_NASHORN, \
|
||||
SETUP := GENERATE_NEWBYTECODE_DEBUG, \
|
||||
SRC := $(NASHORN_TOPDIR)/src, \
|
||||
SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes, \
|
||||
COPY := .properties .js, \
|
||||
BIN := $(NASHORN_OUTPUTDIR)/nashorn_classes))
|
||||
|
||||
NASGEN_SRC := $(NASHORN_TOPDIR)/buildtools/nasgen/src
|
||||
ASM_SRC := $(JDK_TOPDIR)/src/share/classes/jdk/internal/org/objectweb/asm
|
||||
ASM_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/org/objectweb/asm
|
||||
|
||||
# Build nasgen
|
||||
$(eval $(call SetupJavaCompilation,BUILD_NASGEN, \
|
||||
@ -70,8 +71,11 @@ $(eval $(call SetupJavaCompilation,BUILD_NASGEN, \
|
||||
# Nasgen needs nashorn classes
|
||||
$(BUILD_NASGEN): $(BUILD_NASHORN)
|
||||
|
||||
NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
|
||||
NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
|
||||
|
||||
# Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
|
||||
$(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run: $(BUILD_NASGEN)
|
||||
$(NASGEN_RUN_FILE): $(BUILD_NASGEN)
|
||||
$(ECHO) Running nasgen
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -rf $(@D)/jdk $(@D)/netscape
|
||||
@ -82,11 +86,12 @@ $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run: $(BUILD_NASGEN)
|
||||
$(TOUCH) $@
|
||||
|
||||
# Version file needs to be processed with version numbers
|
||||
VERSION_FILE := $(NASHORN_OUTPUTDIR)/classes/jdk/nashorn/internal/runtime/resources/version.properties
|
||||
VERSION_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties
|
||||
VERSION_SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties-template
|
||||
|
||||
# Needs to happen after nasgen run since nasgen run deletes it
|
||||
$(VERSION_FILE): $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run
|
||||
$(VERSION_FILE): $(NASHORN_TOPDIR)/src/jdk/nashorn/internal/runtime/resources/version.properties-template
|
||||
$(VERSION_FILE): $(NASGEN_RUN_FILE)
|
||||
$(VERSION_FILE): $(VERSION_SRC)
|
||||
$(ECHO) Creating version.properties
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CAT) $< | $(SED) -e 's/$$(FULL_VERSION)/$(NASHORN_FULL_VERSION)/g' \
|
||||
@ -98,15 +103,16 @@ MANIFEST_ATTRIBUTES := Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\
|
||||
|
||||
# Create nashorn.jar from the final classes dir
|
||||
$(eval $(call SetupArchive,BUILD_NASHORN_JAR, \
|
||||
$(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run \
|
||||
$(NASGEN_RUN_FILE) \
|
||||
$(VERSION_FILE), \
|
||||
SRCS := $(NASHORN_OUTPUTDIR)/classes, \
|
||||
SRCS := $(NASHORN_CLASSES_DIR), \
|
||||
SUFFIXES := .class .js .properties Factory, \
|
||||
MANIFEST := $(NASHORN_TOPDIR)/src/META-INF/MANIFEST.MF, \
|
||||
MANIFEST := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/META-INF/MANIFEST.MF, \
|
||||
EXTRA_MANIFEST_ATTR := $(MANIFEST_ATTRIBUTES), \
|
||||
SKIP_METAINF := true, \
|
||||
JAR := $(NASHORN_JAR)))
|
||||
|
||||
compile: $(NASHORN_RUN_FILE) $(VERSION_FILE)
|
||||
all: $(NASHORN_JAR)
|
||||
|
||||
.PHONY: all
|
||||
.PHONY: compile all
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user