# HG changeset patch
# User iris
# Date 1448857801 28800
# Node ID a769d473f680f2e84af003b3cb1030a0e08d5333
# Parent b4a0a6c5333f140a27fc280e0375f655f7e9f249# Parent d0118c2a21c4ad1fc8edabb2c94027afccebf2ca
Merge
diff -r b4a0a6c5333f -r a769d473f680 nashorn/make/BuildNashorn.gmk
--- a/nashorn/make/BuildNashorn.gmk Sun Nov 29 11:00:11 2015 -0800
+++ b/nashorn/make/BuildNashorn.gmk Sun Nov 29 20:30:01 2015 -0800
@@ -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
@@ -31,19 +31,12 @@
include JarArchive.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
+include TextFileProcessing.gmk
JDK_CLASSES := $(call PathList, $(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, \
@@ -93,25 +86,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 SetupJarArchive, BUILD_NASHORN_JAR, \
- DEPENDENCIES := $(NASGEN_RUN_FILE) \
- $(VERSION_FILE), \
+$(eval $(call SetupJarArchive,BUILD_NASHORN_JAR, \
+ 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, \
@@ -120,7 +111,7 @@
JAR := $(NASHORN_JAR), \
))
-compile: $(NASHORN_RUN_FILE) $(VERSION_FILE)
+compile: $(NASHORN_RUN_FILE) $(BUILD_VERSION_FILE)
all: $(NASHORN_JAR)
.PHONY: compile all
diff -r b4a0a6c5333f -r a769d473f680 nashorn/make/build.xml
--- a/nashorn/make/build.xml Sun Nov 29 11:00:11 2015 -0800
+++ b/nashorn/make/build.xml Sun Nov 29 20:30:01 2015 -0800
@@ -158,9 +158,9 @@
-
+
${line.separator}
-
+
diff -r b4a0a6c5333f -r a769d473f680 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 Sun Nov 29 11:00:11 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Version.java Sun Nov 29 20:30:01 2015 -0800
@@ -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 b4a0a6c5333f -r a769d473f680 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 Sun Nov 29 11:00:11 2015 -0800
+++ /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 b4a0a6c5333f -r a769d473f680 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 Sun Nov 29 20:30:01 2015 -0800
@@ -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@@