Blame SOURCES/8154313.patch

2b939e
--- jdk8/make/Javadoc.gmk	2016-04-01 16:53:41.069477682 +0200
2b939e
+++ jdk8/make/Javadoc.gmk	2016-04-01 16:53:41.014477059 +0200
2b939e
@@ -220,6 +220,12 @@
2b939e
 JRE_API_DOCSDIR = $(DOCSDIR)/jre/api
2b939e
 PLATFORM_DOCSDIR = $(DOCSDIR)/platform
2b939e
 
2b939e
+
2b939e
+JAVADOC_ARCHIVE_NAME := jdk-$(FULL_VERSION)-docs.zip
2b939e
+JAVADOC_ARCHIVE_ASSEMBLY_DIR :=  $(DOCSTMPDIR)/zip-docs
2b939e
+JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles
2b939e
+JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME)
2b939e
+
2b939e
 # The non-core api javadocs need to be able to access the root of the core
2b939e
 # api directory, so for jdk/api or jre/api to get to the core api/
2b939e
 # directory we would use this:
2b939e
@@ -319,6 +325,37 @@
2b939e
 all: docs
2b939e
 docs: coredocs otherdocs
2b939e
 
2b939e
+#
2b939e
+# Optional target which bundles all generated javadocs into a zip 
2b939e
+# archive. The dependency on docs is handled in Main.gmk. Incremental 
2b939e
+# building of docs is currently broken so if you invoke zip-docs after 
2b939e
+# docs, the docs are always rebuilt.
2b939e
+#
2b939e
+
2b939e
+zip-docs: $(JAVADOC_ARCHIVE)
2b939e
+
2b939e
+#
2b939e
+# Add the core docs as prerequisite to the archive to trigger a rebuild
2b939e
+# if the core docs were rebuilt. Ideally any doc rebuild should trigger
2b939e
+# this, but the way prerequisites are currently setup in this file, that
2b939e
+# is hard to achieve.
2b939e
+#
2b939e
+
2b939e
+$(JAVADOC_ARCHIVE): $(COREAPI_INDEX_FILE)
2b939e
+	@$(ECHO) "Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME)" ; 
2b939e
+	$(MKDIR) -p $(JAVADOC_ARCHIVE_DIR) ;
2b939e
+	$(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR) ;
2b939e
+	$(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR);
2b939e
+	all_roots=`$(FIND) $(DOCSDIR) | $(GREP) index.html `; \
2b939e
+	pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \
2b939e
+	for index_file in $${all_roots} ; do \
2b939e
+	  target_dir=`dirname $${index_file}`; \
2b939e
+	  name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \
2b939e
+	  $(LN) -s $${target_dir}  $${name}; \
2b939e
+	done; \
2b939e
+	$(ZIP) -q -r $(JAVADOC_ARCHIVE) * ; \
2b939e
+	popd ;
2b939e
+
2b939e
 #################################################################
2b939e
 # Production Targets -- USE THESE TARGETS WHEN:
2b939e
 # a) You're generating docs outside of release engineering's
2b939e
--- jdk8/make/Main.gmk	2016-04-01 16:53:41.311480424 +0200
2b939e
+++ jdk8/make/Main.gmk	2016-04-01 16:53:41.266479914 +0200
2b939e
@@ -165,6 +165,12 @@
2b939e
 	@($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
2b939e
 	@$(call TargetExit)
2b939e
 
2b939e
+zip-docs: docs zip-docs-only
2b939e
+zip-docs-only: start-make
2b939e
+	@$(call TargetEnter)
2b939e
+	@($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk zip-docs)
2b939e
+	@$(call TargetExit)
2b939e
+
2b939e
 sign-jars: jdk sign-jars-only
2b939e
 sign-jars-only: start-make
2b939e
 	@$(call TargetEnter)