blob: 46c1201bf4f8996acb93e515600f8a0d30079fed [file] [log] [blame]
Bart Searsa8cc0582015-05-07 03:23:20 +00001#
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#
16LOCAL_PATH := $(call my-dir)
17
Colin Crosscf3a0b52017-11-16 00:15:28 -080018# Load framework-specific path mappings used later in the build.
19include $(LOCAL_PATH)/pathmap.mk
Bart Searsa8cc0582015-05-07 03:23:20 +000020
21# Build the master framework library.
22# The framework contains too many method references (>64K) for poor old DEX.
23# So we first build the framework as a monolithic static library then split it
24# up into smaller pieces.
25# ============================================================
26
27# embedded builds use nothing in frameworks/base
28ifneq ($(ANDROID_BUILD_EMBEDDED),true)
29
Bart Searsa8cc0582015-05-07 03:23:20 +000030# Copy AIDL files to be preprocessed and included in the SDK,
31# specified relative to the root of the build tree.
32# ============================================================
33include $(CLEAR_VARS)
34
Colin Cross77ebd082017-12-15 17:30:33 -080035aidl_parcelables :=
36define stubs-to-aidl-parcelables
37 gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl
38 aidl_parcelables += $$(gen)
Colin Crossfdbe7d12018-02-09 11:24:14 -080039 $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables
Colin Cross77ebd082017-12-15 17:30:33 -080040 @echo Extract SDK parcelables: $$@
41 rm -f $$@
42 $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
43endef
44
45$(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
46 $(eval $(call stubs-to-aidl-parcelables,$(stubs))))
47
Bart Searsa8cc0582015-05-07 03:23:20 +000048gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
Colin Cross77ebd082017-12-15 17:30:33 -080049.KATI_RESTAT: $(gen)
50$(gen): $(aidl_parcelables)
51 @echo Combining SDK parcelables: $@
52 rm -f $@.tmp
53 cat $^ | sort -u > $@.tmp
54 $(call commit-change-for-toc,$@)
Bart Searsa8cc0582015-05-07 03:23:20 +000055
56# the documentation
57# ============================================================
58
59# TODO: deal with com/google/android/googleapps
60packages_to_document := \
Colin Crosscf3a0b52017-11-16 00:15:28 -080061 android \
62 javax/microedition/khronos \
63 org/apache/http/conn \
64 org/apache/http/params \
Bart Searsa8cc0582015-05-07 03:23:20 +000065
66# include definition of libcore_to_document
67include libcore/Docs.mk
68
Bart Searsa8cc0582015-05-07 03:23:20 +000069non_base_dirs := \
Colin Crosscf3a0b52017-11-16 00:15:28 -080070 ../opt/telephony/src/java/android/telephony \
71 ../opt/telephony/src/java/android/telephony/gsm \
72 ../opt/net/voip/src/java/android/net/rtp \
73 ../opt/net/voip/src/java/android/net/sip \
Bart Searsa8cc0582015-05-07 03:23:20 +000074
Colin Crosscf3a0b52017-11-16 00:15:28 -080075# Find all files in specific directories (relative to frameworks/base)
76# to document and check apis
77files_to_check_apis := \
78 $(call find-other-java-files, \
Colin Crosscf3a0b52017-11-16 00:15:28 -080079 $(non_base_dirs) \
80 )
Bart Searsa8cc0582015-05-07 03:23:20 +000081
Colin Crosscf3a0b52017-11-16 00:15:28 -080082# Find all files in specific packages that were used to compile
83# framework.jar to document and check apis
84files_to_check_apis += \
85 $(addprefix ../../,\
86 $(filter \
87 $(foreach dir,$(FRAMEWORKS_BASE_JAVA_SRC_DIRS),\
88 $(foreach package,$(packages_to_document),\
89 $(dir)/$(package)/%.java)),\
90 $(SOONG_FRAMEWORK_SRCS)))
91
92# Find all generated files that were used to compile framework.jar
Colin Crossbd200ce2017-12-04 13:45:19 -080093files_to_check_apis_generated := \
94 $(filter $(OUT_DIR)/%,\
95 $(SOONG_FRAMEWORK_SRCS))
George Mountf6be9932015-12-03 07:39:55 -080096
Bart Searsa8cc0582015-05-07 03:23:20 +000097# These are relative to frameworks/base
98# FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
Colin Crosscf3a0b52017-11-16 00:15:28 -080099files_to_document := \
100 $(files_to_check_apis) \
101 $(call find-other-java-files,\
Paul Duffin187a48d2017-12-13 14:34:31 +0000102 test-base/src \
Paul Duffin9f6282d2017-12-15 15:49:08 +0000103 test-mock/src \
Colin Crosscf3a0b52017-11-16 00:15:28 -0800104 test-runner/src)
George Mountf6be9932015-12-03 07:39:55 -0800105
Bart Searsa8cc0582015-05-07 03:23:20 +0000106# These are relative to frameworks/base
107html_dirs := \
108 $(FRAMEWORKS_BASE_SUBDIRS) \
Colin Crosscf3a0b52017-11-16 00:15:28 -0800109 $(non_base_dirs) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000110
111# Common sources for doc check and api check
112common_src_files := \
113 $(call find-other-html-files, $(html_dirs)) \
Colin Crosscf3a0b52017-11-16 00:15:28 -0800114 $(addprefix ../../, $(libcore_to_document)) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000115
116# These are relative to frameworks/base
117framework_docs_LOCAL_SRC_FILES := \
Colin Crosscf3a0b52017-11-16 00:15:28 -0800118 $(files_to_document) \
119 $(common_src_files) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000120
121# These are relative to frameworks/base
122framework_docs_LOCAL_API_CHECK_SRC_FILES := \
Colin Crosscf3a0b52017-11-16 00:15:28 -0800123 $(files_to_check_apis) \
124 $(common_src_files) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000125
126# This is used by ide.mk as the list of source files that are
127# always included.
128INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
129
130framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
131 $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
132
Colin Crosscf3a0b52017-11-16 00:15:28 -0800133framework_docs_LOCAL_SRCJARS := $(SOONG_FRAMEWORK_SRCJARS)
134
Colin Crossbd200ce2017-12-04 13:45:19 -0800135framework_docs_LOCAL_GENERATED_SOURCES := \
136 $(libcore_to_document_generated) \
137 $(files_to_check_apis_generated) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000138
139framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES := \
Piotr Jastrzebskicfa292e2015-02-17 16:58:52 +0000140 core-oj \
Bart Searsa8cc0582015-05-07 03:23:20 +0000141 core-libart \
142 conscrypt \
143 bouncycastle \
144 okhttp \
145 ext \
146 framework \
Paul Duffinc08090f2017-06-29 14:58:43 +0100147 voip-common \
Bart Searsa8cc0582015-05-07 03:23:20 +0000148
Alan Viverette9ca513e2017-04-05 10:21:58 -0400149# Platform docs can refer to Support Library APIs, but we don't actually build
150# them as part of the docs target, so we need to include them on the classpath.
Bart Searsa8cc0582015-05-07 03:23:20 +0000151framework_docs_LOCAL_JAVA_LIBRARIES := \
152 $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES) \
153 $(FRAMEWORKS_SUPPORT_JAVA_LIBRARIES)
154
155framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
156framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html
157# The since flag (-since N.xml API_LEVEL) is used to add API Level information
158# to the reference documentation. Must be in order of oldest to newest.
159#
160# Conscrypt (com.android.org.conscrypt) is an implementation detail and should
161# not be referenced in the documentation.
162framework_docs_LOCAL_DROIDDOC_OPTIONS := \
Jeff Sharkey0f3f60b2017-04-24 18:06:20 -0600163 -android \
Bart Searsa8cc0582015-05-07 03:23:20 +0000164 -knowntags ./frameworks/base/docs/knowntags.txt \
Narayan Kamath2c4f2842015-07-27 14:02:11 +0100165 -knowntags ./libcore/known_oj_tags.txt \
Jeff Sharkeybfc4fcd2017-06-05 17:38:17 -0600166 -manifest ./frameworks/base/core/res/AndroidManifest.xml \
Tobias Thiererdda16e82018-03-05 22:55:32 +0000167 -hidePackage com.android.internal \
168 -hidePackage com.android.internal.util \
Neil Fuller57157fb2017-11-24 15:58:38 +0000169 -hidePackage com.android.okhttp \
Bart Searsa8cc0582015-05-07 03:23:20 +0000170 -hidePackage com.android.org.conscrypt \
Anton Hansson6a9e7262018-04-19 16:23:53 +0100171 -hidePackage com.android.server
172
173# Convert an sdk level to a "since" argument.
174since-arg = -since $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(1)/public/api/android.*) $(1)
175
176finalized_sdks := $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.xml,%,\
177 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.xml))
178finalized_sdks += $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.txt,%,\
179 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.txt))
180finalized_sdks := $(call numerically_sort,$(finalized_sdks))
181
182framework_docs_LOCAL_DROIDDOC_OPTIONS += $(foreach sdk,$(finalized_sdks),$(call since-arg,$(sdk)))
183ifneq ($(PLATFORM_VERSION_CODENAME),REL)
184 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
185 -since ./frameworks/base/api/current.txt $(PLATFORM_VERSION_CODENAME)
186endif
187framework_docs_LOCAL_DROIDDOC_OPTIONS += \
Jeff Sharkeyc204c222017-11-27 15:02:10 -0700188 -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
Anton Hansson6a9e7262018-04-19 16:23:53 +0100189 -overview $(LOCAL_PATH)/core/java/overview.html
Bart Searsa8cc0582015-05-07 03:23:20 +0000190
191framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
192 $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
193
194framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
Alan Viverette9ca513e2017-04-05 10:21:58 -0400195 $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
Bart Searsa8cc0582015-05-07 03:23:20 +0000196
197framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
Narayan Kamathc21739a2015-07-14 13:39:23 +0100198 frameworks/base/docs/knowntags.txt \
Colin Cross72d359f2017-10-27 10:46:53 -0700199 $(libcore_to_document_generated)
Bart Searsa8cc0582015-05-07 03:23:20 +0000200
201samples_dir := development/samples/browseable
202
203# Whitelist of valid groups, used for default TOC grouping. Each sample must
204# belong to one (and only one) group. Assign samples to groups by setting
205# a sample.group var to one of these groups in the sample's _index.jd.
206sample_groups := -samplegroup Admin \
207 -samplegroup Background \
208 -samplegroup Connectivity \
209 -samplegroup Content \
210 -samplegroup Input \
211 -samplegroup Media \
212 -samplegroup Notification \
213 -samplegroup RenderScript \
214 -samplegroup Security \
215 -samplegroup Sensors \
Trevor Johns4cbe3592015-05-27 14:50:51 -0700216 -samplegroup System \
Bart Searsa8cc0582015-05-07 03:23:20 +0000217 -samplegroup Testing \
218 -samplegroup UI \
219 -samplegroup Views \
220 -samplegroup Wearable
221
222## SDK version identifiers used in the published docs
223 # major[.minor] version for current SDK. (full releases only)
smain@google.comdde8deb2016-08-29 18:36:50 -0700224framework_docs_SDK_VERSION:=7.0
Bart Searsa8cc0582015-05-07 03:23:20 +0000225 # release version (ie "Release x") (full releases only)
226framework_docs_SDK_REL_ID:=1
227
228framework_docs_LOCAL_DROIDDOC_OPTIONS += \
Billy Lamberta75dbc8f2017-03-03 13:09:15 -0800229 -hdf dac true \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700230 -hdf sdk.codename O \
231 -hdf sdk.preview.version 1 \
Bart Searsa8cc0582015-05-07 03:23:20 +0000232 -hdf sdk.version $(framework_docs_SDK_VERSION) \
233 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700234 -hdf sdk.preview 0 \
235 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
236 -resourcesoutdir reference/android/images/
Bart Searsa8cc0582015-05-07 03:23:20 +0000237
Alan Viverette9ca513e2017-04-05 10:21:58 -0400238# Federate Support Library references against local API file.
239framework_docs_LOCAL_DROIDDOC_OPTIONS += \
240 -federate SupportLib https://developer.android.com \
241 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
242
Alan Viverette67b51d42018-03-28 17:10:20 -0400243# Federate AndroidX references against local API file.
244framework_docs_LOCAL_DROIDDOC_OPTIONS += \
245 -federate AndroidX https://developer.android.com \
246 -federationapi AndroidX prebuilts/sdk/current/androidx-api.txt
247
Anton Hanssoncfa700d2018-04-23 17:34:18 +0100248# Get the highest numbered api txt for the given api level.
249# $(1): the api level (e.g. public, system)
250define highest_sdk_txt
251$(HISTORICAL_SDK_VERSIONS_ROOT)/$(lastword $(call numerically_sort, \
252 $(patsubst \
253 $(HISTORICAL_SDK_VERSIONS_ROOT)/%,\
254 %,\
255 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/$(1)/api/android.txt)\
256 ) \
257))
258endef
259
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700260# ==== Public API diff ===========================
Alan Viverette6b7354c2017-07-13 17:10:14 -0400261include $(CLEAR_VARS)
262
263LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800264LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800265LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Alan Viverette6b7354c2017-07-13 17:10:14 -0400266LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
267LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
268LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
269LOCAL_ADDITIONAL_DEPENDENCIES := \
270 $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
271 $(INTERNAL_PLATFORM_API_FILE)
272
273LOCAL_MODULE := offline-sdk-referenceonly
274
Anton Hanssoncfa700d2018-04-23 17:34:18 +0100275# Basename, because apidiff adds .txt internally.
276LOCAL_APIDIFF_OLDAPI := $(basename $(call highest_sdk_txt,public))
Alan Viverette6b7354c2017-07-13 17:10:14 -0400277LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_API_FILE))
278
279include $(BUILD_APIDIFF)
280
Jeff Sharkeyc8dc2542017-12-08 14:52:37 -0700281# Hack to get diffs included in docs output
282out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
283$(out_zip): $(full_target)
284
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700285# ==== System API diff ===========================
286include $(CLEAR_VARS)
287
288LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800289LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800290LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700291LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
292LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
293LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
294LOCAL_ADDITIONAL_DEPENDENCIES := \
295 $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
296 $(INTERNAL_PLATFORM_SYSTEM_API_FILE)
297
298LOCAL_MODULE := offline-system-sdk-referenceonly
299
Anton Hanssoncfa700d2018-04-23 17:34:18 +0100300# Basename, because apidiff adds .txt internally.
301LOCAL_APIDIFF_OLDAPI := $(basename $(call highest_sdk_txt,system))
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700302LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_SYSTEM_API_FILE))
303
304include $(BUILD_APIDIFF)
305
Jeff Sharkeyc8dc2542017-12-08 14:52:37 -0700306# Hack to get diffs included in docs output
307out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
308$(out_zip): $(full_target)
309
Bart Searsa8cc0582015-05-07 03:23:20 +0000310$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
Bart Searsa8cc0582015-05-07 03:23:20 +0000311$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
Michael Wrightb2b2c0e2015-11-06 15:21:13 +0000312$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
313
Bart Searsa8cc0582015-05-07 03:23:20 +0000314# ==== check javadoc comments but don't generate docs ========
315include $(CLEAR_VARS)
316
317LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800318LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800319LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000320LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
321LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
322LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
323LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
324LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
325LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
326
327LOCAL_MODULE := doc-comment-check
328
329LOCAL_DROIDDOC_OPTIONS:=\
330 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700331 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000332 -parsecomments
333
Scott Main15b85172017-02-21 14:30:58 -0800334LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000335
336LOCAL_UNINSTALLABLE_MODULE := true
337
338include $(BUILD_DROIDDOC)
339
Bart Searsa8cc0582015-05-07 03:23:20 +0000340# Run this for checkbuild
341checkbuild: doc-comment-check-docs
342# Check comment when you are updating the API
343update-api: doc-comment-check-docs
344
345# ==== static html in the sdk ==================================
346include $(CLEAR_VARS)
347
348LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800349LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800350LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000351LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
352LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
353LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
354LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
355LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
356LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
357
358LOCAL_MODULE := offline-sdk
359
360LOCAL_DROIDDOC_OPTIONS:=\
361 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
362 -offlinemode \
363 -title "Android SDK" \
364 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
smain@google.com00de8c52016-03-07 18:38:08 -0800365 -sdkvalues $(OUT_DOCS) \
smain@google.com8562ab52016-06-14 17:11:57 -0700366 -hdf android.whichdoc offline
367
Scott Main15b85172017-02-21 14:30:58 -0800368LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
smain@google.com8562ab52016-06-14 17:11:57 -0700369
370include $(BUILD_DROIDDOC)
371
372static_doc_index_redirect := $(out_dir)/index.html
373$(static_doc_index_redirect): \
374 $(LOCAL_PATH)/docs/docs-preview-index.html | $(ACP)
375 $(hide) mkdir -p $(dir $@)
376 $(hide) $(ACP) $< $@
377
378$(full_target): $(static_doc_index_redirect)
smain@google.com8562ab52016-06-14 17:11:57 -0700379
380
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700381# ==== Public API static reference docs ==================================
smain@google.com8562ab52016-06-14 17:11:57 -0700382include $(CLEAR_VARS)
383
384LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800385LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800386LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
smain@google.com8562ab52016-06-14 17:11:57 -0700387LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
388LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
389LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
390LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
391LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
392LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
393
394LOCAL_MODULE := offline-sdk-referenceonly
395
396LOCAL_DROIDDOC_OPTIONS:=\
397 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
398 -offlinemode \
399 -title "Android SDK" \
400 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
401 -sdkvalues $(OUT_DOCS) \
smain@google.com00de8c52016-03-07 18:38:08 -0800402 -hdf android.whichdoc offline \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700403 -referenceonly
smain@google.com00de8c52016-03-07 18:38:08 -0800404
Scott Main15b85172017-02-21 14:30:58 -0800405LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
smain@google.com00de8c52016-03-07 18:38:08 -0800406
407include $(BUILD_DROIDDOC)
408
409static_doc_index_redirect := $(out_dir)/index.html
smain@google.com151833a2016-08-31 08:42:09 -0700410$(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
Dan Willemsen98ff0b72016-03-23 00:42:44 -0700411 $(copy-file-to-target)
smain@google.com00de8c52016-03-07 18:38:08 -0800412
smain@google.com2f2365d2016-09-21 14:05:50 -0700413static_doc_properties := $(out_dir)/source.properties
414$(static_doc_properties): \
415 $(LOCAL_PATH)/docs/source.properties | $(ACP)
416 $(hide) mkdir -p $(dir $@)
417 $(hide) $(ACP) $< $@
418
smain@google.com00de8c52016-03-07 18:38:08 -0800419$(full_target): $(static_doc_index_redirect)
smain@google.com2f2365d2016-09-21 14:05:50 -0700420$(full_target): $(static_doc_properties)
smain@google.com00de8c52016-03-07 18:38:08 -0800421
smain@google.com7aca8be2016-03-10 14:13:30 -0800422
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700423# ==== System API static reference docs ==================================
424include $(CLEAR_VARS)
425
426LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800427LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800428LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Jeff Sharkeyd2bf31c2017-11-29 13:14:27 -0700429LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
430LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
431LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
432LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
433LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
434LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
435
436LOCAL_MODULE := offline-system-sdk-referenceonly
437
438LOCAL_DROIDDOC_OPTIONS:=\
439 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
440 -hide 101 -hide 104 -hide 108 \
441 -showAnnotation android.annotation.SystemApi \
442 -offlinemode \
443 -title "Android System SDK" \
444 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
445 -sdkvalues $(OUT_DOCS) \
446 -hdf android.whichdoc offline \
447 -referenceonly
448
449LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
450
451include $(BUILD_DROIDDOC)
452
453static_doc_index_redirect := $(out_dir)/index.html
454$(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
455 $(copy-file-to-target)
456
457static_doc_properties := $(out_dir)/source.properties
458$(static_doc_properties): \
459 $(LOCAL_PATH)/docs/source.properties | $(ACP)
460 $(hide) mkdir -p $(dir $@)
461 $(hide) $(ACP) $< $@
462
463$(full_target): $(static_doc_index_redirect)
464$(full_target): $(static_doc_properties)
465$(full_target): $(framework_built)
466
467
Bart Searsa8cc0582015-05-07 03:23:20 +0000468# ==== docs for the web (on the androiddevdocs app engine server) =======================
469include $(CLEAR_VARS)
470
471LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800472LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800473LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000474LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
475LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
476LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
477LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
478LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
479LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
480LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
481LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
482
483LOCAL_MODULE := online-sdk
484
485LOCAL_DROIDDOC_OPTIONS:= \
486 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
487 -toroot / \
488 -hdf android.whichdoc online \
489 $(sample_groups) \
490 -hdf android.hasSamples true \
491 -samplesdir $(samples_dir)
492
Scott Main15b85172017-02-21 14:30:58 -0800493LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000494
495include $(BUILD_DROIDDOC)
496
497# ==== docs for the web (on the androiddevdocs app engine server) =======================
Bart Searsa8cc0582015-05-07 03:23:20 +0000498include $(CLEAR_VARS)
499
500LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800501LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800502LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000503LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
504LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
505LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
506LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
507LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
508LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
509LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
510LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
511
512LOCAL_MODULE := online-system-api-sdk
513
514LOCAL_DROIDDOC_OPTIONS:= \
515 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700516 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000517 -showAnnotation android.annotation.SystemApi \
518 -title "Android SDK - Including system APIs." \
519 -toroot / \
Gina Dimino98ad8882016-05-31 17:25:48 -0700520 -hide 101 \
521 -hide 104 \
522 -hide 108 \
Bart Searsa8cc0582015-05-07 03:23:20 +0000523 -hdf android.whichdoc online \
524 $(sample_groups) \
525 -hdf android.hasSamples true \
526 -samplesdir $(samples_dir)
527
Scott Main15b85172017-02-21 14:30:58 -0800528LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Jeff Sharkey05461c02017-05-09 19:01:09 -0600529
Bart Searsa8cc0582015-05-07 03:23:20 +0000530LOCAL_UNINSTALLABLE_MODULE := true
531
532include $(BUILD_DROIDDOC)
Bart Searsa8cc0582015-05-07 03:23:20 +0000533
534# ==== docs for the web (on the devsite app engine server) =======================
535include $(CLEAR_VARS)
536LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800537LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800538LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000539LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
540LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
541LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
542LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
543LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
544LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
545LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
546# specify a second html input dir and an output path relative to OUT_DIR)
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700547LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
Bart Searsa8cc0582015-05-07 03:23:20 +0000548
549LOCAL_MODULE := ds
550
551LOCAL_DROIDDOC_OPTIONS:= \
552 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000553 -toroot / \
554 -hdf android.whichdoc online \
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700555 -devsite \
Scott Main4f9b48c2017-12-19 13:43:45 -0800556 -yamlV2 \
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700557 $(sample_groups) \
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700558 -hdf android.hasSamples true \
559 -samplesdir $(samples_dir)
Bart Searsa8cc0582015-05-07 03:23:20 +0000560
Scott Main15b85172017-02-21 14:30:58 -0800561LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000562
563include $(BUILD_DROIDDOC)
564
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700565# ==== docs for the web (on the devsite app engine server) =======================
566include $(CLEAR_VARS)
567LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800568LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800569LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700570LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
571LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
572LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
573LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
574LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
575LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
576LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
577# specify a second html input dir and an output path relative to OUT_DIR)
578LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
579
580LOCAL_MODULE := ds-static
581
582LOCAL_DROIDDOC_OPTIONS:= \
583 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
584 -hdf android.whichdoc online \
585 -staticonly \
586 -toroot / \
587 -devsite \
588 -ignoreJdLinks
589
Scott Main15b85172017-02-21 14:30:58 -0800590LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700591
592include $(BUILD_DROIDDOC)
593
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700594# ==== generates full navtree for resolving @links in ds postprocessing ====
595include $(CLEAR_VARS)
596
597LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800598LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800599LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700600LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
601LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
602LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
603LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
604LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
605LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
606
607LOCAL_MODULE := ds-ref-navtree
608
609LOCAL_DROIDDOC_OPTIONS:= \
610 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
611 -hdf android.whichdoc online \
612 -toroot / \
613 -atLinksNavtree \
614 -navtreeonly
615
Scott Main15b85172017-02-21 14:30:58 -0800616LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700617
618include $(BUILD_DROIDDOC)
619
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800620# ==== site updates for docs (on the androiddevdocs app engine server) =======================
Bart Searsa8cc0582015-05-07 03:23:20 +0000621include $(CLEAR_VARS)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800622
Bart Searsa8cc0582015-05-07 03:23:20 +0000623LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800624LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800625LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000626LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
627LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
628LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
629LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800630LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
Bart Searsa8cc0582015-05-07 03:23:20 +0000631LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
632LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800633LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
Bart Searsa8cc0582015-05-07 03:23:20 +0000634
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800635LOCAL_MODULE := online-sdk-dev
Bart Searsa8cc0582015-05-07 03:23:20 +0000636
637LOCAL_DROIDDOC_OPTIONS:= \
638 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
639 -toroot / \
640 -hdf android.whichdoc online \
641 $(sample_groups) \
642 -hdf android.hasSamples true \
643 -samplesdir $(samples_dir)
644
Scott Main15b85172017-02-21 14:30:58 -0800645LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000646
647include $(BUILD_DROIDDOC)
648
Bart Searsa8cc0582015-05-07 03:23:20 +0000649# ==== docs that have all of the stuff that's @hidden =======================
650include $(CLEAR_VARS)
651
652LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Crossbd200ce2017-12-04 13:45:19 -0800653LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Crosscf3a0b52017-11-16 00:15:28 -0800654LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000655LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
656LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
657LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
658LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
659LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
660LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
661
662LOCAL_MODULE := hidden
663LOCAL_DROIDDOC_OPTIONS:=\
664 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700665 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000666 -title "Android SDK - Including hidden APIs."
667# -hidden
668
Scott Main15b85172017-02-21 14:30:58 -0800669LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000670
671include $(BUILD_DROIDDOC)
672
Joe Onorato1754d742016-11-21 17:51:35 -0800673# ==== java proto host library ==============================
674include $(CLEAR_VARS)
675LOCAL_MODULE := platformprotos
676LOCAL_PROTOC_OPTIMIZE_TYPE := full
677LOCAL_PROTOC_FLAGS := \
678 -Iexternal/protobuf/src
679LOCAL_SOURCE_FILES_ALL_GENERATED := true
680LOCAL_SRC_FILES := \
Mike Mada3a2952017-11-13 12:06:45 -0800681 cmds/am/proto/instrumentation_data.proto \
Primiano Tuccie4d44912018-01-10 12:14:50 +0000682 cmds/statsd/src/perfetto/perfetto_config.proto \
Joe Onorato1754d742016-11-21 17:51:35 -0800683 $(call all-proto-files-under, core/proto) \
Chenjie Yu15176cd2017-11-22 12:36:41 -0800684 $(call all-proto-files-under, libs/incident/proto) \
685 $(call all-proto-files-under, cmds/statsd/src)
Andreas Gampe3e429f32018-02-15 15:12:38 -0800686# b/72714520
687LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
Joe Onorato1754d742016-11-21 17:51:35 -0800688include $(BUILD_HOST_JAVA_LIBRARY)
689
Steven Timotius7ece0422017-08-03 13:37:26 -0700690# ==== java proto device library (for test only) ==============================
691include $(CLEAR_VARS)
692LOCAL_MODULE := platformprotosnano
Joe Onorato62c220b2017-11-18 20:32:56 -0800693LOCAL_MODULE_TAGS := tests
Steven Timotius7ece0422017-08-03 13:37:26 -0700694LOCAL_PROTOC_OPTIMIZE_TYPE := nano
695LOCAL_PROTOC_FLAGS := \
696 -Iexternal/protobuf/src
697LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
698 store_unknown_fields = true
Jiyong Parkf0048392018-02-12 21:57:59 +0900699LOCAL_SDK_VERSION := current
Steven Timotius7ece0422017-08-03 13:37:26 -0700700LOCAL_SRC_FILES := \
Yi Jin437aa6e2018-01-10 11:34:26 -0800701 $(call all-proto-files-under, core/proto) \
702 $(call all-proto-files-under, libs/incident/proto/android/os)
Steven Timotius7ece0422017-08-03 13:37:26 -0700703include $(BUILD_STATIC_JAVA_LIBRARY)
704
Bart Searsa8cc0582015-05-07 03:23:20 +0000705
Joe Onorato62c220b2017-11-18 20:32:56 -0800706# ==== java proto device library (for test only) ==============================
707include $(CLEAR_VARS)
708LOCAL_MODULE := platformprotoslite
709LOCAL_MODULE_TAGS := tests
710LOCAL_PROTOC_OPTIMIZE_TYPE := lite
711LOCAL_PROTOC_FLAGS := \
712 -Iexternal/protobuf/src
713LOCAL_SRC_FILES := \
Yi Jin437aa6e2018-01-10 11:34:26 -0800714 $(call all-proto-files-under, core/proto) \
715 $(call all-proto-files-under, libs/incident/proto/android/os)
Andreas Gampe93b64c92018-01-30 18:50:34 -0800716# Protos have lots of MissingOverride and similar.
717LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks
Joe Onorato62c220b2017-11-18 20:32:56 -0800718include $(BUILD_STATIC_JAVA_LIBRARY)
719
David Brazdil0649c8d2018-01-22 22:23:13 +0000720# ==== hiddenapi lists =======================================
David Brazdil721bc8e2018-05-08 15:04:20 +0100721include $(CLEAR_VARS)
David Brazdil0649c8d2018-01-22 22:23:13 +0000722
David Brazdil721bc8e2018-05-08 15:04:20 +0100723# File names of final API lists
724LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
725LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
726LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
727
728# File names of source files we will use to generate the final API lists.
729LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
730LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
David Brazdil4b34f792018-05-08 16:49:02 +0100731LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
David Brazdil6f6a1262018-05-31 13:58:41 +0100732LOCAL_SRC_PUBLIC_API := $(INTERNAL_PLATFORM_DEX_API_FILE)
David Brazdil721bc8e2018-05-08 15:04:20 +0100733LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
734LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
735
736LOCAL_SRC_ALL := \
737 $(LOCAL_SRC_GREYLIST) \
738 $(LOCAL_SRC_VENDOR_LIST) \
David Brazdil4b34f792018-05-08 16:49:02 +0100739 $(LOCAL_SRC_FORCE_BLACKLIST) \
David Brazdil6f6a1262018-05-31 13:58:41 +0100740 $(LOCAL_SRC_PUBLIC_API) \
David Brazdil721bc8e2018-05-08 15:04:20 +0100741 $(LOCAL_SRC_PRIVATE_API) \
742 $(LOCAL_SRC_REMOVED_API)
743
744define assert-has-no-overlap
745if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
746 echo "$(1) and $(2) should not overlap" 1>&2; \
747 comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
748 exit 1; \
749fi
750endef
751
752define assert-is-subset
753if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
754 echo "$(1) must be a subset of $(2)" 1>&2; \
755 comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
756 exit 1; \
757fi
758endef
759
760define assert-has-no-duplicates
761if [ ! -z "`sort $(1) | uniq -D`" ]; then \
762 echo "$(1) has duplicate entries" 1>&2; \
763 sort $(1) | uniq -D 1>&2; \
764 exit 1; \
765fi
766endef
767
768# The following rules build API lists in the build folder.
769# By not using files from the source tree, ART buildbots can mock these lists
770# or have alternative rules for building them. Other rules in the build system
771# should depend on the files in the build folder.
David Brazdilf16ac002018-01-26 11:13:35 +0000772
David Brazdil05855332018-04-25 11:15:07 +0100773# Merge light greylist from multiple files:
David Brazdil721bc8e2018-05-08 15:04:20 +0100774# (1) manual greylist LOCAL_SRC_GREYLIST
775# (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
776# (3) list of removed APIs in LOCAL_SRC_REMOVED_API
David Brazdil05855332018-04-25 11:15:07 +0100777# @removed does not imply private in Doclava. We must take the subset also
David Brazdil721bc8e2018-05-08 15:04:20 +0100778# in LOCAL_SRC_PRIVATE_API.
David Brazdil05855332018-04-25 11:15:07 +0100779# (4) list of serialization APIs
780# Automatically adds all methods which match the signatures in
781# REGEX_SERIALIZATION. These are greylisted in order to allow applications
782# to write their own serializers.
David Brazdil721bc8e2018-05-08 15:04:20 +0100783$(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
David Brazdil357170b12018-03-26 16:02:23 +0100784 "readObject\(Ljava/io/ObjectInputStream;\)V" \
785 "readObjectNoData\(\)V" \
786 "readResolve\(\)Ljava/lang/Object;" \
787 "serialVersionUID:J" \
788 "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
789 "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
790 "writeReplace\(\)Ljava/lang/Object;"
David Brazdil721bc8e2018-05-08 15:04:20 +0100791$(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
792 sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \
793 <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
794 $(LOCAL_SRC_PRIVATE_API)) \
795 <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
796 > $@
797 $(call assert-has-no-duplicates,$@)
798 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
David Brazdil4b34f792018-05-08 16:49:02 +0100799 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
David Brazdilf16ac002018-01-26 11:13:35 +0000800
David Brazdil4c3c0312018-05-10 15:50:02 +0100801# Generate dark greylist as remaining classes and class members in the same
802# package as classes listed in the light greylist.
David Brazdil185f00e2018-05-08 15:28:31 +0100803# The algorithm is as follows:
804# (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
David Brazdil4c3c0312018-05-10 15:50:02 +0100805# (2) strip everything after the last forward-slash,
806# e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/'
807# (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package
808# name but do not contain another forward-slash in the class name, e.g.
809# matching '^Lpackage/subpackage/[^/;]*;'
David Brazdil185f00e2018-05-08 15:28:31 +0100810# (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
David Brazdil721bc8e2018-05-08 15:04:20 +0100811$(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
David Brazdil4b34f792018-05-08 16:49:02 +0100812 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
David Brazdil6f6a1262018-05-31 13:58:41 +0100813 <(cat $(LOCAL_SRC_PUBLIC_API) $(LOCAL_LIGHT_GREYLIST) | \
814 sed 's/\->.*//' | sed 's/\(.*\/\).*/\1/' | sort | uniq | \
David Brazdil4c3c0312018-05-10 15:50:02 +0100815 while read PKG_NAME; do \
816 grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \
David Brazdil185f00e2018-05-08 15:28:31 +0100817 done | sort | uniq) \
818 > $@
David Brazdil721bc8e2018-05-08 15:04:20 +0100819 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
820 $(call assert-has-no-duplicates,$@)
821 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
David Brazdil4b34f792018-05-08 16:49:02 +0100822 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
David Brazdil36bbf122018-03-28 11:28:39 +0100823
David Brazdil721bc8e2018-05-08 15:04:20 +0100824# Generate blacklist as private API minus (light greylist plus dark greylist).
825$(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
826 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
827 <(sort $(LOCAL_SRC_PRIVATE_API)) \
828 > $@
829 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
830 $(call assert-has-no-duplicates,$@)
831 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
832 $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
David Brazdil4b34f792018-05-08 16:49:02 +0100833 $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
David Brazdil0649c8d2018-01-22 22:23:13 +0000834
Bart Searsa8cc0582015-05-07 03:23:20 +0000835# Include subdirectory makefiles
836# ============================================================
837
838# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
839# team really wants is to build the stuff defined by this makefile.
840ifeq (,$(ONE_SHOT_MAKEFILE))
841include $(call first-makefiles-under,$(LOCAL_PATH))
842endif
843
Holly Jiuyu Sunbbc85802017-12-21 18:44:59 -0800844endif # ANDROID_BUILD_EMBEDDED