# HG changeset patch # User iris # Date 1440539132 25200 # Node ID d1868a6ad5f8cb4b23074bfa883b2ac89484cdae # Parent 3966bd3b8167419aa05c6718a4af1cf54b1e3c58# Parent 5f5be07214a7cb839eba7d55d1b09f970b621212 Merge diff -r 3966bd3b8167 -r d1868a6ad5f8 nashorn/make/BuildNashorn.gmk --- a/nashorn/make/BuildNashorn.gmk Wed Jul 05 20:46:39 2017 +0200 +++ b/nashorn/make/BuildNashorn.gmk Tue Aug 25 14:45:32 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, \ @@ -91,25 +84,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, \ @@ -117,7 +108,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 3966bd3b8167 -r d1868a6ad5f8 nashorn/make/build.xml --- a/nashorn/make/build.xml Wed Jul 05 20:46:39 2017 +0200 +++ b/nashorn/make/build.xml Tue Aug 25 14:45:32 2015 -0700 @@ -158,9 +158,9 @@ - + ${line.separator} - + diff -r 3966bd3b8167 -r d1868a6ad5f8 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 Wed Jul 05 20:46:39 2017 +0200 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Version.java Tue Aug 25 14:45:32 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 3966bd3b8167 -r d1868a6ad5f8 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 Wed Jul 05 20:46:39 2017 +0200 +++ /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 3966bd3b8167 -r d1868a6ad5f8 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 Tue Aug 25 14:45:32 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@@