2 # Copyright (C) 2008 The Android Open Source Project
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 LOCAL_PATH := $(call my-dir)
18 # Load framework-specific path mappings used later in the build.
19 include $(LOCAL_PATH)/pathmap.mk
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 # ============================================================
27 # embedded builds use nothing in frameworks/base
28 ifneq ($(ANDROID_BUILD_EMBEDDED),true)
30 # Copy AIDL files to be preprocessed and included in the SDK,
31 # specified relative to the root of the build tree.
32 # ============================================================
36 define stubs-to-aidl-parcelables
37 gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl
38 aidl_parcelables += $$(gen)
39 $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables
40 @echo Extract SDK parcelables: $$@
42 $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
45 $(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
46 $(eval $(call stubs-to-aidl-parcelables,$(stubs))))
48 gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
50 $(gen): $(aidl_parcelables)
51 @echo Combining SDK parcelables: $@
53 cat $^ | sort -u > $@.tmp
54 $(call commit-change-for-toc,$@)
57 # ============================================================
59 # TODO: deal with com/google/android/googleapps
60 packages_to_document := \
62 javax/microedition/khronos \
63 org/apache/http/conn \
64 org/apache/http/params \
66 # include definition of libcore_to_document
67 include libcore/Docs.mk
70 ../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 \
75 # Find all files in specific directories (relative to frameworks/base)
76 # to document and check apis
77 files_to_check_apis := \
78 $(call find-other-java-files, \
82 # Find all files in specific packages that were used to compile
83 # framework.jar to document and check apis
84 files_to_check_apis += \
87 $(foreach dir,$(FRAMEWORKS_BASE_JAVA_SRC_DIRS),\
88 $(foreach package,$(packages_to_document),\
89 $(dir)/$(package)/%.java)),\
90 $(SOONG_FRAMEWORK_SRCS)))
92 # Find all generated files that were used to compile framework.jar
93 files_to_check_apis_generated := \
94 $(filter $(OUT_DIR)/%,\
95 $(SOONG_FRAMEWORK_SRCS))
97 # These are relative to frameworks/base
98 # FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
99 files_to_document := \
100 $(files_to_check_apis) \
101 $(call find-other-java-files,\
106 # These are relative to frameworks/base
108 $(FRAMEWORKS_BASE_SUBDIRS) \
111 # Common sources for doc check and api check
112 common_src_files := \
113 $(call find-other-html-files, $(html_dirs)) \
114 $(addprefix ../../, $(libcore_to_document)) \
116 # These are relative to frameworks/base
117 framework_docs_LOCAL_SRC_FILES := \
118 $(files_to_document) \
119 $(common_src_files) \
121 # These are relative to frameworks/base
122 framework_docs_LOCAL_API_CHECK_SRC_FILES := \
123 $(files_to_check_apis) \
124 $(common_src_files) \
126 # This is used by ide.mk as the list of source files that are
128 INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
130 framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
131 $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
133 framework_docs_LOCAL_SRCJARS := $(SOONG_FRAMEWORK_SRCJARS)
135 framework_docs_LOCAL_GENERATED_SOURCES := \
136 $(libcore_to_document_generated) \
137 $(files_to_check_apis_generated) \
139 framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES := \
149 # 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.
151 framework_docs_LOCAL_JAVA_LIBRARIES := \
152 $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES) \
153 $(FRAMEWORKS_SUPPORT_JAVA_LIBRARIES)
155 framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
156 framework_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.
160 # Conscrypt (com.android.org.conscrypt) is an implementation detail and should
161 # not be referenced in the documentation.
162 framework_docs_LOCAL_DROIDDOC_OPTIONS := \
164 -knowntags ./frameworks/base/docs/knowntags.txt \
165 -knowntags ./libcore/known_oj_tags.txt \
166 -manifest ./frameworks/base/core/res/AndroidManifest.xml \
167 -hidePackage com.android.internal \
168 -hidePackage com.android.internal.util \
169 -hidePackage com.android.okhttp \
170 -hidePackage com.android.org.conscrypt \
171 -hidePackage com.android.server \
172 -since $(SRC_API_DIR)/1.xml 1 \
173 -since $(SRC_API_DIR)/2.xml 2 \
174 -since $(SRC_API_DIR)/3.xml 3 \
175 -since $(SRC_API_DIR)/4.xml 4 \
176 -since $(SRC_API_DIR)/5.xml 5 \
177 -since $(SRC_API_DIR)/6.xml 6 \
178 -since $(SRC_API_DIR)/7.xml 7 \
179 -since $(SRC_API_DIR)/8.xml 8 \
180 -since $(SRC_API_DIR)/9.xml 9 \
181 -since $(SRC_API_DIR)/10.xml 10 \
182 -since $(SRC_API_DIR)/11.xml 11 \
183 -since $(SRC_API_DIR)/12.xml 12 \
184 -since $(SRC_API_DIR)/13.xml 13 \
185 -since $(SRC_API_DIR)/14.txt 14 \
186 -since $(SRC_API_DIR)/15.txt 15 \
187 -since $(SRC_API_DIR)/16.txt 16 \
188 -since $(SRC_API_DIR)/17.txt 17 \
189 -since $(SRC_API_DIR)/18.txt 18 \
190 -since $(SRC_API_DIR)/19.txt 19 \
191 -since $(SRC_API_DIR)/20.txt 20 \
192 -since $(SRC_API_DIR)/21.txt 21 \
193 -since $(SRC_API_DIR)/22.txt 22 \
194 -since $(SRC_API_DIR)/23.txt 23 \
195 -since $(SRC_API_DIR)/24.txt 24 \
196 -since $(SRC_API_DIR)/25.txt 25 \
197 -since $(SRC_API_DIR)/26.txt 26 \
198 -since $(SRC_API_DIR)/27.txt 27 \
199 -since $(SRC_API_DIR)/28.txt 28 \
200 -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
201 -overview $(LOCAL_PATH)/core/java/overview.html \
203 framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
204 $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
206 framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
207 $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
209 framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
210 frameworks/base/docs/knowntags.txt \
211 $(libcore_to_document_generated)
213 samples_dir := development/samples/browseable
215 # Whitelist of valid groups, used for default TOC grouping. Each sample must
216 # belong to one (and only one) group. Assign samples to groups by setting
217 # a sample.group var to one of these groups in the sample's _index.jd.
218 sample_groups := -samplegroup Admin \
219 -samplegroup Background \
220 -samplegroup Connectivity \
221 -samplegroup Content \
224 -samplegroup Notification \
225 -samplegroup RenderScript \
226 -samplegroup Security \
227 -samplegroup Sensors \
228 -samplegroup System \
229 -samplegroup Testing \
232 -samplegroup Wearable
234 ## SDK version identifiers used in the published docs
235 # major[.minor] version for current SDK. (full releases only)
236 framework_docs_SDK_VERSION:=7.0
237 # release version (ie "Release x") (full releases only)
238 framework_docs_SDK_REL_ID:=1
240 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
242 -hdf sdk.codename O \
243 -hdf sdk.preview.version 1 \
244 -hdf sdk.version $(framework_docs_SDK_VERSION) \
245 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
247 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
248 -resourcesoutdir reference/android/images/
250 # Federate Support Library references against local API file.
251 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
252 -federate SupportLib https://developer.android.com \
253 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
255 # Federate AndroidX references against local API file.
256 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
257 -federate AndroidX https://developer.android.com \
258 -federationapi AndroidX prebuilts/sdk/current/androidx-api.txt
260 # ==== Public API diff ===========================
261 include $(CLEAR_VARS)
263 LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
264 LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
265 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
266 LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
267 LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
268 LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
269 LOCAL_ADDITIONAL_DEPENDENCIES := \
270 $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
271 $(INTERNAL_PLATFORM_API_FILE)
273 LOCAL_MODULE := offline-sdk-referenceonly
275 last_released_sdk_version := $(lastword $(call numerically_sort, \
276 $(filter-out current, \
277 $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
281 LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_API_DIR)/$(last_released_sdk_version)
282 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_API_FILE))
284 include $(BUILD_APIDIFF)
286 # Hack to get diffs included in docs output
287 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
288 $(out_zip): $(full_target)
290 # ==== System API diff ===========================
291 include $(CLEAR_VARS)
293 LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
294 LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
295 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
296 LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
297 LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
298 LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
299 LOCAL_ADDITIONAL_DEPENDENCIES := \
300 $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
301 $(INTERNAL_PLATFORM_SYSTEM_API_FILE)
303 LOCAL_MODULE := offline-system-sdk-referenceonly
305 last_released_sdk_version := $(lastword $(call numerically_sort, \
306 $(filter-out current, \
307 $(patsubst $(SRC_SYSTEM_API_DIR)/%.txt,%, $(wildcard $(SRC_SYSTEM_API_DIR)/*.txt)) \
311 LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_SYSTEM_API_DIR)/$(last_released_sdk_version)
312 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_SYSTEM_API_FILE))
314 include $(BUILD_APIDIFF)
316 # Hack to get diffs included in docs output
317 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
318 $(out_zip): $(full_target)
320 # ==== the api stubs and current.xml ===========================
321 include $(CLEAR_VARS)
323 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
324 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
325 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
326 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
327 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
328 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
329 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
330 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
331 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
333 LOCAL_MODULE := api-stubs
335 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_stubs_current_intermediates/src
337 LOCAL_DROIDDOC_OPTIONS:=\
338 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
340 -api $(INTERNAL_PLATFORM_API_FILE) \
341 -removedApi $(INTERNAL_PLATFORM_REMOVED_API_FILE) \
344 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
346 LOCAL_UNINSTALLABLE_MODULE := true
348 include $(BUILD_DROIDDOC)
350 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_API_FILE) \
351 $(INTERNAL_PLATFORM_REMOVED_API_FILE)
352 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
354 # ==== the system api stubs ===================================
355 include $(CLEAR_VARS)
357 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
358 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
359 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
360 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
361 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
362 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
363 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
364 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
365 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
367 LOCAL_MODULE := system-api-stubs
369 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_system_stubs_current_intermediates/src
371 LOCAL_DROIDDOC_OPTIONS:=\
372 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
374 -showAnnotation android.annotation.SystemApi \
375 -api $(INTERNAL_PLATFORM_SYSTEM_API_FILE) \
376 -removedApi $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) \
377 -exactApi $(INTERNAL_PLATFORM_SYSTEM_EXACT_API_FILE) \
380 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
382 LOCAL_UNINSTALLABLE_MODULE := true
384 include $(BUILD_DROIDDOC)
386 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_SYSTEM_API_FILE) \
387 $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) \
388 $(INTERNAL_PLATFORM_SYSTEM_EXACT_API_FILE)
389 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
391 # ==== the test api stubs ===================================
392 include $(CLEAR_VARS)
394 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
395 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
396 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
397 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
398 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
399 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
400 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
401 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
402 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
404 LOCAL_MODULE := test-api-stubs
406 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_test_stubs_current_intermediates/src
408 LOCAL_DROIDDOC_OPTIONS:=\
409 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
411 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_test_stubs_current_intermediates/src \
412 -showAnnotation android.annotation.TestApi \
413 -api $(INTERNAL_PLATFORM_TEST_API_FILE) \
414 -removedApi $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE) \
415 -exactApi $(INTERNAL_PLATFORM_TEST_EXACT_API_FILE) \
418 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
420 LOCAL_UNINSTALLABLE_MODULE := true
422 include $(BUILD_DROIDDOC)
424 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_TEST_API_FILE) \
425 $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE) \
426 $(INTERNAL_PLATFORM_TEST_EXACT_API_FILE)
427 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
429 # ==== the complete hidden api list ===================================
430 include $(CLEAR_VARS)
432 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
433 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
434 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
435 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
436 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
437 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
438 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
439 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
440 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
442 LOCAL_MODULE := hidden-api-list
444 LOCAL_DROIDDOC_OPTIONS:=\
445 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
448 -showAnnotation android.annotation.SystemApi \
449 -showAnnotation android.annotation.TestApi \
450 -dexApi $(INTERNAL_PLATFORM_DEX_API_FILE) \
451 -privateDexApi $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
452 -removedDexApi $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) \
455 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
457 LOCAL_UNINSTALLABLE_MODULE := true
459 include $(BUILD_DROIDDOC)
461 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_DEX_API_FILE) \
462 $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
463 $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
465 # ==== check javadoc comments but don't generate docs ========
466 include $(CLEAR_VARS)
468 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
469 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
470 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
471 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
472 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
473 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
474 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
475 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
476 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
478 LOCAL_MODULE := doc-comment-check
480 LOCAL_DROIDDOC_OPTIONS:=\
481 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
485 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
487 LOCAL_UNINSTALLABLE_MODULE := true
489 include $(BUILD_DROIDDOC)
491 # Run this for checkbuild
492 checkbuild: doc-comment-check-docs
493 # Check comment when you are updating the API
494 update-api: doc-comment-check-docs
496 # ==== static html in the sdk ==================================
497 include $(CLEAR_VARS)
499 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
500 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
501 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
502 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
503 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
504 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
505 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
506 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
507 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
509 LOCAL_MODULE := offline-sdk
511 LOCAL_DROIDDOC_OPTIONS:=\
512 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
514 -title "Android SDK" \
515 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
516 -sdkvalues $(OUT_DOCS) \
517 -hdf android.whichdoc offline
519 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
521 include $(BUILD_DROIDDOC)
523 static_doc_index_redirect := $(out_dir)/index.html
524 $(static_doc_index_redirect): \
525 $(LOCAL_PATH)/docs/docs-preview-index.html | $(ACP)
526 $(hide) mkdir -p $(dir $@)
529 $(full_target): $(static_doc_index_redirect)
532 # ==== Public API static reference docs ==================================
533 include $(CLEAR_VARS)
535 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
536 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
537 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
538 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
539 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
540 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
541 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
542 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
543 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
545 LOCAL_MODULE := offline-sdk-referenceonly
547 LOCAL_DROIDDOC_OPTIONS:=\
548 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
550 -title "Android SDK" \
551 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
552 -sdkvalues $(OUT_DOCS) \
553 -hdf android.whichdoc offline \
556 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
558 include $(BUILD_DROIDDOC)
560 static_doc_index_redirect := $(out_dir)/index.html
561 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
562 $(copy-file-to-target)
564 static_doc_properties := $(out_dir)/source.properties
565 $(static_doc_properties): \
566 $(LOCAL_PATH)/docs/source.properties | $(ACP)
567 $(hide) mkdir -p $(dir $@)
570 $(full_target): $(static_doc_index_redirect)
571 $(full_target): $(static_doc_properties)
574 # ==== System API static reference docs ==================================
575 include $(CLEAR_VARS)
577 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
578 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
579 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
580 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
581 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
582 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
583 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
584 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
585 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
587 LOCAL_MODULE := offline-system-sdk-referenceonly
589 LOCAL_DROIDDOC_OPTIONS:=\
590 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
591 -hide 101 -hide 104 -hide 108 \
592 -showAnnotation android.annotation.SystemApi \
594 -title "Android System SDK" \
595 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
596 -sdkvalues $(OUT_DOCS) \
597 -hdf android.whichdoc offline \
600 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
602 include $(BUILD_DROIDDOC)
604 static_doc_index_redirect := $(out_dir)/index.html
605 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
606 $(copy-file-to-target)
608 static_doc_properties := $(out_dir)/source.properties
609 $(static_doc_properties): \
610 $(LOCAL_PATH)/docs/source.properties | $(ACP)
611 $(hide) mkdir -p $(dir $@)
614 $(full_target): $(static_doc_index_redirect)
615 $(full_target): $(static_doc_properties)
616 $(full_target): $(framework_built)
619 # ==== docs for the web (on the androiddevdocs app engine server) =======================
620 include $(CLEAR_VARS)
622 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
623 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
624 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
625 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
626 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
627 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
628 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
629 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
630 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
631 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
632 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
634 LOCAL_MODULE := online-sdk
636 LOCAL_DROIDDOC_OPTIONS:= \
637 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
639 -hdf android.whichdoc online \
641 -hdf android.hasSamples true \
642 -samplesdir $(samples_dir)
644 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
646 include $(BUILD_DROIDDOC)
648 # ==== docs for the web (on the androiddevdocs app engine server) =======================
649 include $(CLEAR_VARS)
651 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
652 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
653 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
654 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
655 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
656 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
657 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
658 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
659 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
660 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
661 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
663 LOCAL_MODULE := online-system-api-sdk
665 LOCAL_DROIDDOC_OPTIONS:= \
666 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
668 -showAnnotation android.annotation.SystemApi \
669 -title "Android SDK - Including system APIs." \
674 -hdf android.whichdoc online \
676 -hdf android.hasSamples true \
677 -samplesdir $(samples_dir)
679 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
681 LOCAL_UNINSTALLABLE_MODULE := true
683 include $(BUILD_DROIDDOC)
685 # ==== docs for the web (on the devsite app engine server) =======================
686 include $(CLEAR_VARS)
687 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
688 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
689 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
690 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
691 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
692 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
693 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
694 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
695 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
696 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
697 # specify a second html input dir and an output path relative to OUT_DIR)
698 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
702 LOCAL_DROIDDOC_OPTIONS:= \
703 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
705 -hdf android.whichdoc online \
709 -hdf android.hasSamples true \
710 -samplesdir $(samples_dir)
712 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
714 include $(BUILD_DROIDDOC)
716 # ==== docs for the web (on the devsite app engine server) =======================
717 include $(CLEAR_VARS)
718 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
719 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
720 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
721 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
722 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
723 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
724 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
725 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
726 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
727 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
728 # specify a second html input dir and an output path relative to OUT_DIR)
729 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
731 LOCAL_MODULE := ds-static
733 LOCAL_DROIDDOC_OPTIONS:= \
734 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
735 -hdf android.whichdoc online \
741 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
743 include $(BUILD_DROIDDOC)
745 # ==== generates full navtree for resolving @links in ds postprocessing ====
746 include $(CLEAR_VARS)
748 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
749 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
750 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
751 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
752 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
753 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
754 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
755 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
756 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
758 LOCAL_MODULE := ds-ref-navtree
760 LOCAL_DROIDDOC_OPTIONS:= \
761 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
762 -hdf android.whichdoc online \
767 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
769 include $(BUILD_DROIDDOC)
771 # ==== site updates for docs (on the androiddevdocs app engine server) =======================
772 include $(CLEAR_VARS)
774 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
775 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
776 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
777 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
778 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
779 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
780 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
781 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
782 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
783 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
784 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
786 LOCAL_MODULE := online-sdk-dev
788 LOCAL_DROIDDOC_OPTIONS:= \
789 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
791 -hdf android.whichdoc online \
793 -hdf android.hasSamples true \
794 -samplesdir $(samples_dir)
796 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
798 include $(BUILD_DROIDDOC)
800 # ==== docs that have all of the stuff that's @hidden =======================
801 include $(CLEAR_VARS)
803 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
804 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
805 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
806 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
807 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
808 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
809 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
810 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
811 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
813 LOCAL_MODULE := hidden
814 LOCAL_DROIDDOC_OPTIONS:=\
815 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
817 -title "Android SDK - Including hidden APIs."
820 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
822 include $(BUILD_DROIDDOC)
824 # ==== java proto host library ==============================
825 include $(CLEAR_VARS)
826 LOCAL_MODULE := platformprotos
827 LOCAL_PROTOC_OPTIMIZE_TYPE := full
828 LOCAL_PROTOC_FLAGS := \
829 -Iexternal/protobuf/src
830 LOCAL_SOURCE_FILES_ALL_GENERATED := true
832 cmds/am/proto/instrumentation_data.proto \
833 cmds/statsd/src/perfetto/perfetto_config.proto \
834 $(call all-proto-files-under, core/proto) \
835 $(call all-proto-files-under, libs/incident/proto) \
836 $(call all-proto-files-under, cmds/statsd/src)
838 LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
839 include $(BUILD_HOST_JAVA_LIBRARY)
841 # ==== java proto device library (for test only) ==============================
842 include $(CLEAR_VARS)
843 LOCAL_MODULE := platformprotosnano
844 LOCAL_MODULE_TAGS := tests
845 LOCAL_PROTOC_OPTIMIZE_TYPE := nano
846 LOCAL_PROTOC_FLAGS := \
847 -Iexternal/protobuf/src
848 LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
849 store_unknown_fields = true
850 LOCAL_SDK_VERSION := current
852 $(call all-proto-files-under, core/proto) \
853 $(call all-proto-files-under, libs/incident/proto/android/os)
854 include $(BUILD_STATIC_JAVA_LIBRARY)
857 # ==== java proto device library (for test only) ==============================
858 include $(CLEAR_VARS)
859 LOCAL_MODULE := platformprotoslite
860 LOCAL_MODULE_TAGS := tests
861 LOCAL_PROTOC_OPTIMIZE_TYPE := lite
862 LOCAL_PROTOC_FLAGS := \
863 -Iexternal/protobuf/src
865 $(call all-proto-files-under, core/proto) \
866 $(call all-proto-files-under, libs/incident/proto/android/os)
867 # Protos have lots of MissingOverride and similar.
868 LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks
869 include $(BUILD_STATIC_JAVA_LIBRARY)
871 # ==== hiddenapi lists =======================================
872 include $(CLEAR_VARS)
874 # File names of final API lists
875 LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
876 LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
877 LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
879 # File names of source files we will use to generate the final API lists.
880 LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
881 LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
882 LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
883 LOCAL_SRC_PUBLIC_API := $(INTERNAL_PLATFORM_DEX_API_FILE)
884 LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
885 LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
888 $(LOCAL_SRC_GREYLIST) \
889 $(LOCAL_SRC_VENDOR_LIST) \
890 $(LOCAL_SRC_FORCE_BLACKLIST) \
891 $(LOCAL_SRC_PUBLIC_API) \
892 $(LOCAL_SRC_PRIVATE_API) \
893 $(LOCAL_SRC_REMOVED_API)
895 define assert-has-no-overlap
896 if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
897 echo "$(1) and $(2) should not overlap" 1>&2; \
898 comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
903 define assert-is-subset
904 if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
905 echo "$(1) must be a subset of $(2)" 1>&2; \
906 comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
911 define assert-has-no-duplicates
912 if [ ! -z "`sort $(1) | uniq -D`" ]; then \
913 echo "$(1) has duplicate entries" 1>&2; \
914 sort $(1) | uniq -D 1>&2; \
919 # The following rules build API lists in the build folder.
920 # By not using files from the source tree, ART buildbots can mock these lists
921 # or have alternative rules for building them. Other rules in the build system
922 # should depend on the files in the build folder.
924 # Merge light greylist from multiple files:
925 # (1) manual greylist LOCAL_SRC_GREYLIST
926 # (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
927 # (3) list of removed APIs in LOCAL_SRC_REMOVED_API
928 # @removed does not imply private in Doclava. We must take the subset also
929 # in LOCAL_SRC_PRIVATE_API.
930 # (4) list of serialization APIs
931 # Automatically adds all methods which match the signatures in
932 # REGEX_SERIALIZATION. These are greylisted in order to allow applications
933 # to write their own serializers.
934 $(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
935 "readObject\(Ljava/io/ObjectInputStream;\)V" \
936 "readObjectNoData\(\)V" \
937 "readResolve\(\)Ljava/lang/Object;" \
938 "serialVersionUID:J" \
939 "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
940 "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
941 "writeReplace\(\)Ljava/lang/Object;"
942 $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
943 sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \
944 <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
945 $(LOCAL_SRC_PRIVATE_API)) \
946 <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
948 $(call assert-has-no-duplicates,$@)
949 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
950 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
952 # Generate dark greylist as remaining classes and class members in the same
953 # package as classes listed in the light greylist.
954 # The algorithm is as follows:
955 # (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
956 # (2) strip everything after the last forward-slash,
957 # e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/'
958 # (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package
959 # name but do not contain another forward-slash in the class name, e.g.
960 # matching '^Lpackage/subpackage/[^/;]*;'
961 # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
962 $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
963 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
964 <(cat $(LOCAL_SRC_PUBLIC_API) $(LOCAL_LIGHT_GREYLIST) | \
965 sed 's/\->.*//' | sed 's/\(.*\/\).*/\1/' | sort | uniq | \
966 while read PKG_NAME; do \
967 grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \
968 done | sort | uniq) \
970 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
971 $(call assert-has-no-duplicates,$@)
972 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
973 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
975 # Generate blacklist as private API minus (light greylist plus dark greylist).
976 $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
977 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
978 <(sort $(LOCAL_SRC_PRIVATE_API)) \
980 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
981 $(call assert-has-no-duplicates,$@)
982 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
983 $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
984 $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
986 # Include subdirectory makefiles
987 # ============================================================
989 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
990 # team really wants is to build the stuff defined by this makefile.
991 ifeq (,$(ONE_SHOT_MAKEFILE))
992 include $(call first-makefiles-under,$(LOCAL_PATH))
995 endif # ANDROID_BUILD_EMBEDDED