changeset 44733:6505f00be6f2

8178038: Copy jdwp-protocol.html to proper location 8178039: Copy jvmti.html to proper location 8178316: Add JVM-MANAGEMENT-MIB.mib to jdk/src/java.management/share/specs/ Reviewed-by: erikj, mchung
author ihse
date Sun, 23 Apr 2017 21:10:32 +0200
parents c43bf5c360d5
children 70bbd6884287
files make/Javadoc.gmk make/Main.gmk make/common/Modules.gmk
diffstat 3 files changed, 53 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/make/Javadoc.gmk	Fri Apr 21 11:31:09 2017 +0200
+++ b/make/Javadoc.gmk	Sun Apr 23 21:10:32 2017 +0200
@@ -343,27 +343,42 @@
 # JAVASE_API_MODULEGRAPH_TARGETS.
 
 ################################################################################
-# Copy targets
+# Copy JDK specs files
 
-JDWP_HTML := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
+# For all html documentation in $module/share/specs directories, copy it
+# unmodified
 
-$(eval $(call SetupCopyFiles, COPY_JDWP_HTML, \
-    FILES := $(JDWP_HTML), \
-    DEST := $(JAVADOC_OUTPUTDIR)/platform/jpda/jdwp, \
+ALL_MODULES := $(call FindAllModules)
+COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib
+
+$(foreach m, $(ALL_MODULES), \
+  $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
+  $(if $(SPECS_$m), \
+    $(eval $(call SetupCopyFiles, COPY_$m, \
+        SRC := $(SPECS_$m), \
+        FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $(SPECS_$m))), \
+        DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
+    )) \
+    $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
+  ) \
+)
+
+# Special treatment for generated documentation
+
+JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
+$(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
+    FILES := $(JDWP_PROTOCOL), \
+    DEST := $(JAVADOC_OUTPUTDIR)/specs/jdwp, \
 ))
+JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
 
-COPY_TARGETS += $(COPY_JDWP_HTML)
-
-# Pick jvmti.html from any jvm variant, they are all the same.
-JVMTI_HTML := $(firstword \
-    $(wildcard $(HOTSPOT_OUTPUTDIR)/variant-*/gensrc/jvmtifiles/jvmti.html))
-
+# Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
+JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
     FILES := $(JVMTI_HTML), \
-    DEST := $(JAVADOC_OUTPUTDIR)/platform/jvmti, \
+    DEST := $(JAVADOC_OUTPUTDIR)/specs, \
 ))
-
-COPY_TARGETS += $(COPY_JVMTI_HTML)
+JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
 
 ################################################################################
 # Optional target which bundles all generated javadocs into a zip archive.
@@ -372,10 +387,10 @@
 JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
 
 $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
-  SRC := $(JAVADOC_OUTPUTDIR), \
-  ZIP := $(JAVADOC_ZIP_FILE), \
-  EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
-      $(COPY_TARGETS), \
+    SRC := $(JAVADOC_OUTPUTDIR), \
+    ZIP := $(JAVADOC_ZIP_FILE), \
+    EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
+        $(JDK_SPECS_TARGETS), \
 ))
 
 ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
@@ -395,12 +410,12 @@
 
 docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
 
-docs-copy: $(COPY_TARGETS)
+docs-jdk-specs: $(JDK_SPECS_TARGETS)
 
 docs-zip: $(ZIP_TARGETS)
 
 all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
-    docs-javase-api-modulegraph docs-copy docs-zip
+    docs-javase-api-modulegraph docs-jdk-specs docs-zip
 
 .PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
-    docs-javase-api-javadoc docs-javase-api-modulegraph docs-copy docs-zip
+    docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs docs-zip
--- a/make/Main.gmk	Fri Apr 21 11:31:09 2017 +0200
+++ b/make/Main.gmk	Sun Apr 23 21:10:32 2017 +0200
@@ -374,8 +374,8 @@
 docs-javase-api-modulegraph:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javase-api-modulegraph)
 
-docs-copy:
-	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-copy)
+docs-jdk-specs:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-jdk-specs)
 
 docs-zip:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
@@ -384,8 +384,8 @@
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
 
 ALL_TARGETS += docs-jdk-api-javadoc docs-jdk-api-modulegraph \
-    docs-javase-api-javadoc docs-javase-api-modulegraph docs-copy docs-zip \
-    update-build-docs
+    docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs \
+    docs-zip update-build-docs
 
 ################################################################################
 # Cross compilation support
@@ -790,10 +790,10 @@
 
   docs-javase-api-modulegraph: exploded-image buildtools-modules
 
-  # The gensrc step for jdk.jdi creates an html file that is used by docs-copy.
-  docs-copy: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
+  # The gensrc steps for hotspot and jdk.jdi create html spec files.
+  docs-jdk-specs: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
 
-  docs-zip: docs-jdk docs-copy
+  docs-zip: docs-jdk
 
   test: jdk-image test-image
 
@@ -922,7 +922,7 @@
   docs-javase-api: docs-javase-api-modulegraph
 endif
 
-docs-jdk: docs-jdk-api
+docs-jdk: docs-jdk-api docs-jdk-specs
 docs-javase: docs-javase-api
 
 # alias for backwards compatibility
@@ -959,7 +959,7 @@
 endif
 
 # This target builds the documentation image
-docs-image: docs-jdk docs-copy
+docs-image: docs-jdk
 
 # This target builds the test image
 test-image: prepare-test-image test-image-hotspot-jtreg-native \
--- a/make/common/Modules.gmk	Fri Apr 21 11:31:09 2017 +0200
+++ b/make/common/Modules.gmk	Sun Apr 23 21:10:32 2017 +0200
@@ -229,6 +229,8 @@
 endif
 SRC_SUBDIRS += share/classes
 
+SPEC_SUBDIRS += share/specs
+
 # Find all module-info.java files for the current build target platform and
 # configuration.
 # Param 1 - Module to find for, set to * for finding all
@@ -281,6 +283,12 @@
         $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
         $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
 
+# Find all specs dirs for a particular module
+# $1 - Module to find specs dirs for
+FindModuleSpecsDirs = \
+    $(strip $(wildcard \
+        $(foreach sub, $(SPEC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
+
 # Construct the complete module source path
 GetModuleSrcPath = \
     $(call PathList, \