8154313: Generated javadoc scattered all over the place

Thu, 06 Aug 2020 06:35:39 +0100

author
jvanek
date
Thu, 06 Aug 2020 06:35:39 +0100
changeset 2542
741aff26fe61
parent 2541
834c6a13c8c8
child 2543
1059e4b7426a

8154313: Generated javadoc scattered all over the place
Summary: Added new top level target zip-docs which scans all generated javadocs and prepare zip-archive in way understandable to most IDEs
Reviewed-by: sgehwolf, andrew

make/Javadoc.gmk file | annotate | diff | comparison | revisions
make/Main.gmk file | annotate | diff | comparison | revisions
     1.1 --- a/make/Javadoc.gmk	Wed Jul 29 09:43:12 2020 +0200
     1.2 +++ b/make/Javadoc.gmk	Thu Aug 06 06:35:39 2020 +0100
     1.3 @@ -221,6 +221,11 @@
     1.4  JRE_API_DOCSDIR = $(DOCSDIR)/jre/api
     1.5  PLATFORM_DOCSDIR = $(DOCSDIR)/platform
     1.6  
     1.7 +JAVADOC_ARCHIVE_NAME := jdk-$(FULL_VERSION)-docs.zip
     1.8 +JAVADOC_ARCHIVE_ASSEMBLY_DIR :=  $(DOCSTMPDIR)/docs-zip
     1.9 +JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles
    1.10 +JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME)
    1.11 +
    1.12  # The non-core api javadocs need to be able to access the root of the core
    1.13  # api directory, so for jdk/api or jre/api to get to the core api/
    1.14  # directory we would use this:
    1.15 @@ -329,6 +334,37 @@
    1.16  all: docs
    1.17  docs: coredocs otherdocs
    1.18  
    1.19 +#
    1.20 +# Optional target which bundles all generated javadocs into a zip 
    1.21 +# archive. The dependency on docs is handled in Main.gmk. Incremental 
    1.22 +# building of docs is currently broken so if you invoke docs-zip after 
    1.23 +# docs, the docs are always rebuilt.
    1.24 +#
    1.25 +
    1.26 +docs-zip: $(JAVADOC_ARCHIVE)
    1.27 +
    1.28 +#
    1.29 +# Add the core docs as prerequisite to the archive to trigger a rebuild
    1.30 +# if the core docs were rebuilt. Ideally any doc rebuild should trigger
    1.31 +# this, but the way prerequisites are currently setup in this file, that
    1.32 +# is hard to achieve.
    1.33 +#
    1.34 +
    1.35 +$(JAVADOC_ARCHIVE): $(COREAPI_INDEX_FILE)
    1.36 +	@$(ECHO) $(LOG_INFO) "Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME)"
    1.37 +	$(MKDIR) -p $(JAVADOC_ARCHIVE_DIR)
    1.38 +	$(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
    1.39 +	$(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
    1.40 +	all_roots=`$(FIND) $(DOCSDIR) | $(GREP) index.html | grep -v old/doclet `; \
    1.41 +	pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \
    1.42 +	for index_file in $${all_roots} ; do \
    1.43 +	  target_dir=`dirname $${index_file}`; \
    1.44 +	  name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \
    1.45 +	  $(LN) -s $${target_dir}  $${name}; \
    1.46 +	done; \
    1.47 +	$(ZIP) -q -r $(JAVADOC_ARCHIVE) * ; \
    1.48 +	popd ;
    1.49 +
    1.50  #################################################################
    1.51  # Production Targets -- USE THESE TARGETS WHEN:
    1.52  # a) You're generating docs outside of release engineering's
    1.53 @@ -1372,4 +1408,4 @@
    1.54  
    1.55  #############################################################
    1.56  .PHONY: all docs coredocs rel-docs otherdocs rel-coredocs \
    1.57 -    sanitycheckcoredocs $(ALL_OTHER_TARGETS)
    1.58 +    sanitycheckcoredocs $(ALL_OTHER_TARGETS) docs-zip
     2.1 --- a/make/Main.gmk	Wed Jul 29 09:43:12 2020 +0200
     2.2 +++ b/make/Main.gmk	Thu Aug 06 06:35:39 2020 +0100
     2.3 @@ -161,6 +161,12 @@
     2.4  	@($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
     2.5  	@$(call TargetExit)
     2.6  
     2.7 +docs-zip: docs docs-zip-only
     2.8 +docs-zip-only: start-make
     2.9 +	@$(call TargetEnter)
    2.10 +	@($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
    2.11 +	@$(call TargetExit)
    2.12 +
    2.13  sign-jars: jdk sign-jars-only
    2.14  sign-jars-only: start-make
    2.15  	@$(call TargetEnter)
    2.16 @@ -235,6 +241,8 @@
    2.17  clean-docs:
    2.18  	$(call CleanComponent,docs)
    2.19  	$(call CleanComponent,docstemp)
    2.20 +clean-docs-zip:
    2.21 +	$(call CleanComponent,bundles/jdk-*-docs.zip)
    2.22  clean-test:
    2.23  	$(call CleanComponent,testoutput)
    2.24  	
    2.25 @@ -246,10 +254,10 @@
    2.26          endif
    2.27  	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
    2.28  
    2.29 -.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs
    2.30 -.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only
    2.31 +.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs docs-zip
    2.32 +.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only docs-zip-only
    2.33  .PHONY: default all clean dist-clean bootcycle-images start-make
    2.34 -.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-test clean-overlay-images clean-bootcycle-build
    2.35 +.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-docs-zip clean-test clean-overlay-images clean-bootcycle-build
    2.36  .PHONY: profiles profiles-only
    2.37  
    2.38  include $(root_dir)/make/Jprt.gmk

mercurial