changeset 47228:eda0a1f0e83e

8187773: nashorn ant javadoc, nashornapi, dynalinkapi, run, debug, octane, sunspider targets fail Reviewed-by: hannesw
author sundar
date Thu, 21 Sep 2017 14:37:47 +0530
parents 8052fa06e1b7
children 7d4896d180e7
files doc/nashorn/genshelldoc.js make/nashorn/build.xml make/nashorn/project.properties
diffstat 3 files changed, 24 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/doc/nashorn/genshelldoc.js	Thu Sep 21 16:29:54 2017 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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.
- *
- * 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.
- */
-
-/**
- * Generate HTML documentation for shell tool. Re-run this tool to regenerate
- * html doc when you change options.
- *
- * Usage:
- *
- *     jjs -scripting genshelldoc.js > shell.html
- */
-
-var Options = Packages.jdk.nashorn.internal.runtime.options.Options;
-var title = "Nashorn command line shell tool";
-
-print(<<PREFIX
-<html>
-<head>
-<title>
-${title}
-</title>
-</head>
-<body>
-<h1>Usage</h1>
-<p>
-<code>
-<b>jjs &lt;options&gt; &lt;script-files&gt; [ -- &lt;script-arguments&gt; ]</b>
-</code>
-</p>
-
-<h1>${title} options</h1>
-
-<table border="0">
-<tr>
-<th>name</th>
-<th>type</th>
-<th>default</th>
-<th>description</th>
-</tr>
-PREFIX);
-
-for each (opt in Options.validOptions) {
-
-var isTimezone = (opt.type == "timezone");
-var defValue = opt.defaultValue;
-if (defValue == null) {
-    defValue = "&lt;none&gt;";
-}
-
-if (isTimezone) {
-    // don't output current user's timezone
-    defValue = "&lt;default-timezone&gt;"
-}
-
-print(<<ROW
-  <tr>
-  <td><b>${opt.name} ${opt.shortName == null? "" : opt.shortName}</b></td>
-  <td>${opt.type}</td>
-  <td>${defValue}</td>
-  <td>${opt.description}</td>
-  </tr>
-ROW);
-
-}
-
-print(<<SUFFIX
-</table>
-</body>
-</html>
-SUFFIX);
--- a/make/nashorn/build.xml	Thu Sep 21 16:29:54 2017 +0800
+++ b/make/nashorn/build.xml	Thu Sep 21 14:37:47 2017 +0530
@@ -271,17 +271,16 @@
   <target name="javadoc" depends="jar">
     <javadoc destdir="${dist.javadoc.dir}" use="yes"
         windowtitle="${nashorn.product.name} ${nashorn.version}"
-        additionalparam="-quiet" failonerror="true" useexternalfile="true">
+        additionalparam="-quiet" failonerror="true" useexternalfile="true"> 
+      <arg value="--patch-module"/>
+      <arg value="jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}"/>
+      <arg value="--patch-module"/>
+      <arg value="jdk.dynalink=${basedir}/${dynalink.module.src.dir}"/>
       <arg value="--module-source-path"/>
-      <arg value="${nashorn.module.src.dir}"/>
-      <arg value="--module-source-path"/>
-      <arg value="${dynalink.module.src.dir}"/>
+      <arg value="."/>
       <arg value="${javadoc.option}"/>
-      <classpath>
-        <pathelement location="${build.classes.dir}"/>
-      </classpath>
+      <fileset dir="${nashorn.module.src.dir}" includes="**/*.java"/>
       <fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
-      <fileset dir="${nashorn.module.src.dir}" includes="**/*.java"/>
       <link href="http://docs.oracle.com/javase/8/docs/api/"/>
     </javadoc>
   </target>
@@ -290,14 +289,15 @@
   <target name="nashornapi" depends="jar">
     <mkdir dir="${dist.nashornapi.javadoc.dir}"/>
     <javadoc destdir="${dist.nashornapi.javadoc.dir}" use="yes"
-        extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
+        windowtitle="${nashorn.product.name} ${nashorn.version}"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
+      <arg value="--patch-module"/>
+      <arg value="jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}"/>
+      <arg value="--patch-module"/>
+      <arg value="jdk.dynalink=${basedir}/${dynalink.module.src.dir}"/>
       <arg value="--module-source-path"/>
-      <arg value="${nashorn.module.src.dir}"/>
+      <arg value="."/>
       <arg value="${javadoc.option}"/>
-      <classpath>
-        <pathelement location="${build.classes.dir}"/>
-      </classpath>
       <fileset dir="${nashorn.module.src.dir}" includes="jdk/nashorn/api/**/*.java"/>
       <link href="http://docs.oracle.com/javase/8/docs/api/"/>
     </javadoc>
@@ -309,30 +309,22 @@
     <javadoc destdir="${dist.dynalinkapi.javadoc.dir}" use="yes"
         windowtitle="Dynalink"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
+      <arg value="--patch-module"/>
+      <arg value="jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}"/>
+      <arg value="--patch-module"/>
+      <arg value="jdk.dynalink=${basedir}/${dynalink.module.src.dir}"/>
       <arg value="--module-source-path"/>
-      <arg value="${dynalink.module.src.dir}"/>
+      <arg value="."/>
       <arg value="${javadoc.option}"/>
-      <classpath>
-        <pathelement location="${build.classes.dir}"/>
-      </classpath>
-      <fileset dir="${dynalink.module.src.dir}" includes="**/*.java" excludes="jdk/dynalink/internal/*.java"/>
+      <fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
       <link href="http://docs.oracle.com/javase/8/docs/api/"/>
     </javadoc>
   </target>
 
   <target name="javadocapi" depends="nashornapi, dynalinkapi"/>
 
-  <!-- generate shell.html for shell tool documentation -->
-  <target name="shelldoc" depends="jar">
-    <java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
-      <jvmarg line="${nashorn.override.option}"/>
-      <arg value="-scripting"/>
-      <arg value="docs/genshelldoc.js"/>
-    </java>
-  </target>
-
   <!-- generate all docs -->
-  <target name="docs" depends="javadoc, shelldoc"/>
+  <target name="docs" depends="javadoc"/>
 
   <!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
   <target name="dist" depends="jar">
@@ -614,7 +606,7 @@
     </testng>
   </target>
 
-  <target name="test" depends="prepare, test-pessimistic, test-optimistic"/>
+  <target name="test" depends="prepare, javadoc, test-pessimistic, test-optimistic"/>
 
   <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
     <echo message="Running test suite in OPTIMISTIC mode..."/>
@@ -752,7 +744,7 @@
 
   <target name="run" depends="jar"
       description="Run the shell with a sample script">
-    <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
+    <java classname="${nashorn.shell.tool}" fork="true" dir="${basedir}/src/sample/nashorn">
         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
         <arg value="-dump-on-error"/>
         <arg value="test.js"/>
@@ -761,7 +753,7 @@
 
   <target name="debug" depends="jar"
       description="Debug the shell with a sample script">
-    <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
+    <java classname="${nashorn.shell.tool}" fork="true" dir="${basedir}/src/sample/nashorn">
         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
         <arg value="--print-code"/>
         <arg value="--verify-code"/>
--- a/make/nashorn/project.properties	Thu Sep 21 16:29:54 2017 +0800
+++ b/make/nashorn/project.properties	Thu Sep 21 14:37:47 2017 +0530
@@ -60,7 +60,7 @@
  --patch-module jdk.dynalink=${build.classes.dir}/jdk.dynalink
 
 # project directory of <nashorn> ant task
-nashorntask.dir=buildtools/nashorntask
+nashorntask.dir=${nashorn.make.dir}/buildtools/nashorntask
 
 # nashorn Shell tool
 nashorn.shell.tool=jdk.nashorn.tools.Shell