changeset 1709:7fb2bf00347b

8158250: nashorn ant javadoc targets are broken Reviewed-by: hannesw, mhaupt
author sundar
date Tue, 31 May 2016 21:12:34 +0530
parents 39dececd7338
children 782aca1c11f6
files make/build.xml make/project.properties src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Module.java src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java
diffstat 4 files changed, 24 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/make/build.xml	Tue May 31 13:04:26 2016 +0530
+++ b/make/build.xml	Tue May 31 21:12:34 2016 +0530
@@ -258,31 +258,13 @@
     <property name="compile.suppress.jar" value="defined"/>
   </target>
 
-  <!-- generate javadoc for all Nashorn and ASM classes -->
+  <!-- generate javadoc for Nashorn classes -->
   <target name="javadoc" depends="jar">
     <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${nashorn.module.src.dir}/overview.html"
         windowtitle="${nashorn.product.name} ${nashorn.version}"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
-      <arg value="${javadoc.option}"/>
-      <classpath>
-        <pathelement location="${build.classes.dir}"/>
-      </classpath>
-      <fileset dir="${nashorn.module.src.dir}" includes="**/*.java"/>
-      <fileset dir="${nashorn.shell.module.src.dir}" includes="**/*.java"/>
-      <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
-      <link href="http://docs.oracle.com/javase/8/docs/api/"/>
-      <!-- The following tags are used only in ASM sources - just ignore these -->
-      <tag name="label" description="label tag in ASM sources" enabled="false"/>
-      <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
-      <tag name="associates" description="associates tag in ASM sources" enabled="false"/>
-    </javadoc>
-  </target>
-
-  <!-- generate javadoc for Nashorn classes -->
-  <target name="javadocnh" depends="jar">
-    <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${nashorn.module.src.dir}/overview.html"
-        windowtitle="${nashorn.product.name} ${nashorn.version}"
-        additionalparam="-quiet" failonerror="true" useexternalfile="true">
+      <arg value="-modulesourcepath"/>
+      <arg value="${basedir}/src/*/share/classes"/>
       <arg value="${javadoc.option}"/>
       <classpath>
         <pathelement location="${build.classes.dir}"/>
@@ -295,10 +277,13 @@
   </target>
 
   <!-- generate javadoc only for nashorn extension api classes -->
-  <target name="javadocapi" depends="jar">
-    <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${nashorn.module.src.dir}/overview.html"
+  <target name="nashornapi" depends="jar">
+    <mkdir dir="${dist.nashornapi.javadoc.dir}"/>
+    <javadoc destdir="${dist.nashornapi.javadoc.dir}" use="yes" overview="${nashorn.module.src.dir}/overview.html"
         extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
+      <arg value="-modulesourcepath"/>
+      <arg value="${basedir}/src/*/share/classes"/>
       <arg value="${javadoc.option}"/>
       <classpath>
         <pathelement location="${build.classes.dir}"/>
@@ -310,9 +295,12 @@
 
   <!-- generate javadoc only for Dynalink API classes -->
   <target name="dynalinkapi" depends="jar">
-    <javadoc destdir="${dist.javadoc.dir}" use="yes"
+    <mkdir dir="${dist.dynalinkapi.javadoc.dir}"/>
+    <javadoc destdir="${dist.dynalinkapi.javadoc.dir}" use="yes"
         windowtitle="Dynalink"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
+      <arg value="-modulesourcepath"/>
+      <arg value="${basedir}/src/*/share/classes"/>
       <arg value="${javadoc.option}"/>
       <classpath>
         <pathelement location="${build.classes.dir}"/>
@@ -322,6 +310,8 @@
     </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">
@@ -595,7 +585,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-policy-file" if="testng.available">
     <echo message="Running test suite in OPTIMISTIC mode..."/>
--- a/make/project.properties	Tue May 31 13:04:26 2016 +0530
+++ b/make/project.properties	Tue May 31 21:12:34 2016 +0530
@@ -24,7 +24,8 @@
 application.title=nashorn
 
 # location of JDK embedded ASM sources
-jdk.asm.src.dir=../jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm
+jdk.java.base.dir=../jdk/src/java.base/share/classes
+jdk.asm.src.dir=${jdk.java.base.dir}/jdk/internal/org/objectweb/asm
 
 # location of JDK embedded jline sources
 jdk.jline.src.dir=../jdk/src/jdk.internal.le/share/classes
@@ -86,6 +87,8 @@
 nashorn.jar=${dist.dir}/nashorn.jar
 jjs.jar=${dist.dir}/jjs.jar
 dist.javadoc.dir=${dist.dir}/javadoc
+dist.nashornapi.javadoc.dir=${dist.javadoc.dir}/nashornapi
+dist.dynalinkapi.javadoc.dir=${dist.javadoc.dir}/dynalinkapi
 
 # configuration for java flight recorder
 run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Module.java	Tue May 31 13:04:26 2016 +0530
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Module.java	Tue May 31 21:12:34 2016 +0530
@@ -44,7 +44,7 @@
     /**
      * A module ExportEntry record.
      *
-     * @link http://www.ecma-international.org/ecma-262/6.0/#sec-source-text-module-records
+     * @see <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-source-text-module-records">es6 modules</a>
      */
     public static final class ExportEntry {
         private final String exportName;
@@ -164,7 +164,7 @@
     /**
      * An ImportEntry record.
      *
-     * @link http://www.ecma-international.org/ecma-262/6.0/#sec-source-text-module-records
+     * @see <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-source-text-module-records">es6 modules</a>
      */
     public static final class ImportEntry {
         private final String moduleRequest;
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java	Tue May 31 13:04:26 2016 +0530
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Parser.java	Tue May 31 21:12:34 2016 +0530
@@ -4626,6 +4626,9 @@
      *   ArrowFunction[?In, ?Yield]
      *   LeftHandSideExpression[?Yield] = AssignmentExpression[?In, ?Yield]
      *   LeftHandSideExpression[?Yield] AssignmentOperator AssignmentExpression[?In, ?Yield]
+     *
+     * @param noIn {@code true} if IN operator should be ignored.
+     * @return the assignment expression
      */
     protected Expression assignmentExpression(final boolean noIn) {
         // This method is protected so that subclass can get details