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 framework_base_android_test_mock_src_files := \
76 $(call all-java-files-under, test-mock/src/android/test/mock)
78 framework_base_android_test_runner_excluding_mock_src_files := \
79 $(filter-out $(framework_base_android_test_mock_src_files), $(call all-java-files-under, test-runner/src))
81 # Find all files in specific directories (relative to frameworks/base)
82 # to document and check apis
83 files_to_check_apis := \
84 $(call find-other-java-files, \
89 # Find all files in specific packages that were used to compile
90 # framework.jar to document and check apis
91 files_to_check_apis += \
94 $(foreach dir,$(FRAMEWORKS_BASE_JAVA_SRC_DIRS),\
95 $(foreach package,$(packages_to_document),\
96 $(dir)/$(package)/%.java)),\
97 $(SOONG_FRAMEWORK_SRCS)))
99 # Find all generated files that were used to compile framework.jar
100 files_to_check_apis_generated := \
101 $(filter $(OUT_DIR)/%,\
102 $(SOONG_FRAMEWORK_SRCS))
104 # These are relative to frameworks/base
105 # FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
106 files_to_document := \
107 $(files_to_check_apis) \
108 $(call find-other-java-files,\
109 $(addprefix ../../, $(FRAMEWORKS_DATA_BINDING_JAVA_SRC_DIRS)) \
112 # These are relative to frameworks/base
114 $(FRAMEWORKS_BASE_SUBDIRS) \
117 # Common sources for doc check and api check
118 common_src_files := \
119 $(call find-other-html-files, $(html_dirs)) \
120 $(addprefix ../../, $(libcore_to_document)) \
122 # These are relative to frameworks/base
123 framework_docs_LOCAL_SRC_FILES := \
124 $(files_to_document) \
125 $(common_src_files) \
127 # These are relative to frameworks/base
128 framework_docs_LOCAL_API_CHECK_SRC_FILES := \
129 $(framework_base_android_test_mock_src_files) \
130 $(framework_base_android_test_runner_excluding_mock_src_files) \
131 $(files_to_check_apis) \
132 $(common_src_files) \
134 # This is used by ide.mk as the list of source files that are
136 INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
138 framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
139 $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
141 framework_docs_LOCAL_SRCJARS := $(SOONG_FRAMEWORK_SRCJARS)
143 framework_docs_LOCAL_GENERATED_SOURCES := \
144 $(libcore_to_document_generated) \
145 $(files_to_check_apis_generated) \
147 framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES := \
158 # Platform docs can refer to Support Library APIs, but we don't actually build
159 # them as part of the docs target, so we need to include them on the classpath.
160 framework_docs_LOCAL_JAVA_LIBRARIES := \
161 $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES) \
162 $(FRAMEWORKS_SUPPORT_JAVA_LIBRARIES)
164 framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
165 framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html
166 # The since flag (-since N.xml API_LEVEL) is used to add API Level information
167 # to the reference documentation. Must be in order of oldest to newest.
169 # Conscrypt (com.android.org.conscrypt) is an implementation detail and should
170 # not be referenced in the documentation.
171 framework_docs_LOCAL_DROIDDOC_OPTIONS := \
173 -knowntags ./frameworks/base/docs/knowntags.txt \
174 -knowntags ./libcore/known_oj_tags.txt \
175 -manifest ./frameworks/base/core/res/AndroidManifest.xml \
176 -hidePackage com.android.internal \
177 -hidePackage com.android.internal.util \
178 -hidePackage com.android.okhttp \
179 -hidePackage com.android.org.conscrypt \
180 -hidePackage com.android.server
182 # Convert an sdk level to a "since" argument.
183 since-arg = -since $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(1)/public/api/android.*) $(1)
185 finalized_sdks := $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.xml,%,\
186 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.xml))
187 finalized_sdks += $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.txt,%,\
188 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.txt))
189 finalized_sdks := $(call numerically_sort,$(finalized_sdks))
191 framework_docs_LOCAL_DROIDDOC_OPTIONS += $(foreach sdk,$(finalized_sdks),$(call since-arg,$(sdk)))
192 ifneq ($(PLATFORM_VERSION_CODENAME),REL)
193 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
194 -since ./frameworks/base/api/current.txt $(PLATFORM_VERSION_CODENAME)
196 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
197 -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
198 -overview $(LOCAL_PATH)/core/java/overview.html
200 framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
201 $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
203 framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
204 $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
206 framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
207 frameworks/base/docs/knowntags.txt \
208 $(libcore_to_document_generated)
210 samples_dir := development/samples/browseable
212 # Whitelist of valid groups, used for default TOC grouping. Each sample must
213 # belong to one (and only one) group. Assign samples to groups by setting
214 # a sample.group var to one of these groups in the sample's _index.jd.
215 sample_groups := -samplegroup Admin \
216 -samplegroup Background \
217 -samplegroup Connectivity \
218 -samplegroup Content \
221 -samplegroup Notification \
222 -samplegroup RenderScript \
223 -samplegroup Security \
224 -samplegroup Sensors \
225 -samplegroup System \
226 -samplegroup Testing \
229 -samplegroup Wearable
231 ## SDK version identifiers used in the published docs
232 # major[.minor] version for current SDK. (full releases only)
233 framework_docs_SDK_VERSION:=7.0
234 # release version (ie "Release x") (full releases only)
235 framework_docs_SDK_REL_ID:=1
237 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
239 -hdf sdk.codename O \
240 -hdf sdk.preview.version 1 \
241 -hdf sdk.version $(framework_docs_SDK_VERSION) \
242 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
244 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
245 -resourcesoutdir reference/android/images/
247 # Federate Support Library references against local API file.
248 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
249 -federate SupportLib https://developer.android.com \
250 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
253 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
254 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
255 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
257 # ==== check javadoc comments but don't generate docs ========
258 include $(CLEAR_VARS)
260 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
261 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
262 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
263 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
264 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
265 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
266 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
267 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
268 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
270 LOCAL_MODULE := doc-comment-check
272 LOCAL_DROIDDOC_OPTIONS:=\
273 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
277 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
279 LOCAL_UNINSTALLABLE_MODULE := true
281 include $(BUILD_DROIDDOC)
283 # Run this for checkbuild
284 checkbuild: doc-comment-check-docs
285 # Check comment when you are updating the API
286 update-api: doc-comment-check-docs
288 # ==== static html in the sdk ==================================
289 include $(CLEAR_VARS)
291 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
292 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
293 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
294 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
295 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
296 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
297 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
298 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
299 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
301 LOCAL_MODULE := offline-sdk
303 LOCAL_DROIDDOC_OPTIONS:=\
304 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
306 -title "Android SDK" \
307 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
308 -sdkvalues $(OUT_DOCS) \
309 -hdf android.whichdoc offline
311 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
313 include $(BUILD_DROIDDOC)
315 static_doc_index_redirect := $(out_dir)/index.html
316 $(static_doc_index_redirect): \
317 $(LOCAL_PATH)/docs/docs-preview-index.html | $(ACP)
318 $(hide) mkdir -p $(dir $@)
321 $(full_target): $(static_doc_index_redirect)
324 # ==== static html in the sdk ==================================
325 include $(CLEAR_VARS)
327 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
328 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
329 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
330 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
331 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
332 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
333 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
334 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
335 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
337 LOCAL_MODULE := offline-sdk-referenceonly
339 LOCAL_DROIDDOC_OPTIONS:=\
340 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
342 -title "Android SDK" \
343 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
344 -sdkvalues $(OUT_DOCS) \
345 -hdf android.whichdoc offline \
348 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
350 include $(BUILD_DROIDDOC)
352 static_doc_index_redirect := $(out_dir)/index.html
353 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
354 $(copy-file-to-target)
356 static_doc_properties := $(out_dir)/source.properties
357 $(static_doc_properties): \
358 $(LOCAL_PATH)/docs/source.properties | $(ACP)
359 $(hide) mkdir -p $(dir $@)
362 $(full_target): $(static_doc_index_redirect)
363 $(full_target): $(static_doc_properties)
366 # ==== docs for the web (on the androiddevdocs app engine server) =======================
367 include $(CLEAR_VARS)
369 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
370 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
371 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
372 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
373 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
374 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
375 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
376 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
377 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
378 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
379 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
381 LOCAL_MODULE := online-sdk
383 LOCAL_DROIDDOC_OPTIONS:= \
384 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
386 -hdf android.whichdoc online \
388 -hdf android.hasSamples true \
389 -samplesdir $(samples_dir)
391 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
393 include $(BUILD_DROIDDOC)
395 # ==== docs for the web (on the androiddevdocs app engine server) =======================
396 include $(CLEAR_VARS)
398 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
399 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
400 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
401 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
402 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
403 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
404 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
405 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
406 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
407 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
408 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
410 LOCAL_MODULE := online-system-api-sdk
412 LOCAL_DROIDDOC_OPTIONS:= \
413 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
415 -showAnnotation android.annotation.SystemApi \
416 -title "Android SDK - Including system APIs." \
421 -hdf android.whichdoc online \
423 -hdf android.hasSamples true \
424 -samplesdir $(samples_dir)
426 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
428 LOCAL_UNINSTALLABLE_MODULE := true
430 include $(BUILD_DROIDDOC)
432 # ==== docs for the web (on the devsite app engine server) =======================
433 include $(CLEAR_VARS)
434 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
435 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
436 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
437 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
438 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
439 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
440 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
441 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
442 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
443 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
444 # specify a second html input dir and an output path relative to OUT_DIR)
445 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
449 LOCAL_DROIDDOC_OPTIONS:= \
450 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
452 -hdf android.whichdoc online \
455 -hdf android.hasSamples true \
456 -samplesdir $(samples_dir)
458 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
460 include $(BUILD_DROIDDOC)
462 # ==== docs for the web (on the devsite app engine server) =======================
463 include $(CLEAR_VARS)
464 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
465 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
466 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
467 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
468 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
469 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
470 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
471 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
472 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
473 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
474 # specify a second html input dir and an output path relative to OUT_DIR)
475 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
477 LOCAL_MODULE := ds-static
479 LOCAL_DROIDDOC_OPTIONS:= \
480 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
481 -hdf android.whichdoc online \
487 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
489 include $(BUILD_DROIDDOC)
491 # ==== generates full navtree for resolving @links in ds postprocessing ====
492 include $(CLEAR_VARS)
494 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
495 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
496 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
497 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
498 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
499 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
500 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
501 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
502 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
504 LOCAL_MODULE := ds-ref-navtree
506 LOCAL_DROIDDOC_OPTIONS:= \
507 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
508 -hdf android.whichdoc online \
513 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
515 include $(BUILD_DROIDDOC)
517 # ==== site updates for docs (on the androiddevdocs app engine server) =======================
518 include $(CLEAR_VARS)
520 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
521 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
522 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
523 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
524 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
525 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
526 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
527 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
528 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
529 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
530 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
532 LOCAL_MODULE := online-sdk-dev
534 LOCAL_DROIDDOC_OPTIONS:= \
535 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
537 -hdf android.whichdoc online \
539 -hdf android.hasSamples true \
540 -samplesdir $(samples_dir)
542 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
544 include $(BUILD_DROIDDOC)
546 # ==== docs that have all of the stuff that's @hidden =======================
547 include $(CLEAR_VARS)
549 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
550 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
551 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
552 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
553 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
554 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
555 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
556 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
557 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
559 LOCAL_MODULE := hidden
560 LOCAL_DROIDDOC_OPTIONS:=\
561 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
563 -title "Android SDK - Including hidden APIs."
566 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
568 include $(BUILD_DROIDDOC)
570 # ==== java proto host library ==============================
571 include $(CLEAR_VARS)
572 LOCAL_MODULE := platformprotos
573 LOCAL_PROTOC_OPTIMIZE_TYPE := full
574 LOCAL_PROTOC_FLAGS := \
575 -Iexternal/protobuf/src
576 LOCAL_SOURCE_FILES_ALL_GENERATED := true
578 $(call all-proto-files-under, core/proto) \
579 $(call all-proto-files-under, libs/incident/proto)
581 LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
582 include $(BUILD_HOST_JAVA_LIBRARY)
585 # ==== hiddenapi lists =======================================
586 include $(CLEAR_VARS)
588 # File names of final API lists
589 LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
590 LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
591 LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
593 # File names of source files we will use to generate the final API lists.
594 LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
595 LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
596 LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
597 LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
598 LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
601 $(LOCAL_SRC_GREYLIST) \
602 $(LOCAL_SRC_VENDOR_LIST) \
603 $(LOCAL_SRC_FORCE_BLACKLIST) \
604 $(LOCAL_SRC_PRIVATE_API) \
605 $(LOCAL_SRC_REMOVED_API)
607 define assert-has-no-overlap
608 if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
609 echo "$(1) and $(2) should not overlap" 1>&2; \
610 comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
615 define assert-is-subset
616 if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
617 echo "$(1) must be a subset of $(2)" 1>&2; \
618 comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
623 define assert-has-no-duplicates
624 if [ ! -z "`sort $(1) | uniq -D`" ]; then \
625 echo "$(1) has duplicate entries" 1>&2; \
626 sort $(1) | uniq -D 1>&2; \
631 # The following rules build API lists in the build folder.
632 # By not using files from the source tree, ART buildbots can mock these lists
633 # or have alternative rules for building them. Other rules in the build system
634 # should depend on the files in the build folder.
636 # Merge light greylist from multiple files:
637 # (1) manual greylist LOCAL_SRC_GREYLIST
638 # (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
639 # (3) list of removed APIs in LOCAL_SRC_REMOVED_API
640 # @removed does not imply private in Doclava. We must take the subset also
641 # in LOCAL_SRC_PRIVATE_API.
642 # (4) list of serialization APIs
643 # Automatically adds all methods which match the signatures in
644 # REGEX_SERIALIZATION. These are greylisted in order to allow applications
645 # to write their own serializers.
646 $(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
647 "readObject\(Ljava/io/ObjectInputStream;\)V" \
648 "readObjectNoData\(\)V" \
649 "readResolve\(\)Ljava/lang/Object;" \
650 "serialVersionUID:J" \
651 "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
652 "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
653 "writeReplace\(\)Ljava/lang/Object;"
654 $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
655 sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \
656 <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
657 $(LOCAL_SRC_PRIVATE_API)) \
658 <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
660 $(call assert-has-no-duplicates,$@)
661 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
662 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
664 # Generate dark greylist as remaining classes and class members in the same
665 # package as classes listed in the light greylist.
666 # The algorithm is as follows:
667 # (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
668 # (2) strip everything after the last forward-slash,
669 # e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/'
670 # (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package
671 # name but do not contain another forward-slash in the class name, e.g.
672 # matching '^Lpackage/subpackage/[^/;]*;'
673 # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
674 $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
675 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
676 <(sed 's/\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/\(.*\/\).*/\1/' | sort | uniq | \
677 while read PKG_NAME; do \
678 grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \
679 done | sort | uniq) \
681 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
682 $(call assert-has-no-duplicates,$@)
683 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
684 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
686 # Generate blacklist as private API minus (light greylist plus dark greylist).
687 $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
688 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
689 <(sort $(LOCAL_SRC_PRIVATE_API)) \
691 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
692 $(call assert-has-no-duplicates,$@)
693 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
694 $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
695 $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
697 # Build AOSP blacklist
698 # ============================================================
699 include $(CLEAR_VARS)
701 LOCAL_LIGHT_GREYLIST_FILE := frameworks/base/config/hiddenapi-p-light-greylist.txt
702 LOCAL_BLACKLIST_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-aosp-blacklist.txt
704 .PHONY: hiddenapi-aosp-blacklist
705 hiddenapi-aosp-blacklist: $(LOCAL_BLACKLIST_FILE)
707 $(LOCAL_BLACKLIST_FILE): $(LOCAL_LIGHT_GREYLIST_FILE) $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
708 LC_COLLATE=C comm -13 <(sort $(LOCAL_LIGHT_GREYLIST_FILE)) \
709 <(sort $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)) > $@
711 # Include subdirectory makefiles
712 # ============================================================
714 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
715 # team really wants is to build the stuff defined by this makefile.
716 ifeq (,$(ONE_SHOT_MAKEFILE))
717 include $(call first-makefiles-under,$(LOCAL_PATH))
720 endif # ANDROID_BUILD_EMBEDDED