2009-04-10 10:31:12 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2008 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2016-07-26 07:03:53 +08:00
|
|
|
$(call record-module-type,DROIDDOC)
|
2009-04-10 10:31:12 +08:00
|
|
|
##
|
|
|
|
##
|
|
|
|
## Common to both droiddoc and javadoc
|
|
|
|
##
|
|
|
|
##
|
|
|
|
|
|
|
|
LOCAL_IS_HOST_MODULE := $(call true-or-empty,$(LOCAL_IS_HOST_MODULE))
|
|
|
|
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
2012-11-02 08:22:33 +08:00
|
|
|
my_prefix := HOST_
|
2015-08-15 03:59:50 +08:00
|
|
|
LOCAL_HOST_PREFIX :=
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
2012-11-02 08:22:33 +08:00
|
|
|
my_prefix := TARGET_
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
|
|
|
|
ifndef LOCAL_MODULE_CLASS
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_MODULE_CLASS not defined)
|
|
|
|
endif
|
|
|
|
|
|
|
|
full_src_files := $(patsubst %,$(LOCAL_PATH)/%,$(LOCAL_SRC_FILES))
|
|
|
|
out_dir := $(OUT_DOCS)/$(LOCAL_MODULE)
|
2009-04-10 10:31:12 +08:00
|
|
|
full_target := $(call doc-timestamp-for,$(LOCAL_MODULE))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
ifeq ($(LOCAL_DROIDDOC_SOURCE_PATH),)
|
|
|
|
LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR),)
|
2010-08-26 06:07:39 +08:00
|
|
|
LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := $(SRC_DROIDDOC_DIR)/$(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LOCAL_DROIDDOC_ASSET_DIR),)
|
|
|
|
LOCAL_DROIDDOC_ASSET_DIR := assets
|
|
|
|
endif
|
|
|
|
ifeq ($(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR),)
|
|
|
|
LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets
|
|
|
|
endif
|
|
|
|
|
2014-04-08 06:14:50 +08:00
|
|
|
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH :=
|
2014-07-08 07:43:49 +08:00
|
|
|
full_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,\
|
|
|
|
$(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES)))
|
|
|
|
|
2014-04-08 06:14:50 +08:00
|
|
|
else
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-04-03 09:21:36 +08:00
|
|
|
ifneq ($(LOCAL_SDK_VERSION),)
|
2012-05-11 08:25:51 +08:00
|
|
|
ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
|
|
|
|
# Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
|
2012-04-03 09:21:36 +08:00
|
|
|
LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES)
|
2014-04-08 06:14:50 +08:00
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_stubs_current)
|
2014-07-20 08:00:50 +08:00
|
|
|
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
|
|
|
|
LOCAL_JAVA_LIBRARIES := android_system_stubs_current $(LOCAL_JAVA_LIBRARIES)
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_system_stubs_current)
|
2015-11-06 23:20:51 +08:00
|
|
|
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current)
|
|
|
|
LOCAL_JAVA_LIBRARIES := android_test_stubs_current $(LOCAL_JAVA_LIBRARIES)
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_test_stubs_current)
|
2018-01-30 23:14:55 +08:00
|
|
|
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),core_current)
|
|
|
|
LOCAL_JAVA_LIBRARIES := core.current.stubs $(LOCAL_JAVA_LIBRARIES)
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, core.current.stubs)
|
2012-04-03 09:21:36 +08:00
|
|
|
else
|
2018-02-01 16:17:01 +08:00
|
|
|
# core_<ver> is subset of <ver>. Instead of defining a prebuilt lib for core_<ver>,
|
|
|
|
# use the stub for <ver> when building for apps.
|
|
|
|
_version := $(patsubst core_%,%,$(LOCAL_SDK_VERSION))
|
|
|
|
LOCAL_JAVA_LIBRARIES := sdk_v$(_version) $(LOCAL_JAVA_LIBRARIES)
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(_version))
|
|
|
|
_version :=
|
2012-04-03 09:21:36 +08:00
|
|
|
endif
|
|
|
|
else
|
2018-02-14 20:16:15 +08:00
|
|
|
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
|
|
|
LOCAL_JAVA_LIBRARIES := core-oj core-libart
|
|
|
|
else
|
|
|
|
LOCAL_JAVA_LIBRARIES := core-oj core-libart ext framework $(LOCAL_JAVA_LIBRARIES)
|
|
|
|
endif
|
2015-02-18 00:55:52 +08:00
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, core-oj):$(call java-lib-files, core-libart)
|
2012-04-03 09:21:36 +08:00
|
|
|
endif # LOCAL_SDK_VERSION
|
|
|
|
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
|
|
|
|
|
2014-07-08 07:43:49 +08:00
|
|
|
full_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES)) $(LOCAL_CLASSPATH)
|
2013-06-26 03:34:11 +08:00
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2017-07-21 02:06:59 +08:00
|
|
|
$(full_target): PRIVATE_CLASSPATH := $(call normalize-path-list,$(full_java_libs))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2011-05-18 05:48:10 +08:00
|
|
|
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
|
2009-04-10 10:31:12 +08:00
|
|
|
|
|
|
|
$(full_target): PRIVATE_SOURCE_PATH := $(call normalize-path-list,$(LOCAL_DROIDDOC_SOURCE_PATH))
|
2009-03-04 11:28:42 +08:00
|
|
|
$(full_target): PRIVATE_JAVA_FILES := $(filter %.java,$(full_src_files))
|
|
|
|
$(full_target): PRIVATE_JAVA_FILES += $(addprefix $($(my_prefix)OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES)))
|
2017-12-05 05:48:18 +08:00
|
|
|
$(full_target): PRIVATE_JAVA_FILES += $(filter %.java,$(LOCAL_GENERATED_SOURCES))
|
2017-11-16 13:33:10 +08:00
|
|
|
$(full_target): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)
|
2011-05-18 05:48:10 +08:00
|
|
|
$(full_target): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/src
|
2017-11-16 13:33:10 +08:00
|
|
|
$(full_target): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars
|
2011-05-18 05:48:10 +08:00
|
|
|
$(full_target): PRIVATE_SRC_LIST_FILE := $(intermediates.COMMON)/droiddoc-src-list
|
2017-11-16 13:33:10 +08:00
|
|
|
$(full_target): PRIVATE_SRCJAR_LIST_FILE := $(intermediates.COMMON)/droiddoc-srcjar-list
|
2009-04-10 10:31:12 +08:00
|
|
|
|
|
|
|
ifneq ($(strip $(LOCAL_ADDITIONAL_JAVA_DIR)),)
|
|
|
|
$(full_target): PRIVATE_ADDITIONAL_JAVA_DIR := $(LOCAL_ADDITIONAL_JAVA_DIR)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
$(full_target): PRIVATE_OUT_DIR := $(out_dir)
|
|
|
|
$(full_target): PRIVATE_DROIDDOC_OPTIONS := $(LOCAL_DROIDDOC_OPTIONS)
|
2015-07-17 05:21:37 +08:00
|
|
|
$(full_target): PRIVATE_STUB_OUT_DIR := $(LOCAL_DROIDDOC_STUB_OUT_DIR)
|
2009-04-10 10:31:12 +08:00
|
|
|
|
|
|
|
# Lists the input files for the doc build into a text file
|
|
|
|
# suitable for the @ syntax of javadoc.
|
|
|
|
# $(1): the file to create
|
|
|
|
# $(2): files to include
|
|
|
|
# $(3): list of directories to search for java files in
|
|
|
|
define prepare-doc-source-list
|
|
|
|
$(hide) mkdir -p $(dir $(1))
|
|
|
|
$(call dump-words-to-file, $(2), $(1))
|
2015-08-05 03:44:38 +08:00
|
|
|
$(hide) for d in $(3) ; do find $$d -name '*.java' -and -not -name '.*' >> $(1) 2> /dev/null ; done ; true
|
2009-04-10 10:31:12 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
ifeq (a,b)
|
|
|
|
$(full_target): PRIVATE_PROFILING_OPTIONS := \
|
|
|
|
-J-agentlib:jprofilerti=port=8849 -J-Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifneq ($(strip $(LOCAL_DROIDDOC_USE_STANDARD_DOCLET)),true)
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## droiddoc only
|
|
|
|
##
|
|
|
|
##
|
|
|
|
|
|
|
|
droiddoc_templates := \
|
2017-06-13 08:52:07 +08:00
|
|
|
$(sort $(shell find $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) -type f $(if $(ALLOW_MISSING_DEPENDENCIES),2>/dev/null)))
|
|
|
|
|
|
|
|
ifdef ALLOW_MISSING_DEPENDENCIES
|
|
|
|
ifndef droiddoc_templates
|
|
|
|
droiddoc_templates := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR)
|
|
|
|
endif
|
|
|
|
endif
|
2009-04-10 10:31:12 +08:00
|
|
|
|
|
|
|
droiddoc := \
|
|
|
|
$(HOST_JDK_TOOLS_JAR) \
|
2010-08-06 06:42:37 +08:00
|
|
|
$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
|
2009-04-10 10:31:12 +08:00
|
|
|
|
2010-08-06 06:42:37 +08:00
|
|
|
$(full_target): PRIVATE_DOCLETPATH := $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
|
2015-07-17 08:15:19 +08:00
|
|
|
$(full_target): PRIVATE_CURRENT_BUILD := -hdf page.build $(BUILD_ID)-$(BUILD_NUMBER_FROM_FILE)
|
2015-08-12 06:25:12 +08:00
|
|
|
$(full_target): PRIVATE_CURRENT_TIME := -hdf page.now "$$($(DATE_FROM_FILE) "+%d %b %Y %k:%M")"
|
2009-03-04 11:28:42 +08:00
|
|
|
$(full_target): PRIVATE_CUSTOM_TEMPLATE_DIR := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR)
|
|
|
|
$(full_target): PRIVATE_IN_CUSTOM_ASSET_DIR := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR)/$(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR)
|
|
|
|
$(full_target): PRIVATE_OUT_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_ASSET_DIR)
|
|
|
|
$(full_target): PRIVATE_OUT_CUSTOM_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR)
|
2014-04-17 02:25:31 +08:00
|
|
|
|
|
|
|
html_dir_files :=
|
2009-03-04 11:28:42 +08:00
|
|
|
ifneq ($(strip $(LOCAL_DROIDDOC_HTML_DIR)),)
|
2010-08-28 00:58:29 +08:00
|
|
|
$(full_target): PRIVATE_DROIDDOC_HTML_DIR := -htmldir $(LOCAL_PATH)/$(LOCAL_DROIDDOC_HTML_DIR)
|
2015-09-30 07:30:21 +08:00
|
|
|
html_dir_files := $(sort $(shell find $(LOCAL_PATH)/$(LOCAL_DROIDDOC_HTML_DIR) -type f))
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
2014-04-17 02:25:31 +08:00
|
|
|
$(full_target): PRIVATE_DROIDDOC_HTML_DIR :=
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
2013-01-29 10:57:30 +08:00
|
|
|
ifneq ($(strip $(LOCAL_ADDITIONAL_HTML_DIR)),)
|
|
|
|
$(full_target): PRIVATE_ADDITIONAL_HTML_DIR := -htmldir2 $(LOCAL_PATH)/$(LOCAL_ADDITIONAL_HTML_DIR)
|
|
|
|
else
|
|
|
|
$(full_target): PRIVATE_ADDITIONAL_HTML_DIR :=
|
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2009-04-10 10:31:12 +08:00
|
|
|
# TODO: not clear if this is used any more
|
|
|
|
$(full_target): PRIVATE_LOCAL_PATH := $(LOCAL_PATH)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
Make 'make docs' work on OpenJDK 9 toolchain.
OpenJDK 9's javadoc tool doesn't support the -bootclasspath
command line option, even with -source 1.8.
Instead, under OpenJDK 9, javadoc needs to be passed a
--patch-module argument to tell it the location of the
classes patching packages from java.* modules.
The source files in libcore/{dalvik,libart,luni,ojluni} and
external/icu/android_icu4j that go into PRIVATE_BOOTCLASSPATH
patch packages from the modules java.base, java.desktop,
java.logging, java.prefs, java.sql, jdk.net, and
jdk.unsupported. However, this CL takes the simpler approach
of placing them all in java.base, which appears to work for
the purposes of the javadoc run.
Test: Ran the following both on OpenJDK 8 toolchain and on
OpenJDK 9 (with EXPERIMENTAL_USE_OPENJDK9=true):
rm -rf out/target/common/docs/ && make docs
Test: Compared (via meld) the contents of out/target/common/docs
for the two toolchains (there were some differences, see bug).
Bug: 62049770
Change-Id: If3dd927477ca32dab7ffb528350de872e1017184
2017-07-05 18:44:45 +08:00
|
|
|
# TODO(tobiast): Clean this up once we move to -source 1.9.
|
|
|
|
# OpenJDK 9 does not have the concept of a "boot classpath" so we should
|
|
|
|
# then rename PRIVATE_BOOTCLASSPATH to PRIVATE_MODULE or similar. For now,
|
|
|
|
# keep -bootclasspath here since it works in combination with -source 1.8.
|
2014-11-09 14:20:03 +08:00
|
|
|
$(full_target): \
|
|
|
|
$(full_src_files) \
|
2017-12-05 05:48:18 +08:00
|
|
|
$(LOCAL_GENERATED_SOURCES) \
|
2014-11-09 14:20:03 +08:00
|
|
|
$(droiddoc_templates) \
|
|
|
|
$(droiddoc) \
|
|
|
|
$(html_dir_files) \
|
2017-09-14 04:13:53 +08:00
|
|
|
$(full_java_libs) \
|
2017-11-16 13:33:10 +08:00
|
|
|
$(EXTRACT_SRCJARS) \
|
|
|
|
$(LOCAL_SRCJARS) \
|
2014-11-09 14:20:03 +08:00
|
|
|
$(LOCAL_ADDITIONAL_DEPENDENCIES)
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo Docs droiddoc: $(PRIVATE_OUT_DIR)
|
2013-02-23 01:59:17 +08:00
|
|
|
$(hide) mkdir -p $(dir $@)
|
2017-11-16 13:33:10 +08:00
|
|
|
$(hide) rm -rf $(PRIVATE_STUB_OUT_DIR) $(PRIVATE_SRCJAR_INTERMEDIATES_DIR)
|
2009-04-10 10:31:12 +08:00
|
|
|
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
|
|
|
|
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
|
2017-11-16 13:33:10 +08:00
|
|
|
$(EXTRACT_SRCJARS) $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) $(PRIVATE_SRCJAR_LIST_FILE) $(PRIVATE_SRCJARS)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(hide) ( \
|
2017-07-01 04:55:38 +08:00
|
|
|
$(JAVADOC) \
|
2013-12-11 03:29:25 +08:00
|
|
|
-encoding UTF-8 \
|
2017-05-18 00:37:42 +08:00
|
|
|
-source 1.8 \
|
2009-03-04 11:28:42 +08:00
|
|
|
\@$(PRIVATE_SRC_LIST_FILE) \
|
2017-11-16 13:33:10 +08:00
|
|
|
\@$(PRIVATE_SRCJAR_LIST_FILE) \
|
2015-11-20 10:31:01 +08:00
|
|
|
-J-Xmx1600m \
|
2017-05-10 01:44:30 +08:00
|
|
|
-J-XX:-OmitStackTraceInFastThrow \
|
2014-04-08 06:19:33 +08:00
|
|
|
-XDignore.symbol.file \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(PRIVATE_PROFILING_OPTIONS) \
|
|
|
|
-quiet \
|
2010-08-06 06:42:37 +08:00
|
|
|
-doclet com.google.doclava.Doclava \
|
2009-03-04 11:28:42 +08:00
|
|
|
-docletpath $(PRIVATE_DOCLETPATH) \
|
|
|
|
-templatedir $(PRIVATE_CUSTOM_TEMPLATE_DIR) \
|
|
|
|
$(PRIVATE_DROIDDOC_HTML_DIR) \
|
2013-01-29 10:57:30 +08:00
|
|
|
$(PRIVATE_ADDITIONAL_HTML_DIR) \
|
2010-06-24 11:59:22 +08:00
|
|
|
$(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
|
|
|
|
-sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \
|
|
|
|
-d $(PRIVATE_OUT_DIR) \
|
|
|
|
$(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) \
|
|
|
|
$(PRIVATE_DROIDDOC_OPTIONS) \
|
2015-07-17 05:21:37 +08:00
|
|
|
$(addprefix -stubs ,$(PRIVATE_STUB_OUT_DIR)) \
|
2009-03-04 11:28:42 +08:00
|
|
|
&& touch -f $@ \
|
|
|
|
) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
|
|
|
|
|
2009-04-10 10:31:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## standard doclet only
|
|
|
|
##
|
|
|
|
##
|
Make 'make docs' work on OpenJDK 9 toolchain.
OpenJDK 9's javadoc tool doesn't support the -bootclasspath
command line option, even with -source 1.8.
Instead, under OpenJDK 9, javadoc needs to be passed a
--patch-module argument to tell it the location of the
classes patching packages from java.* modules.
The source files in libcore/{dalvik,libart,luni,ojluni} and
external/icu/android_icu4j that go into PRIVATE_BOOTCLASSPATH
patch packages from the modules java.base, java.desktop,
java.logging, java.prefs, java.sql, jdk.net, and
jdk.unsupported. However, this CL takes the simpler approach
of placing them all in java.base, which appears to work for
the purposes of the javadoc run.
Test: Ran the following both on OpenJDK 8 toolchain and on
OpenJDK 9 (with EXPERIMENTAL_USE_OPENJDK9=true):
rm -rf out/target/common/docs/ && make docs
Test: Compared (via meld) the contents of out/target/common/docs
for the two toolchains (there were some differences, see bug).
Bug: 62049770
Change-Id: If3dd927477ca32dab7ffb528350de872e1017184
2017-07-05 18:44:45 +08:00
|
|
|
|
2017-11-16 04:55:03 +08:00
|
|
|
ifdef USE_OPENJDK9
|
Make 'make docs' work on OpenJDK 9 toolchain.
OpenJDK 9's javadoc tool doesn't support the -bootclasspath
command line option, even with -source 1.8.
Instead, under OpenJDK 9, javadoc needs to be passed a
--patch-module argument to tell it the location of the
classes patching packages from java.* modules.
The source files in libcore/{dalvik,libart,luni,ojluni} and
external/icu/android_icu4j that go into PRIVATE_BOOTCLASSPATH
patch packages from the modules java.base, java.desktop,
java.logging, java.prefs, java.sql, jdk.net, and
jdk.unsupported. However, this CL takes the simpler approach
of placing them all in java.base, which appears to work for
the purposes of the javadoc run.
Test: Ran the following both on OpenJDK 8 toolchain and on
OpenJDK 9 (with EXPERIMENTAL_USE_OPENJDK9=true):
rm -rf out/target/common/docs/ && make docs
Test: Compared (via meld) the contents of out/target/common/docs
for the two toolchains (there were some differences, see bug).
Bug: 62049770
Change-Id: If3dd927477ca32dab7ffb528350de872e1017184
2017-07-05 18:44:45 +08:00
|
|
|
# For OpenJDK 9 we use --patch-module to define the core libraries code.
|
|
|
|
# TODO(tobiast): Reorganize this when adding proper support for OpenJDK 9
|
|
|
|
# modules. Here we treat all code in core libraries as being in java.base
|
|
|
|
# to work around the OpenJDK 9 module system. http://b/62049770
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH_ARG := --patch-module=java.base=$(PRIVATE_BOOTCLASSPATH)
|
|
|
|
else
|
|
|
|
# For OpenJDK 8 we can use -bootclasspath to define the core libraries code.
|
|
|
|
$(full_target): PRIVATE_BOOTCLASSPATH_ARG := $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH))
|
|
|
|
endif
|
2017-12-05 05:48:18 +08:00
|
|
|
$(full_target): $(full_src_files) $(LOCAL_GENERATED_SOURCES) $(full_java_libs) $(EXTRACT_SRCJARS) $(LOCAL_SRCJARS) $(LOCAL_ADDITIONAL_DEPENDENCIES)
|
2009-04-10 10:31:12 +08:00
|
|
|
@echo Docs javadoc: $(PRIVATE_OUT_DIR)
|
2013-02-23 01:59:17 +08:00
|
|
|
@mkdir -p $(dir $@)
|
2017-11-16 13:33:10 +08:00
|
|
|
rm -rf $(PRIVATE_SRCJAR_INTERMEDIATES_DIR)
|
2009-04-10 10:31:12 +08:00
|
|
|
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
|
|
|
|
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
|
2017-11-16 13:33:10 +08:00
|
|
|
$(EXTRACT_SRCJARS) $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) $(PRIVATE_SRCJAR_LIST_FILE) $(PRIVATE_SRCJARS)
|
2009-04-10 10:31:12 +08:00
|
|
|
$(hide) ( \
|
2017-07-01 04:55:38 +08:00
|
|
|
$(JAVADOC) \
|
2013-12-11 03:29:25 +08:00
|
|
|
-encoding UTF-8 \
|
2009-04-10 10:31:12 +08:00
|
|
|
$(PRIVATE_DROIDDOC_OPTIONS) \
|
|
|
|
\@$(PRIVATE_SRC_LIST_FILE) \
|
2017-11-16 13:33:10 +08:00
|
|
|
\@$(PRIVATE_SRCJAR_LIST_FILE) \
|
2010-06-19 04:18:05 +08:00
|
|
|
-J-Xmx1024m \
|
2014-04-08 06:19:33 +08:00
|
|
|
-XDignore.symbol.file \
|
2017-05-23 21:16:59 +08:00
|
|
|
-Xdoclint:none \
|
2009-04-10 10:31:12 +08:00
|
|
|
$(PRIVATE_PROFILING_OPTIONS) \
|
|
|
|
$(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
|
Make 'make docs' work on OpenJDK 9 toolchain.
OpenJDK 9's javadoc tool doesn't support the -bootclasspath
command line option, even with -source 1.8.
Instead, under OpenJDK 9, javadoc needs to be passed a
--patch-module argument to tell it the location of the
classes patching packages from java.* modules.
The source files in libcore/{dalvik,libart,luni,ojluni} and
external/icu/android_icu4j that go into PRIVATE_BOOTCLASSPATH
patch packages from the modules java.base, java.desktop,
java.logging, java.prefs, java.sql, jdk.net, and
jdk.unsupported. However, this CL takes the simpler approach
of placing them all in java.base, which appears to work for
the purposes of the javadoc run.
Test: Ran the following both on OpenJDK 8 toolchain and on
OpenJDK 9 (with EXPERIMENTAL_USE_OPENJDK9=true):
rm -rf out/target/common/docs/ && make docs
Test: Compared (via meld) the contents of out/target/common/docs
for the two toolchains (there were some differences, see bug).
Bug: 62049770
Change-Id: If3dd927477ca32dab7ffb528350de872e1017184
2017-07-05 18:44:45 +08:00
|
|
|
$(PRIVATE_BOOTCLASSPATH_ARG) \
|
2009-04-10 10:31:12 +08:00
|
|
|
-sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \
|
|
|
|
-d $(PRIVATE_OUT_DIR) \
|
|
|
|
-quiet \
|
|
|
|
&& touch -f $@ \
|
|
|
|
) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)
|
|
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## Common to both droiddoc and javadoc
|
|
|
|
##
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
ALL_DOCS += $(full_target)
|
|
|
|
|
|
|
|
.PHONY: $(LOCAL_MODULE)-docs
|
|
|
|
$(LOCAL_MODULE)-docs : $(full_target)
|
|
|
|
|
2010-09-02 01:39:50 +08:00
|
|
|
ifeq ($(strip $(LOCAL_UNINSTALLABLE_MODULE)),)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Define a rule to create a zip of these docs.
|
|
|
|
out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
|
|
|
|
$(out_zip): PRIVATE_DOCS_DIR := $(out_dir)
|
2015-11-05 02:06:25 +08:00
|
|
|
$(out_zip): $(full_target)
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo Package docs: $@
|
|
|
|
@rm -f $@
|
|
|
|
@mkdir -p $(dir $@)
|
2015-10-30 07:33:05 +08:00
|
|
|
$(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_DOCS_DIR) && zip -rqX $$F * )
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2013-12-04 18:31:18 +08:00
|
|
|
$(LOCAL_MODULE)-docs.zip : $(out_zip)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
$(call dist-for-goals,docs,$(out_zip))
|
2010-09-02 01:39:50 +08:00
|
|
|
|
|
|
|
endif
|