8176785: Add build support to generate PNG file from .dot file
Reviewed-by: erikj, mchung
This commit is contained in:
parent
5638b45559
commit
ce53169041
@ -47,7 +47,7 @@ help:
|
|||||||
$(info $(_) # dependencies for the target. This is faster but may)
|
$(info $(_) # dependencies for the target. This is faster but may)
|
||||||
$(info $(_) # result in incorrect build results!)
|
$(info $(_) # result in incorrect build results!)
|
||||||
$(info $(_) make docs # Create all docs)
|
$(info $(_) make docs # Create all docs)
|
||||||
$(info $(_) make docs-javadoc # Create just javadocs, depends on less than full docs)
|
$(info $(_) make docs-jdk-api # Create just JDK javadocs)
|
||||||
$(info $(_) make profiles # Create complete jre compact profile images)
|
$(info $(_) make profiles # Create complete jre compact profile images)
|
||||||
$(info $(_) make bootcycle-images # Build images twice, second time with newly built JDK)
|
$(info $(_) make bootcycle-images # Build images twice, second time with newly built JDK)
|
||||||
$(info $(_) make install # Install the generated images locally)
|
$(info $(_) make install # Install the generated images locally)
|
||||||
|
318
make/Javadoc.gmk
318
make/Javadoc.gmk
@ -37,12 +37,9 @@ $(eval $(call ReadImportMetaData))
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Javadoc settings
|
# Javadoc settings
|
||||||
|
|
||||||
# All modules to have docs generated by docs-javadoc target
|
|
||||||
JAVADOC_MODULES := $(sort $(DOCS_MODULES))
|
|
||||||
|
|
||||||
# On top of the sources that was used to compile the JDK, we need some
|
# On top of the sources that was used to compile the JDK, we need some
|
||||||
# extra java.rmi sources that are used just for javadoc.
|
# extra java.rmi sources that are used just for javadoc.
|
||||||
JAVADOC_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
|
MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
|
||||||
$(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
|
$(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
|
||||||
|
|
||||||
# Should we use -Xdocrootparent? Allow custom to overwrite.
|
# Should we use -Xdocrootparent? Allow custom to overwrite.
|
||||||
@ -89,13 +86,6 @@ JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
|
|||||||
-serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
|
-serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
|
||||||
--expand-requires transitive
|
--expand-requires transitive
|
||||||
|
|
||||||
#
|
|
||||||
# TODO: this should be set by the configure option.
|
|
||||||
#
|
|
||||||
ifndef ENABLE_MODULE_GRAPH
|
|
||||||
ENABLE_MODULE_GRAPH=false
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Should we add DRAFT stamps to the generated javadoc?
|
# Should we add DRAFT stamps to the generated javadoc?
|
||||||
ifeq ($(VERSION_IS_GA), true)
|
ifeq ($(VERSION_IS_GA), true)
|
||||||
IS_DRAFT := false
|
IS_DRAFT := false
|
||||||
@ -118,16 +108,9 @@ ifeq ($(IS_DRAFT), true)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# JDK javadoc titles/text snippets
|
|
||||||
|
|
||||||
JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
|
JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
|
||||||
$(DRAFT_MARKER_TITLE)
|
$(DRAFT_MARKER_TITLE)
|
||||||
|
|
||||||
JAVADOC_DOC_TITLE := Java™ Platform, Standard Edition Development Kit \
|
|
||||||
(JDK™) $(VERSION_SPECIFICATION)<br>API Specification
|
|
||||||
|
|
||||||
JAVADOC_HEADER_TITLE := $(subst $(SPACE), ,$(strip \
|
JAVADOC_HEADER_TITLE := $(subst $(SPACE), ,$(strip \
|
||||||
<strong>Java™ Platform<br>Standard Ed. \
|
<strong>Java™ Platform<br>Standard Ed. \
|
||||||
$(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
|
$(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
|
||||||
@ -156,100 +139,208 @@ JAVADOC_TOP := \
|
|||||||
purpose of evaluation.</div></div>
|
purpose of evaluation.</div></div>
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Java SE Reference javadoc titles/text snippets
|
# JDK javadoc titles/text snippets
|
||||||
|
|
||||||
REFERENCE_DOC_TITLE := Java™ Platform, Standard Edition \
|
JDK_JAVADOC_DOC_TITLE := Java™ Platform, Standard Edition Development Kit \
|
||||||
|
(JDK™) $(VERSION_SPECIFICATION)<br>API Specification
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Java SE javadoc titles/text snippets
|
||||||
|
|
||||||
|
JAVASE_JAVADOC_DOC_TITLE := Java™ Platform, Standard Edition \
|
||||||
$(VERSION_SPECIFICATION)<br>API Specification
|
$(VERSION_SPECIFICATION)<br>API Specification
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Setup call to JDK javadoc based on above settings
|
# Functions
|
||||||
|
|
||||||
# Create a string like "-Xdoclint:all,-syntax,-html,..."
|
# Helper function for creating a png file from a dot file generated by the
|
||||||
JAVADOC_OPTIONS += -Xdoclint:all,$(call CommaList, $(addprefix -, \
|
# GenGraphs tool.
|
||||||
$(JAVADOC_DISABLED_DOCLINT)))
|
# param 1: SetupJavadocGeneration namespace ($1)
|
||||||
|
# param 2: module name
|
||||||
|
#
|
||||||
|
define setup_gengraph_dot_to_png
|
||||||
|
$1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot
|
||||||
|
$1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
|
||||||
|
|
||||||
ifneq ($($DOCROOTPARENT_FLAG), )
|
# For each module needing a graph, create a png file from the dot file
|
||||||
JAVADOC_OPTIONS += -Xdocrootparent $(JAVADOC_BASE_URL)
|
# generated by the GenGraphs tool and store it in the target dir.
|
||||||
endif
|
$$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
|
||||||
|
$$(call MakeDir, $$(@D))
|
||||||
|
$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
|
||||||
|
$$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
|
||||||
|
|
||||||
JAVADOC_TITLE_OPTIONS += -doctitle '$(JAVADOC_DOC_TITLE)'
|
$1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
|
||||||
JAVADOC_TITLE_OPTIONS += -windowtitle '$(JAVADOC_WINDOW_TITLE)'
|
endef
|
||||||
JAVADOC_TITLE_OPTIONS += -header '$(JAVADOC_HEADER_TITLE)'
|
|
||||||
JAVADOC_TITLE_OPTIONS += -bottom '$(JAVADOC_BOTTOM)'
|
|
||||||
ifeq ($(IS_DRAFT), true)
|
|
||||||
JAVADOC_TITLE_OPTIONS += -top '$(JAVADOC_TOP)'
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Do not store debug level options in VARDEPS.
|
|
||||||
ifneq ($(LOG_LEVEL), trace)
|
|
||||||
JAVADOC_LOG_OPTION += -quiet
|
|
||||||
else
|
|
||||||
JAVADOC_LOG_OPTION += -verbose
|
|
||||||
endif
|
|
||||||
|
|
||||||
JAVADOC_VARDEPS := $(JAVADOC_OPTIONS) $(JAVADOC_TITLE_OPTIONS) $(JAVADOC_TAGS) \
|
|
||||||
$(JAVADOC_MODULES) $(JAVADOC_SOURCE_PATH)
|
|
||||||
JAVADOC_VARDEPS_FILE := $(call DependOnVariable, JAVADOC_VARDEPS, \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/docs/javadoc.vardeps)
|
|
||||||
|
|
||||||
# Get a list of all files in all the source dirs for all included modules
|
|
||||||
JAVADOC_SOURCE_DEPS := $(call CacheFind, $(wildcard \
|
|
||||||
$(foreach module, $(JAVADOC_MODULES), $(call FindModuleSrcDirs, $(module)))))
|
|
||||||
|
|
||||||
JAVADOC_TARGET_DIR := $(JAVADOC_OUTPUTDIR)/api
|
|
||||||
JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
|
|
||||||
|
|
||||||
# Javadoc creates a lot of files but use index.html as a marker
|
|
||||||
$(JAVADOC_TARGET_DIR)/index.html: $(BUILD_TOOLS_JDK) $(JAVADOC_VARDEPS_FILE) \
|
|
||||||
$(JAVADOC_SOURCE_DEPS) $(JAVADOC_OVERVIEW)
|
|
||||||
$(call LogWarn, Generating Javadoc for $(words $(JAVADOC_MODULES)) modules)
|
|
||||||
$(call LogInfo, Javadoc modules: $(JAVADOC_MODULES))
|
|
||||||
$(call MakeDir, $(JAVADOC_TARGET_DIR))
|
|
||||||
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/docs/javadoc, \
|
|
||||||
$(JAVA) -Djava.awt.headless=true \
|
|
||||||
-DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
|
|
||||||
$(NEW_JAVADOC) -d $(JAVADOC_TARGET_DIR) \
|
|
||||||
$(JAVADOC_TAGS) $(JAVADOC_OPTIONS) $(JAVADOC_LOG_OPTION) \
|
|
||||||
$(JAVADOC_TITLE_OPTIONS) -overview $(JAVADOC_OVERVIEW) \
|
|
||||||
--module-source-path $(JAVADOC_SOURCE_PATH) \
|
|
||||||
--module $(call CommaList, $(JAVADOC_MODULES)))
|
|
||||||
|
|
||||||
JAVADOC_TARGETS += $(JAVADOC_TARGET_DIR)/index.html
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Setup call to Java SE Reference javadoc based on above settings
|
# Setup make rules for creating the API documentation, using javadoc and other
|
||||||
|
# tools if needed.
|
||||||
|
#
|
||||||
|
# Parameter 1 is the name of the rule. This name is used as variable prefix.
|
||||||
|
# Targets generated are returned as $1_JAVADOC_TARGETS and
|
||||||
|
# $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
|
||||||
|
# file" for all the magnitude of files that are generated by javadoc.
|
||||||
|
#
|
||||||
|
# Remaining parameters are named arguments. These include:
|
||||||
|
# MODULES - Modules to generate javadoc for
|
||||||
|
# NAME - The name of the javadoc compilation, to be presented to the user
|
||||||
|
# TARGET_DIR - Where to store the output
|
||||||
|
# OVERVIEW - Path to an html overview file
|
||||||
|
# DOC_TITLE - Title to use in -doctitle.
|
||||||
|
# WINDOW_TITLE - Title to use in -windowtitle.
|
||||||
|
# HEADER_TITLE - Title to use in -header.
|
||||||
|
# BOTTOM_TEXT - Text to use in -bottom.
|
||||||
|
# TOP_TEXT - Text to use in -top.
|
||||||
|
#
|
||||||
|
SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
|
||||||
|
define SetupApiDocsGenerationBody
|
||||||
|
|
||||||
REFERENCE_TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api
|
# Figure out all modules, both specified and transitive, that will be processed
|
||||||
REFERENCE_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
|
# by javadoc.
|
||||||
|
$1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
|
||||||
|
$1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
|
||||||
|
|
||||||
REFERENCE_TITLE_OPTIONS += -doctitle '$(REFERENCE_DOC_TITLE)'
|
ifeq ($$(ENABLE_FULL_DOCS), true)
|
||||||
REFERENCE_TITLE_OPTIONS += -windowtitle '$(JAVADOC_WINDOW_TITLE)'
|
# Tell the ModuleGraph taglet to generate html links to soon-to-be-created
|
||||||
REFERENCE_TITLE_OPTIONS += -header '$(JAVADOC_HEADER_TITLE)'
|
# png files with module graphs.
|
||||||
REFERENCE_TITLE_OPTIONS += -bottom '$(JAVADOC_BOTTOM)'
|
$1_JAVA_ARGS += -DenableModuleGraph=true
|
||||||
ifeq ($(IS_DRAFT), true)
|
endif
|
||||||
REFERENCE_TITLE_OPTIONS += -top '$(JAVADOC_TOP)'
|
|
||||||
endif
|
|
||||||
|
|
||||||
REFERENCE_VARDEPS := $(JAVADOC_OPTIONS) $(REFERENCE_TITLE_OPTIONS) $(JAVADOC_TAGS) \
|
# Always include tags and basic options
|
||||||
$(JAVADOC_MODULES) $(JAVADOC_SOURCE_PATH)
|
$1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
|
||||||
REFERENCE_VARDEPS_FILE := $(call DependOnVariable, REFERENCE_VARDEPS, \
|
|
||||||
$(SUPPORT_OUTPUTDIR)/docs/reference.vardeps)
|
|
||||||
|
|
||||||
# Javadoc creates a lot of files but use index.html as a marker.
|
$1_OPTIONS += -overview $$($1_OVERVIEW)
|
||||||
$(REFERENCE_TARGET_DIR)/index.html: $(BUILD_TOOLS_JDK) $(REFERENCE_VARDEPS_FILE) \
|
$1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
|
||||||
$(JAVADOC_SOURCE_DEPS) $(REFERENCE_OVERVIEW)
|
$1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
|
||||||
$(call LogWarn, Generating reference Javadoc for Java SE)
|
|
||||||
$(call MakeDir, $(REFERENCE_TARGET_DIR))
|
|
||||||
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/docs/reference, \
|
|
||||||
$(JAVA) -Djava.awt.headless=true \
|
|
||||||
-DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
|
|
||||||
$(NEW_JAVADOC) -d $(REFERENCE_TARGET_DIR) \
|
|
||||||
$(JAVADOC_TAGS) $(JAVADOC_OPTIONS) $(JAVADOC_LOG_OPTION) \
|
|
||||||
$(REFERENCE_TITLE_OPTIONS) -overview $(REFERENCE_OVERVIEW) \
|
|
||||||
--module-source-path $(JAVADOC_SOURCE_PATH) \
|
|
||||||
--module java.se.ee)
|
|
||||||
|
|
||||||
REFERENCE_TARGETS += $(REFERENCE_TARGET_DIR)/index.html
|
# Create a string like "-Xdoclint:all,-syntax,-html,..."
|
||||||
|
$1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
|
||||||
|
$$(JAVADOC_DISABLED_DOCLINT)))
|
||||||
|
|
||||||
|
ifneq ($$($$DOCROOTPARENT_FLAG), )
|
||||||
|
$1_OPTIONS += -Xdocrootparent $$(JAVADOC_BASE_URL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
|
||||||
|
$1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
|
||||||
|
$1_OPTIONS += -header '$$($1_HEADER_TITLE)'
|
||||||
|
$1_OPTIONS += -bottom '$$($1_BOTTOM_TEXT)'
|
||||||
|
ifeq ($$(IS_DRAFT), true)
|
||||||
|
$1_OPTIONS += -top '$$($1_TOP_TEXT)'
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Do not store debug level options in VARDEPS.
|
||||||
|
ifneq ($$(LOG_LEVEL), trace)
|
||||||
|
$1_LOG_OPTION += -quiet
|
||||||
|
else
|
||||||
|
$1_LOG_OPTION += -verbose
|
||||||
|
endif
|
||||||
|
|
||||||
|
$1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
|
||||||
|
$$($1_ALL_MODULES)
|
||||||
|
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
|
||||||
|
$$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
|
||||||
|
|
||||||
|
# Get a list of all files in all the source dirs for all included modules
|
||||||
|
$1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
|
||||||
|
$$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
|
||||||
|
|
||||||
|
# Javadoc creates a lot of files but use index.html as a marker
|
||||||
|
$$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
|
||||||
|
$$($1_SOURCE_DEPS) $$($1_OVERVIEW)
|
||||||
|
$$(call LogWarn, Generating $$($1_NAME) API javadoc for \
|
||||||
|
$$(words $$($1_ALL_MODULES)) modules)
|
||||||
|
$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
|
||||||
|
$$(call MakeDir, $$($1_TARGET_DIR))
|
||||||
|
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
|
||||||
|
$$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
|
||||||
|
$$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
|
||||||
|
$$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
|
||||||
|
|
||||||
|
$1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
|
||||||
|
|
||||||
|
ifeq ($$(ENABLE_FULL_DOCS), true)
|
||||||
|
# We have asked ModuleGraph to generate links to png files. Now we must
|
||||||
|
# produce the png files.
|
||||||
|
|
||||||
|
# Locate which modules has the @moduleGraph tag in their module-info.java
|
||||||
|
$1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
|
||||||
|
$$(if $$(shell $$(GREP) -e @moduleGraph \
|
||||||
|
$$(wildcard $$(addsuffix /module-info.java, \
|
||||||
|
$$(call FindModuleSrcDirs, $$m)))), \
|
||||||
|
$$m) \
|
||||||
|
))
|
||||||
|
|
||||||
|
# First we run the GenGraph tool. It will query the module structure of the
|
||||||
|
# running JVM and output .dot files for all existing modules.
|
||||||
|
GENGRAPHS_PROPS := \
|
||||||
|
$$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
|
||||||
|
|
||||||
|
$1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
|
||||||
|
$1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
|
||||||
|
|
||||||
|
$$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
|
||||||
|
$$(call LogInfo, Running gengraphs for $$($1_NAME) API documentation)
|
||||||
|
$$(call MakeDir, $$($1_GENGRAPHS_DIR))
|
||||||
|
$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
|
||||||
|
$$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
|
||||||
|
--dot-attributes $$(GENGRAPHS_PROPS) && \
|
||||||
|
$$(TOUCH) $$($1_GENGRAPHS_MARKER))
|
||||||
|
|
||||||
|
# For each module needing a graph, create a png file from the dot file
|
||||||
|
# generated by the GenGraphs tool and store it in the target dir.
|
||||||
|
# They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
|
||||||
|
$$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
|
||||||
|
$$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Setup generation of the JDK API documentation (javadoc + modulegraph)
|
||||||
|
|
||||||
|
# All modules to have docs generated by docs-jdk-api target
|
||||||
|
JDK_JAVADOC_MODULES := $(sort $(DOCS_MODULES))
|
||||||
|
|
||||||
|
JDK_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
|
||||||
|
|
||||||
|
$(eval $(call SetupApiDocsGeneration, JDK_API, \
|
||||||
|
MODULES := $(JDK_JAVADOC_MODULES), \
|
||||||
|
NAME := JDK, \
|
||||||
|
TARGET_DIR := $(JAVADOC_OUTPUTDIR)/api, \
|
||||||
|
OVERVIEW := $(JDK_JAVADOC_OVERVIEW), \
|
||||||
|
DOC_TITLE := $(JDK_JAVADOC_DOC_TITLE), \
|
||||||
|
WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
|
||||||
|
HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
|
||||||
|
BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
|
||||||
|
TOP_TEXT := $(JAVADOC_TOP), \
|
||||||
|
))
|
||||||
|
|
||||||
|
# Targets generated are returned in JDK_API_JAVADOC_TARGETS and
|
||||||
|
# JDK_API_MODULEGRAPH_TARGETS.
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Setup generation of the Java SE API documentation (javadoc + modulegraph)
|
||||||
|
|
||||||
|
# The Java SE module scope is just java.se.ee and it's transitive modules.
|
||||||
|
JAVASE_JAVADOC_MODULES := java.se.ee
|
||||||
|
|
||||||
|
JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
|
||||||
|
|
||||||
|
$(eval $(call SetupApiDocsGeneration, JAVASE_API, \
|
||||||
|
MODULES := $(JAVASE_JAVADOC_MODULES), \
|
||||||
|
NAME := Java SE, \
|
||||||
|
TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
|
||||||
|
OVERVIEW := $(JAVASE_JAVADOC_OVERVIEW), \
|
||||||
|
DOC_TITLE := $(JAVASE_JAVADOC_DOC_TITLE), \
|
||||||
|
WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
|
||||||
|
HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
|
||||||
|
BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
|
||||||
|
TOP_TEXT := $(JAVADOC_TOP), \
|
||||||
|
))
|
||||||
|
|
||||||
|
# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
|
||||||
|
# JAVASE_API_MODULEGRAPH_TARGETS.
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Copy targets
|
# Copy targets
|
||||||
@ -283,25 +374,12 @@ JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
|
|||||||
$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
|
$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
|
||||||
SRC := $(JAVADOC_OUTPUTDIR), \
|
SRC := $(JAVADOC_OUTPUTDIR), \
|
||||||
ZIP := $(JAVADOC_ZIP_FILE), \
|
ZIP := $(JAVADOC_ZIP_FILE), \
|
||||||
EXTRA_DEPS := $(JAVADOC_TARGETS) $(COPY_TARGETS), \
|
EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
|
||||||
|
$(COPY_TARGETS), \
|
||||||
))
|
))
|
||||||
|
|
||||||
ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
|
ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# generate .dot files for module graphs
|
|
||||||
|
|
||||||
JAVADOC_MODULE_GRAPHS_DIR := $(SUPPORT_OUTPUTDIR)/docs/module-graphs
|
|
||||||
JAVADOC_MODULE_GRAPHS := $(JAVADOC_MODULE_GRAPHS_DIR)/java.se.dot
|
|
||||||
JAVADOC_MODULE_GRAPHS_PROPS := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
|
|
||||||
|
|
||||||
$(JAVADOC_MODULE_GRAPHS): $(BUILD_JIGSAW_TOOLS) $(JAVADOC_MODULE_GRAPHS_PROPS)
|
|
||||||
$(MKDIR) -p $(@D)
|
|
||||||
$(TOOL_GENGRAPHS) --spec --output $(JAVADOC_MODULE_GRAPHS_DIR) \
|
|
||||||
--dot-attributes $(JAVADOC_MODULE_GRAPHS_PROPS)
|
|
||||||
|
|
||||||
MODULE_GRAPH_TARGETS += $(JAVADOC_MODULE_GRAPHS)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Hook to include the corresponding custom file, if present.
|
# Hook to include the corresponding custom file, if present.
|
||||||
@ -309,16 +387,20 @@ $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
docs-module-graphs: $(MODULE_GRAPH_TARGETS)
|
docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS)
|
||||||
|
|
||||||
docs-javadoc: $(JAVADOC_TARGETS)
|
docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
|
||||||
|
|
||||||
docs-reference: $(REFERENCE_TARGETS)
|
docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS)
|
||||||
|
|
||||||
|
docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
|
||||||
|
|
||||||
docs-copy: $(COPY_TARGETS)
|
docs-copy: $(COPY_TARGETS)
|
||||||
|
|
||||||
docs-zip: $(ZIP_TARGETS)
|
docs-zip: $(ZIP_TARGETS)
|
||||||
|
|
||||||
all: docs-module-graphs docs-javadoc docs-reference docs-copy docs-zip
|
all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
|
||||||
|
docs-javase-api-modulegraph docs-copy docs-zip
|
||||||
|
|
||||||
.PHONY: default all docs-module-graphs docs-javadoc docs-reference docs-copy 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
|
||||||
|
@ -360,14 +360,19 @@ ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-im
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Docs targets
|
# Docs targets
|
||||||
|
|
||||||
docs-module-graphs:
|
# If building full docs, to complete docs-*-api we need both the javadoc and
|
||||||
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-module-graphs)
|
# modulegraph targets.
|
||||||
|
docs-jdk-api-javadoc:
|
||||||
|
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-jdk-api-javadoc)
|
||||||
|
|
||||||
docs-javadoc:
|
docs-jdk-api-modulegraph:
|
||||||
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javadoc)
|
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-jdk-api-modulegraph)
|
||||||
|
|
||||||
docs-reference:
|
docs-javase-api-javadoc:
|
||||||
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-reference)
|
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javase-api-javadoc)
|
||||||
|
|
||||||
|
docs-javase-api-modulegraph:
|
||||||
|
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javase-api-modulegraph)
|
||||||
|
|
||||||
docs-copy:
|
docs-copy:
|
||||||
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-copy)
|
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-copy)
|
||||||
@ -378,8 +383,9 @@ docs-zip:
|
|||||||
update-build-docs:
|
update-build-docs:
|
||||||
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
|
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
|
||||||
|
|
||||||
ALL_TARGETS += docs-module-graphs docs-javadoc docs-reference docs-copy \
|
ALL_TARGETS += docs-jdk-api-javadoc docs-jdk-api-modulegraph \
|
||||||
docs-zip update-build-docs
|
docs-javase-api-javadoc docs-javase-api-modulegraph docs-copy docs-zip \
|
||||||
|
update-build-docs
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Cross compilation support
|
# Cross compilation support
|
||||||
@ -776,16 +782,18 @@ else
|
|||||||
|
|
||||||
bootcycle-images: jdk-image
|
bootcycle-images: jdk-image
|
||||||
|
|
||||||
docs-module-graphs: exploded-image buildtools-modules
|
docs-jdk-api-javadoc: $(GENSRC_TARGETS) rmic
|
||||||
|
|
||||||
docs-javadoc: $(GENSRC_TARGETS) rmic
|
docs-javase-api-javadoc: $(GENSRC_TARGETS) rmic
|
||||||
|
|
||||||
docs-reference: $(GENSRC_TARGETS) rmic
|
docs-jdk-api-modulegraph: exploded-image buildtools-modules
|
||||||
|
|
||||||
|
docs-javase-api-modulegraph: exploded-image buildtools-modules
|
||||||
|
|
||||||
# The gensrc step for jdk.jdi creates an html file that is used by docs-copy.
|
# 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
|
docs-copy: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
|
||||||
|
|
||||||
docs-zip: docs-javadoc docs-copy
|
docs-zip: docs-jdk docs-copy
|
||||||
|
|
||||||
test: jdk-image test-image
|
test: jdk-image test-image
|
||||||
|
|
||||||
@ -904,6 +912,22 @@ endif
|
|||||||
|
|
||||||
create-buildjdk: create-buildjdk-copy create-buildjdk-interim-image
|
create-buildjdk: create-buildjdk-copy create-buildjdk-interim-image
|
||||||
|
|
||||||
|
docs-jdk-api: docs-jdk-api-javadoc
|
||||||
|
docs-javase-api: docs-javase-api-javadoc
|
||||||
|
|
||||||
|
# If we're building full docs, we must also generate the module graphs to
|
||||||
|
# get non-broken api documentation.
|
||||||
|
ifeq ($(ENABLE_FULL_DOCS), true)
|
||||||
|
docs-jdk-api: docs-jdk-api-modulegraph
|
||||||
|
docs-javase-api: docs-javase-api-modulegraph
|
||||||
|
endif
|
||||||
|
|
||||||
|
docs-jdk: docs-jdk-api
|
||||||
|
docs-javase: docs-javase-api
|
||||||
|
|
||||||
|
# alias for backwards compatibility
|
||||||
|
docs-javadoc: docs-jdk-api
|
||||||
|
|
||||||
mac-bundles: mac-bundles-jdk
|
mac-bundles: mac-bundles-jdk
|
||||||
|
|
||||||
# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
|
# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
|
||||||
@ -935,7 +959,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# This target builds the documentation image
|
# This target builds the documentation image
|
||||||
docs-image: docs-module-graphs docs-javadoc docs-copy
|
docs-image: docs-jdk docs-copy
|
||||||
|
|
||||||
# This target builds the test image
|
# This target builds the test image
|
||||||
test-image: prepare-test-image test-image-hotspot-jtreg-native \
|
test-image: prepare-test-image test-image-hotspot-jtreg-native \
|
||||||
@ -951,7 +975,8 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-gensrc gensrc gendata \
|
|||||||
copy java rmic libs launchers jmods \
|
copy java rmic libs launchers jmods \
|
||||||
jdk.jdwp.agent-gensrc $(ALL_MODULES) demos \
|
jdk.jdwp.agent-gensrc $(ALL_MODULES) demos \
|
||||||
exploded-image-base exploded-image \
|
exploded-image-base exploded-image \
|
||||||
create-buildjdk mac-bundles product-images \
|
create-buildjdk docs-jdk-api docs-javase-api docs-jdk docs-javase \
|
||||||
|
docs-javadoc mac-bundles product-images \
|
||||||
profiles profiles-images \
|
profiles profiles-images \
|
||||||
docs-image test-image all-images \
|
docs-image test-image all-images \
|
||||||
all-bundles
|
all-bundles
|
||||||
|
@ -294,15 +294,15 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
|
|||||||
( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) :=" && \
|
( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) :=" && \
|
||||||
$(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
|
$(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
|
||||||
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
|
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
|
||||||
/requires/ { sub(/;/, ""); \
|
/^ *requires/ { sub(/;/, ""); \
|
||||||
sub(/requires/, ""); \
|
sub(/requires/, ""); \
|
||||||
sub(/transitive/, ""); \
|
sub(/transitive/, ""); \
|
||||||
sub(/\/\/.*/, ""); \
|
sub(/\/\/.*/, ""); \
|
||||||
sub(/\/\*.*\*\//, ""); \
|
sub(/\/\*.*\*\//, ""); \
|
||||||
gsub(/^ +\*.*/, ""); \
|
gsub(/^ +\*.*/, ""); \
|
||||||
gsub(/ /, ""); \
|
gsub(/ /, ""); \
|
||||||
printf(" %s", $$0) } \
|
printf(" %s", $$0) } \
|
||||||
END { printf("\n") }' $m \
|
END { printf("\n") }' $m \
|
||||||
) >> $@ $(NEWLINE))
|
) >> $@ $(NEWLINE))
|
||||||
|
|
||||||
-include $(MODULE_DEPS_MAKEFILE)
|
-include $(MODULE_DEPS_MAKEFILE)
|
||||||
@ -320,6 +320,11 @@ FindTransitiveDepsForModule = \
|
|||||||
$(foreach n, $(call FindDepsForModule, $m), \
|
$(foreach n, $(call FindDepsForModule, $m), \
|
||||||
$(call FindDepsForModule, $n))))
|
$(call FindDepsForModule, $n))))
|
||||||
|
|
||||||
|
# Finds transitive dependencies in 3 levels for a set of modules.
|
||||||
|
# Param 1: List of modules to find transitive deps for
|
||||||
|
FindTransitiveDepsForModules = \
|
||||||
|
$(sort $(foreach m, $1, $(call FindTransitiveDepsForModule, $m)))
|
||||||
|
|
||||||
# Upgradeable modules are those that are either defined as upgradeable or that
|
# Upgradeable modules are those that are either defined as upgradeable or that
|
||||||
# require an upradeable module.
|
# require an upradeable module.
|
||||||
FindAllUpgradeableModules = \
|
FindAllUpgradeableModules = \
|
||||||
|
38
make/devkit/createGraphvizBundle.sh
Normal file
38
make/devkit/createGraphvizBundle.sh
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
# Create a bundle in the current directory, containing what's needed to run
|
||||||
|
# the 'dot' program from the graphviz suite by the OpenJDK build.
|
||||||
|
|
||||||
|
TMPDIR=`mktemp -d -t graphvizbundle-XXXX`
|
||||||
|
trap "rm -rf \"$TMPDIR\"" EXIT
|
||||||
|
|
||||||
|
ORIG_DIR=`pwd`
|
||||||
|
cd "$TMPDIR"
|
||||||
|
GRAPHVIZ_VERSION=2.38.0-1
|
||||||
|
PACKAGE_VERSION=1.1
|
||||||
|
TARGET_PLATFORM=linux_x64
|
||||||
|
BUNDLE_NAME=graphviz-$TARGET_PLATFORM-$GRAPHVIZ_VERSION+$PACKAGE_VERSION.tar.gz
|
||||||
|
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||||
|
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-libs-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||||
|
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-core-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||||
|
wget http://www.graphviz.org/pub/graphviz/stable/redhat/el6/x86_64/os/graphviz-plugins-x-$GRAPHVIZ_VERSION.el6.x86_64.rpm
|
||||||
|
|
||||||
|
mkdir graphviz
|
||||||
|
cd graphviz
|
||||||
|
for rpm in ../*.rpm; do
|
||||||
|
rpm2cpio $rpm | cpio --extract --make-directories
|
||||||
|
done
|
||||||
|
|
||||||
|
cat > dot << EOF
|
||||||
|
#!/bin/bash
|
||||||
|
# Get an absolute path to this script
|
||||||
|
this_script_dir=\`dirname \$0\`
|
||||||
|
this_script_dir=\`cd \$this_script_dir > /dev/null && pwd\`
|
||||||
|
export LD_LIBRARY_PATH="\$this_script_dir/usr/lib64:\$LD_LIBRARY_PATH"
|
||||||
|
exec \$this_script_dir/usr/bin/dot "\$@"
|
||||||
|
EOF
|
||||||
|
chmod +x dot
|
||||||
|
export LD_LIBRARY_PATH="$TMPDIR/graphviz/usr/lib64:$LD_LIBRARY_PATH"
|
||||||
|
# create config file
|
||||||
|
./dot -c
|
||||||
|
tar -cvzf ../$BUNDLE_NAME *
|
||||||
|
cp ../$BUNDLE_NAME "$ORIG_DIR"
|
Loading…
Reference in New Issue
Block a user