# HG changeset patch # User iris # Date 1436208581 25200 # Node ID f4037e2039638218736210e548284d7ddd191a4d # Parent f241b3e1b45e71efd461ad3b1df66d5c90a2eceb# Parent 1d81c9e6c1cdd4de3de30bb05cebf944c81a07e9 Merge diff -r f241b3e1b45e -r f4037e203963 nashorn/make/BuildNashorn.gmk --- a/nashorn/make/BuildNashorn.gmk Thu Jul 02 08:54:05 2015 -0700 +++ b/nashorn/make/BuildNashorn.gmk Mon Jul 06 11:49:41 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -30,19 +30,12 @@ include MakeBase.gmk include JavaCompilation.gmk include SetupJavaCompilers.gmk +include TextFileProcessing.gmk JDK_CLASSES := $(subst $(SPACE),$(PATH_SEP),$(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \ java.base java.logging java.scripting))) NASHORN_JAR := $(IMAGES_OUTPUTDIR)/nashorn.jar -NASHORN_VERSION := $(JDK_VERSION) -NASHORN_FULL_VERSION := $(FULL_VERSION) - -ifdef MILESTONE - ifeq ($(MILESTONE), internal) - NASHORN_VERSION = $(FULL_VERSION) - endif -endif # Need to use source and target 8 for nasgen to work. $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \ @@ -88,25 +81,23 @@ $(TOUCH) $@ # Version file needs to be processed with version numbers -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 +$(eval $(call SetupTextFileProcessing, BUILD_VERSION_FILE, \ + SOURCE_FILES := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties.template, \ + OUTPUT_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties, \ + REPLACEMENTS := \ + @@VERSION_STRING@@ => $(VERSION_STRING) ; \ + @@VERSION_SHORT@@ => $(VERSION_SHORT) , \ +)) -# Needs to happen after nasgen run since nasgen run deletes it -$(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' \ - -e 's/$$(RELEASE)/$(NASHORN_VERSION)/g' \ - -e '/^#.*$$/d' -e '/^$$/d' > $@ +# Version processing needs to happen after nasgen run since nasgen run deletes it +$(BUILD_VERSION_FILE): $(NASGEN_RUN_FILE) -MANIFEST_ATTRIBUTES := Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\nImplementation-Version: $(NASHORN_FULL_VERSION) +MANIFEST_ATTRIBUTES := Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\nImplementation-Version: $(VERSION_SHORT) # Create nashorn.jar from the final classes dir $(eval $(call SetupArchive,BUILD_NASHORN_JAR, \ - DEPENDENCIES := $(NASGEN_RUN_FILE) \ - $(VERSION_FILE), \ + DEPENDENCIES := $(NASGEN_RUN_FILE) $(BUILD_VERSION_FILE), \ SRCS := $(NASHORN_CLASSES_DIR), \ SUFFIXES := .class .js .properties Factory, \ MANIFEST := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/META-INF/MANIFEST.MF, \ @@ -114,7 +105,7 @@ SKIP_METAINF := true, \ JAR := $(NASHORN_JAR))) -compile: $(NASHORN_RUN_FILE) $(VERSION_FILE) +compile: $(NASHORN_RUN_FILE) $(BUILD_VERSION_FILE) all: $(NASHORN_JAR) .PHONY: compile all diff -r f241b3e1b45e -r f4037e203963 nashorn/make/build.xml --- a/nashorn/make/build.xml Thu Jul 02 08:54:05 2015 -0700 +++ b/nashorn/make/build.xml Mon Jul 06 11:49:41 2015 -0700 @@ -156,9 +156,9 @@ - + ${line.separator} - + diff -r f241b3e1b45e -r f4037e203963 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Version.java --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Version.java Thu Jul 02 08:54:05 2015 -0700 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Version.java Mon Jul 06 11:49:41 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ * @return version string */ public static String version() { - return version("release"); // mm.nn.oo[-milestone] + return version("version_short"); // E.g. "9-internal" or "9.1.2" } /** @@ -49,7 +49,7 @@ * @return full version string */ public static String fullVersion() { - return version("full"); // mm.mm.oo[-milestone]-build + return version("version_string"); // E.g. "9.1.2.3-ea-4+nashorn-testing" } private static final String VERSION_RB_NAME = "jdk.nashorn.internal.runtime.resources.version"; diff -r f241b3e1b45e -r f4037e203963 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties-template --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties-template Thu Jul 02 08:54:05 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -full=$(FULL_VERSION) -release=$(RELEASE) diff -r f241b3e1b45e -r f4037e203963 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties.template Mon Jul 06 11:49:41 2015 -0700 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +version_short=@@VERSION_SHORT@@ +version_string=@@VERSION_STRING@@