Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2008 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 16 | |
Dan Willemsen | 1684b32 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 17 | $(call record-module-type,DROIDDOC) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 18 | ## |
| 19 | ## |
| 20 | ## Common to both droiddoc and javadoc |
| 21 | ## |
| 22 | ## |
| 23 | |
| 24 | LOCAL_IS_HOST_MODULE := $(call true-or-empty,$(LOCAL_IS_HOST_MODULE)) |
| 25 | ifeq ($(LOCAL_IS_HOST_MODULE),true) |
Ying Wang | 13d6950 | 2012-11-01 17:22:33 -0700 | [diff] [blame] | 26 | my_prefix := HOST_ |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 27 | LOCAL_HOST_PREFIX := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 28 | else |
Ying Wang | 13d6950 | 2012-11-01 17:22:33 -0700 | [diff] [blame] | 29 | my_prefix := TARGET_ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 30 | endif |
| 31 | |
| 32 | LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS)) |
| 33 | ifndef LOCAL_MODULE_CLASS |
| 34 | $(error $(LOCAL_PATH): LOCAL_MODULE_CLASS not defined) |
| 35 | endif |
| 36 | |
| 37 | full_src_files := $(patsubst %,$(LOCAL_PATH)/%,$(LOCAL_SRC_FILES)) |
| 38 | out_dir := $(OUT_DOCS)/$(LOCAL_MODULE) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 39 | full_target := $(call doc-timestamp-for,$(LOCAL_MODULE)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 40 | |
| 41 | ifeq ($(LOCAL_DROIDDOC_SOURCE_PATH),) |
| 42 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH) |
| 43 | endif |
| 44 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 45 | ifeq ($(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR),) |
Dirk Dougherty | d77248a | 2010-08-25 15:07:39 -0700 | [diff] [blame] | 46 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := $(SRC_DROIDDOC_DIR)/$(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 47 | endif |
| 48 | |
| 49 | ifeq ($(LOCAL_DROIDDOC_ASSET_DIR),) |
| 50 | LOCAL_DROIDDOC_ASSET_DIR := assets |
| 51 | endif |
| 52 | ifeq ($(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR),) |
| 53 | LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets |
| 54 | endif |
| 55 | |
Ying Wang | 584d8ad | 2014-04-07 15:14:50 -0700 | [diff] [blame] | 56 | ifeq ($(LOCAL_IS_HOST_MODULE),true) |
| 57 | $(full_target): PRIVATE_BOOTCLASSPATH := |
Ying Wang | ad7809b | 2014-07-07 16:43:49 -0700 | [diff] [blame] | 58 | full_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,\ |
| 59 | $(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES))) |
Ying Wang | ad7809b | 2014-07-07 16:43:49 -0700 | [diff] [blame] | 60 | |
Ying Wang | 584d8ad | 2014-04-07 15:14:50 -0700 | [diff] [blame] | 61 | else |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 62 | |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 63 | ifneq ($(LOCAL_SDK_VERSION),) |
Ying Wang | 0ec188f | 2012-05-10 17:25:51 -0700 | [diff] [blame] | 64 | ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current) |
| 65 | # Use android_stubs_current if LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS. |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 66 | LOCAL_JAVA_LIBRARIES := android_stubs_current $(LOCAL_JAVA_LIBRARIES) |
Ying Wang | 584d8ad | 2014-04-07 15:14:50 -0700 | [diff] [blame] | 67 | $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_stubs_current) |
Ying Wang | efb9358 | 2014-07-19 17:00:50 -0700 | [diff] [blame] | 68 | else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current) |
| 69 | LOCAL_JAVA_LIBRARIES := android_system_stubs_current $(LOCAL_JAVA_LIBRARIES) |
| 70 | $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_system_stubs_current) |
Michael Wright | 0fb087f | 2015-11-06 15:20:51 +0000 | [diff] [blame] | 71 | else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),test_current) |
| 72 | LOCAL_JAVA_LIBRARIES := android_test_stubs_current $(LOCAL_JAVA_LIBRARIES) |
| 73 | $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, android_test_stubs_current) |
Jiyong Park | 5ebca30 | 2018-01-31 00:14:55 +0900 | [diff] [blame] | 74 | else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),core_current) |
| 75 | LOCAL_JAVA_LIBRARIES := core.current.stubs $(LOCAL_JAVA_LIBRARIES) |
| 76 | $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, core.current.stubs) |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 77 | else |
Sundong Ahn | 7a02001 | 2018-02-01 17:17:01 +0900 | [diff] [blame] | 78 | # core_<ver> is subset of <ver>. Instead of defining a prebuilt lib for core_<ver>, |
| 79 | # use the stub for <ver> when building for apps. |
| 80 | _version := $(patsubst core_%,%,$(LOCAL_SDK_VERSION)) |
| 81 | LOCAL_JAVA_LIBRARIES := sdk_v$(_version) $(LOCAL_JAVA_LIBRARIES) |
| 82 | $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, sdk_v$(_version)) |
| 83 | _version := |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 84 | endif |
| 85 | else |
Jiyong Park | 889773f | 2018-02-14 21:16:15 +0900 | [diff] [blame] | 86 | ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true) |
| 87 | LOCAL_JAVA_LIBRARIES := core-oj core-libart |
| 88 | else |
| 89 | LOCAL_JAVA_LIBRARIES := core-oj core-libart ext framework $(LOCAL_JAVA_LIBRARIES) |
| 90 | endif |
Piotr Jastrzebski | 89b94c8 | 2015-02-17 16:55:52 +0000 | [diff] [blame] | 91 | $(full_target): PRIVATE_BOOTCLASSPATH := $(call java-lib-files, core-oj):$(call java-lib-files, core-libart) |
Ying Wang | 3f45b3c | 2012-04-02 18:21:36 -0700 | [diff] [blame] | 92 | endif # LOCAL_SDK_VERSION |
| 93 | LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES)) |
| 94 | |
Ying Wang | ad7809b | 2014-07-07 16:43:49 -0700 | [diff] [blame] | 95 | full_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES)) $(LOCAL_CLASSPATH) |
Ying Wang | 8578cab | 2013-06-25 12:34:11 -0700 | [diff] [blame] | 96 | endif # !LOCAL_IS_HOST_MODULE |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 97 | |
Tobias Thierer | 75ebdd6 | 2017-07-20 19:06:59 +0100 | [diff] [blame] | 98 | $(full_target): PRIVATE_CLASSPATH := $(call normalize-path-list,$(full_java_libs)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 99 | |
Ying Wang | fb79087 | 2011-05-17 14:48:10 -0700 | [diff] [blame] | 100 | intermediates.COMMON := $(call local-intermediates-dir,COMMON) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 101 | |
| 102 | $(full_target): PRIVATE_SOURCE_PATH := $(call normalize-path-list,$(LOCAL_DROIDDOC_SOURCE_PATH)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 103 | $(full_target): PRIVATE_JAVA_FILES := $(filter %.java,$(full_src_files)) |
| 104 | $(full_target): PRIVATE_JAVA_FILES += $(addprefix $($(my_prefix)OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES))) |
Colin Cross | eb1012b | 2017-12-04 13:48:18 -0800 | [diff] [blame] | 105 | $(full_target): PRIVATE_JAVA_FILES += $(filter %.java,$(LOCAL_GENERATED_SOURCES)) |
Colin Cross | e89df93 | 2017-11-15 21:33:10 -0800 | [diff] [blame] | 106 | $(full_target): PRIVATE_SRCJARS := $(LOCAL_SRCJARS) |
Ying Wang | fb79087 | 2011-05-17 14:48:10 -0700 | [diff] [blame] | 107 | $(full_target): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/src |
Colin Cross | e89df93 | 2017-11-15 21:33:10 -0800 | [diff] [blame] | 108 | $(full_target): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars |
Ying Wang | fb79087 | 2011-05-17 14:48:10 -0700 | [diff] [blame] | 109 | $(full_target): PRIVATE_SRC_LIST_FILE := $(intermediates.COMMON)/droiddoc-src-list |
Colin Cross | e89df93 | 2017-11-15 21:33:10 -0800 | [diff] [blame] | 110 | $(full_target): PRIVATE_SRCJAR_LIST_FILE := $(intermediates.COMMON)/droiddoc-srcjar-list |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 111 | |
| 112 | ifneq ($(strip $(LOCAL_ADDITIONAL_JAVA_DIR)),) |
| 113 | $(full_target): PRIVATE_ADDITIONAL_JAVA_DIR := $(LOCAL_ADDITIONAL_JAVA_DIR) |
| 114 | endif |
| 115 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 116 | $(full_target): PRIVATE_OUT_DIR := $(out_dir) |
| 117 | $(full_target): PRIVATE_DROIDDOC_OPTIONS := $(LOCAL_DROIDDOC_OPTIONS) |
Ying Wang | 5adfc3e | 2015-07-16 14:21:37 -0700 | [diff] [blame] | 118 | $(full_target): PRIVATE_STUB_OUT_DIR := $(LOCAL_DROIDDOC_STUB_OUT_DIR) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 119 | |
| 120 | # Lists the input files for the doc build into a text file |
| 121 | # suitable for the @ syntax of javadoc. |
| 122 | # $(1): the file to create |
| 123 | # $(2): files to include |
| 124 | # $(3): list of directories to search for java files in |
| 125 | define prepare-doc-source-list |
| 126 | $(hide) mkdir -p $(dir $(1)) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 127 | $(call dump-words-to-file, $(2), $(1)) |
Ying Wang | 4aedea9 | 2015-08-04 12:44:38 -0700 | [diff] [blame] | 128 | $(hide) for d in $(3) ; do find $$d -name '*.java' -and -not -name '.*' >> $(1) 2> /dev/null ; done ; true |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 129 | endef |
| 130 | |
| 131 | ifeq (a,b) |
| 132 | $(full_target): PRIVATE_PROFILING_OPTIONS := \ |
| 133 | -J-agentlib:jprofilerti=port=8849 -J-Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar |
| 134 | endif |
| 135 | |
| 136 | |
| 137 | ifneq ($(strip $(LOCAL_DROIDDOC_USE_STANDARD_DOCLET)),true) |
| 138 | ## |
| 139 | ## |
| 140 | ## droiddoc only |
| 141 | ## |
| 142 | ## |
| 143 | |
| 144 | droiddoc_templates := \ |
Dan Willemsen | 6402873 | 2017-06-12 17:52:07 -0700 | [diff] [blame] | 145 | $(sort $(shell find $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) -type f $(if $(ALLOW_MISSING_DEPENDENCIES),2>/dev/null))) |
| 146 | |
| 147 | ifdef ALLOW_MISSING_DEPENDENCIES |
| 148 | ifndef droiddoc_templates |
| 149 | droiddoc_templates := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) |
| 150 | endif |
| 151 | endif |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 152 | |
| 153 | droiddoc := \ |
| 154 | $(HOST_JDK_TOOLS_JAR) \ |
Ben Dodson | 1034455 | 2010-08-05 15:42:37 -0700 | [diff] [blame] | 155 | $(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 156 | |
Ben Dodson | 1034455 | 2010-08-05 15:42:37 -0700 | [diff] [blame] | 157 | $(full_target): PRIVATE_DOCLETPATH := $(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX) |
Colin Cross | f37b455 | 2015-07-16 17:15:19 -0700 | [diff] [blame] | 158 | $(full_target): PRIVATE_CURRENT_BUILD := -hdf page.build $(BUILD_ID)-$(BUILD_NUMBER_FROM_FILE) |
Dan Willemsen | ccc933e | 2015-08-11 15:25:12 -0700 | [diff] [blame] | 159 | $(full_target): PRIVATE_CURRENT_TIME := -hdf page.now "$$($(DATE_FROM_FILE) "+%d %b %Y %k:%M")" |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 160 | $(full_target): PRIVATE_CUSTOM_TEMPLATE_DIR := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 161 | $(full_target): PRIVATE_IN_CUSTOM_ASSET_DIR := $(LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR)/$(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR) |
| 162 | $(full_target): PRIVATE_OUT_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_ASSET_DIR) |
| 163 | $(full_target): PRIVATE_OUT_CUSTOM_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR) |
Ying Wang | 3bb5d8b | 2014-04-16 11:25:31 -0700 | [diff] [blame] | 164 | |
| 165 | html_dir_files := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 166 | ifneq ($(strip $(LOCAL_DROIDDOC_HTML_DIR)),) |
Bill Napier | 9a0e98a | 2010-08-27 09:58:29 -0700 | [diff] [blame] | 167 | $(full_target): PRIVATE_DROIDDOC_HTML_DIR := -htmldir $(LOCAL_PATH)/$(LOCAL_DROIDDOC_HTML_DIR) |
Dan Willemsen | 7c3e3f8 | 2015-09-29 16:30:21 -0700 | [diff] [blame] | 168 | html_dir_files := $(sort $(shell find $(LOCAL_PATH)/$(LOCAL_DROIDDOC_HTML_DIR) -type f)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 169 | else |
Ying Wang | 3bb5d8b | 2014-04-16 11:25:31 -0700 | [diff] [blame] | 170 | $(full_target): PRIVATE_DROIDDOC_HTML_DIR := |
Dirk Dougherty | 1151ef4 | 2013-02-05 16:45:05 -0800 | [diff] [blame] | 171 | endif |
| 172 | ifneq ($(strip $(LOCAL_ADDITIONAL_HTML_DIR)),) |
| 173 | $(full_target): PRIVATE_ADDITIONAL_HTML_DIR := -htmldir2 $(LOCAL_PATH)/$(LOCAL_ADDITIONAL_HTML_DIR) |
Dirk Dougherty | 9c2336e | 2013-01-28 18:57:30 -0800 | [diff] [blame] | 174 | else |
| 175 | $(full_target): PRIVATE_ADDITIONAL_HTML_DIR := |
| 176 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 177 | |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 178 | # TODO: not clear if this is used any more |
| 179 | $(full_target): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 180 | |
Tobias Thierer | 0b05860 | 2017-07-05 11:44:45 +0100 | [diff] [blame] | 181 | # TODO(tobiast): Clean this up once we move to -source 1.9. |
| 182 | # OpenJDK 9 does not have the concept of a "boot classpath" so we should |
| 183 | # then rename PRIVATE_BOOTCLASSPATH to PRIVATE_MODULE or similar. For now, |
| 184 | # keep -bootclasspath here since it works in combination with -source 1.8. |
Dan Albert | 954b5bd | 2014-11-08 22:20:03 -0800 | [diff] [blame] | 185 | $(full_target): \ |
| 186 | $(full_src_files) \ |
Colin Cross | eb1012b | 2017-12-04 13:48:18 -0800 | [diff] [blame] | 187 | $(LOCAL_GENERATED_SOURCES) \ |
Dan Albert | 954b5bd | 2014-11-08 22:20:03 -0800 | [diff] [blame] | 188 | $(droiddoc_templates) \ |
| 189 | $(droiddoc) \ |
| 190 | $(html_dir_files) \ |
Nan Zhang | 9bd5405 | 2017-09-13 13:13:53 -0700 | [diff] [blame] | 191 | $(full_java_libs) \ |
Colin Cross | 3f99cd5 | 2018-03-15 16:26:08 -0700 | [diff] [blame^] | 192 | $(ZIPSYNC) \ |
Colin Cross | e89df93 | 2017-11-15 21:33:10 -0800 | [diff] [blame] | 193 | $(LOCAL_SRCJARS) \ |
Dan Albert | 954b5bd | 2014-11-08 22:20:03 -0800 | [diff] [blame] | 194 | $(LOCAL_ADDITIONAL_DEPENDENCIES) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 195 | @echo Docs droiddoc: $(PRIVATE_OUT_DIR) |
Ying Wang | b8a256a | 2013-02-22 09:59:17 -0800 | [diff] [blame] | 196 | $(hide) mkdir -p $(dir $@) |
Colin Cross | 3f99cd5 | 2018-03-15 16:26:08 -0700 | [diff] [blame^] | 197 | $(hide) rm -rf $(PRIVATE_STUB_OUT_DIR) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 198 | $(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \ |
| 199 | $(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR)) |
Colin Cross | 3f99cd5 | 2018-03-15 16:26:08 -0700 | [diff] [blame^] | 200 | $(ZIPSYNC) -d $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) -l $(PRIVATE_SRCJAR_LIST_FILE) -f "*.java" $(PRIVATE_SRCJARS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 201 | $(hide) ( \ |
Colin Cross | 0851df8 | 2017-06-30 13:55:38 -0700 | [diff] [blame] | 202 | $(JAVADOC) \ |
Ying Wang | 34e3e17 | 2013-12-10 11:29:25 -0800 | [diff] [blame] | 203 | -encoding UTF-8 \ |
Tobias Thierer | 0ed47f7 | 2017-05-17 17:37:42 +0100 | [diff] [blame] | 204 | -source 1.8 \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 205 | \@$(PRIVATE_SRC_LIST_FILE) \ |
Colin Cross | e89df93 | 2017-11-15 21:33:10 -0800 | [diff] [blame] | 206 | \@$(PRIVATE_SRCJAR_LIST_FILE) \ |
Ying Wang | 02bcb27 | 2015-11-19 18:31:01 -0800 | [diff] [blame] | 207 | -J-Xmx1600m \ |
Jeff Sharkey | cada716 | 2017-05-09 11:44:30 -0600 | [diff] [blame] | 208 | -J-XX:-OmitStackTraceInFastThrow \ |
Ying Wang | 5b6b464 | 2014-04-07 15:19:33 -0700 | [diff] [blame] | 209 | -XDignore.symbol.file \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 210 | $(PRIVATE_PROFILING_OPTIONS) \ |
| 211 | -quiet \ |
Ben Dodson | 1034455 | 2010-08-05 15:42:37 -0700 | [diff] [blame] | 212 | -doclet com.google.doclava.Doclava \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 213 | -docletpath $(PRIVATE_DOCLETPATH) \ |
| 214 | -templatedir $(PRIVATE_CUSTOM_TEMPLATE_DIR) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 215 | $(PRIVATE_DROIDDOC_HTML_DIR) \ |
Dirk Dougherty | 9c2336e | 2013-01-28 18:57:30 -0800 | [diff] [blame] | 216 | $(PRIVATE_ADDITIONAL_HTML_DIR) \ |
Ying Wang | 7b142da | 2010-06-23 20:59:22 -0700 | [diff] [blame] | 217 | $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 218 | $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \ |
| 219 | -sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \ |
| 220 | -d $(PRIVATE_OUT_DIR) \ |
| 221 | $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) \ |
| 222 | $(PRIVATE_DROIDDOC_OPTIONS) \ |
Ying Wang | 5adfc3e | 2015-07-16 14:21:37 -0700 | [diff] [blame] | 223 | $(addprefix -stubs ,$(PRIVATE_STUB_OUT_DIR)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 224 | && touch -f $@ \ |
| 225 | ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45) |
| 226 | |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 227 | |
| 228 | |
| 229 | else |
| 230 | ## |
| 231 | ## |
| 232 | ## standard doclet only |
| 233 | ## |
| 234 | ## |
Tobias Thierer | 0b05860 | 2017-07-05 11:44:45 +0100 | [diff] [blame] | 235 | |
Tobias Thierer | f6bd495 | 2017-11-15 20:55:03 +0000 | [diff] [blame] | 236 | ifdef USE_OPENJDK9 |
Tobias Thierer | 0b05860 | 2017-07-05 11:44:45 +0100 | [diff] [blame] | 237 | # For OpenJDK 9 we use --patch-module to define the core libraries code. |
| 238 | # TODO(tobiast): Reorganize this when adding proper support for OpenJDK 9 |
| 239 | # modules. Here we treat all code in core libraries as being in java.base |
| 240 | # to work around the OpenJDK 9 module system. http://b/62049770 |
| 241 | $(full_target): PRIVATE_BOOTCLASSPATH_ARG := --patch-module=java.base=$(PRIVATE_BOOTCLASSPATH) |
| 242 | else |
| 243 | # For OpenJDK 8 we can use -bootclasspath to define the core libraries code. |
| 244 | $(full_target): PRIVATE_BOOTCLASSPATH_ARG := $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) |
| 245 | endif |
Colin Cross | 3f99cd5 | 2018-03-15 16:26:08 -0700 | [diff] [blame^] | 246 | $(full_target): $(full_src_files) $(LOCAL_GENERATED_SOURCES) $(full_java_libs) $(ZIPSYNC) $(LOCAL_SRCJARS) $(LOCAL_ADDITIONAL_DEPENDENCIES) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 247 | @echo Docs javadoc: $(PRIVATE_OUT_DIR) |
Ying Wang | b8a256a | 2013-02-22 09:59:17 -0800 | [diff] [blame] | 248 | @mkdir -p $(dir $@) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 249 | $(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \ |
| 250 | $(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR)) |
Colin Cross | 3f99cd5 | 2018-03-15 16:26:08 -0700 | [diff] [blame^] | 251 | $(ZIPSYNC) -d $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) -l $(PRIVATE_SRCJAR_LIST_FILE) -f "*.java" $(PRIVATE_SRCJARS) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 252 | $(hide) ( \ |
Colin Cross | 0851df8 | 2017-06-30 13:55:38 -0700 | [diff] [blame] | 253 | $(JAVADOC) \ |
Ying Wang | 34e3e17 | 2013-12-10 11:29:25 -0800 | [diff] [blame] | 254 | -encoding UTF-8 \ |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 255 | $(PRIVATE_DROIDDOC_OPTIONS) \ |
| 256 | \@$(PRIVATE_SRC_LIST_FILE) \ |
Colin Cross | e89df93 | 2017-11-15 21:33:10 -0800 | [diff] [blame] | 257 | \@$(PRIVATE_SRCJAR_LIST_FILE) \ |
Ying Wang | 24de970 | 2010-06-18 13:18:05 -0700 | [diff] [blame] | 258 | -J-Xmx1024m \ |
Ying Wang | 5b6b464 | 2014-04-07 15:19:33 -0700 | [diff] [blame] | 259 | -XDignore.symbol.file \ |
Tobias Thierer | c61bd99 | 2017-05-23 14:16:59 +0100 | [diff] [blame] | 260 | -Xdoclint:none \ |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 261 | $(PRIVATE_PROFILING_OPTIONS) \ |
| 262 | $(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \ |
Tobias Thierer | 0b05860 | 2017-07-05 11:44:45 +0100 | [diff] [blame] | 263 | $(PRIVATE_BOOTCLASSPATH_ARG) \ |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 264 | -sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \ |
| 265 | -d $(PRIVATE_OUT_DIR) \ |
| 266 | -quiet \ |
| 267 | && touch -f $@ \ |
| 268 | ) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45) |
| 269 | |
| 270 | |
| 271 | endif |
| 272 | ## |
| 273 | ## |
| 274 | ## Common to both droiddoc and javadoc |
| 275 | ## |
| 276 | ## |
| 277 | |
| 278 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 279 | ALL_DOCS += $(full_target) |
| 280 | |
| 281 | .PHONY: $(LOCAL_MODULE)-docs |
| 282 | $(LOCAL_MODULE)-docs : $(full_target) |
| 283 | |
Joe Onorato | aaa5d11 | 2010-09-01 10:39:50 -0700 | [diff] [blame] | 284 | ifeq ($(strip $(LOCAL_UNINSTALLABLE_MODULE)),) |
| 285 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 286 | # Define a rule to create a zip of these docs. |
| 287 | out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip |
| 288 | $(out_zip): PRIVATE_DOCS_DIR := $(out_dir) |
Ying Wang | 5d88770 | 2015-11-04 10:06:25 -0800 | [diff] [blame] | 289 | $(out_zip): $(full_target) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 290 | @echo Package docs: $@ |
| 291 | @rm -f $@ |
| 292 | @mkdir -p $(dir $@) |
Dan Willemsen | 48a621c | 2015-10-29 16:33:05 -0700 | [diff] [blame] | 293 | $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_DOCS_DIR) && zip -rqX $$F * ) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 294 | |
Joe Onorato | 36b89ff | 2013-12-04 02:31:18 -0800 | [diff] [blame] | 295 | $(LOCAL_MODULE)-docs.zip : $(out_zip) |
| 296 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 297 | $(call dist-for-goals,docs,$(out_zip)) |
Joe Onorato | aaa5d11 | 2010-09-01 10:39:50 -0700 | [diff] [blame] | 298 | |
| 299 | endif |