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
173 # Convert an sdk level to a "since" argument.
174 since-arg = -since $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(1)/public/api/android.*) $(1)
176 finalized_sdks := $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.xml,%,\
177 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.xml))
178 finalized_sdks += $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.txt,%,\
179 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.txt))
180 finalized_sdks := $(call numerically_sort,$(finalized_sdks))
182 framework_docs_LOCAL_DROIDDOC_OPTIONS += $(foreach sdk,$(finalized_sdks),$(call since-arg,$(sdk)))
183 ifneq ($(PLATFORM_VERSION_CODENAME),REL)
184 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
185 -since ./frameworks/base/api/current.txt $(PLATFORM_VERSION_CODENAME)
187 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
188 -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
189 -overview $(LOCAL_PATH)/core/java/overview.html
191 framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
192 $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
194 framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
195 $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
197 framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
198 frameworks/base/docs/knowntags.txt \
199 $(libcore_to_document_generated)
201 samples_dir := development/samples/browseable
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.
206 sample_groups := -samplegroup Admin \
207 -samplegroup Background \
208 -samplegroup Connectivity \
209 -samplegroup Content \
212 -samplegroup Notification \
213 -samplegroup RenderScript \
214 -samplegroup Security \
215 -samplegroup Sensors \
216 -samplegroup System \
217 -samplegroup Testing \
220 -samplegroup Wearable
222 ## SDK version identifiers used in the published docs
223 # major[.minor] version for current SDK. (full releases only)
224 framework_docs_SDK_VERSION:=7.0
225 # release version (ie "Release x") (full releases only)
226 framework_docs_SDK_REL_ID:=1
228 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
230 -hdf sdk.codename O \
231 -hdf sdk.preview.version 1 \
232 -hdf sdk.version $(framework_docs_SDK_VERSION) \
233 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
235 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
236 -resourcesoutdir reference/android/images/
238 # Federate Support Library references against local API file.
239 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
240 -federate SupportLib https://developer.android.com \
241 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
243 # Federate AndroidX references against local API file.
244 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
245 -federate AndroidX https://developer.android.com \
246 -federationapi AndroidX prebuilts/sdk/current/androidx-api.txt
248 # Get the highest numbered api txt for the given api level.
249 # $(1): the api level (e.g. public, system)
250 define highest_sdk_txt
251 $(HISTORICAL_SDK_VERSIONS_ROOT)/$(lastword $(call numerically_sort, \
253 $(HISTORICAL_SDK_VERSIONS_ROOT)/%,\
255 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/$(1)/api/android.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 # Basename, because apidiff adds .txt internally.
276 LOCAL_APIDIFF_OLDAPI := $(basename $(call highest_sdk_txt,public))
277 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_API_FILE))
279 include $(BUILD_APIDIFF)
281 # Hack to get diffs included in docs output
282 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
283 $(out_zip): $(full_target)
285 # ==== System API diff ===========================
286 include $(CLEAR_VARS)
288 LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
289 LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
290 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
291 LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
292 LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
293 LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
294 LOCAL_ADDITIONAL_DEPENDENCIES := \
295 $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
296 $(INTERNAL_PLATFORM_SYSTEM_API_FILE)
298 LOCAL_MODULE := offline-system-sdk-referenceonly
300 # Basename, because apidiff adds .txt internally.
301 LOCAL_APIDIFF_OLDAPI := $(basename $(call highest_sdk_txt,system))
302 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_SYSTEM_API_FILE))
304 include $(BUILD_APIDIFF)
306 # Hack to get diffs included in docs output
307 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
308 $(out_zip): $(full_target)
310 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
311 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
312 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
314 # ==== check javadoc comments but don't generate docs ========
315 include $(CLEAR_VARS)
317 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
318 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
319 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
320 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
321 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
322 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
323 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
324 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
325 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
327 LOCAL_MODULE := doc-comment-check
329 LOCAL_DROIDDOC_OPTIONS:=\
330 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
334 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
336 LOCAL_UNINSTALLABLE_MODULE := true
338 include $(BUILD_DROIDDOC)
340 # Run this for checkbuild
341 checkbuild: doc-comment-check-docs
342 # Check comment when you are updating the API
343 update-api: doc-comment-check-docs
345 # ==== static html in the sdk ==================================
346 include $(CLEAR_VARS)
348 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
349 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
350 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
351 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
352 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
353 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
354 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
355 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
356 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
358 LOCAL_MODULE := offline-sdk
360 LOCAL_DROIDDOC_OPTIONS:=\
361 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
363 -title "Android SDK" \
364 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
365 -sdkvalues $(OUT_DOCS) \
366 -hdf android.whichdoc offline
368 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
370 include $(BUILD_DROIDDOC)
372 static_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 $@)
378 $(full_target): $(static_doc_index_redirect)
381 # ==== Public API static reference docs ==================================
382 include $(CLEAR_VARS)
384 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
385 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
386 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
387 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
388 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
389 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
390 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
391 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
392 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
394 LOCAL_MODULE := offline-sdk-referenceonly
396 LOCAL_DROIDDOC_OPTIONS:=\
397 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
399 -title "Android SDK" \
400 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
401 -sdkvalues $(OUT_DOCS) \
402 -hdf android.whichdoc offline \
405 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
407 include $(BUILD_DROIDDOC)
409 static_doc_index_redirect := $(out_dir)/index.html
410 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
411 $(copy-file-to-target)
413 static_doc_properties := $(out_dir)/source.properties
414 $(static_doc_properties): \
415 $(LOCAL_PATH)/docs/source.properties | $(ACP)
416 $(hide) mkdir -p $(dir $@)
419 $(full_target): $(static_doc_index_redirect)
420 $(full_target): $(static_doc_properties)
423 # ==== System API static reference docs ==================================
424 include $(CLEAR_VARS)
426 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
427 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
428 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
429 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
430 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
431 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
432 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
433 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
434 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
436 LOCAL_MODULE := offline-system-sdk-referenceonly
438 LOCAL_DROIDDOC_OPTIONS:=\
439 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
440 -hide 101 -hide 104 -hide 108 \
441 -showAnnotation android.annotation.SystemApi \
443 -title "Android System SDK" \
444 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
445 -sdkvalues $(OUT_DOCS) \
446 -hdf android.whichdoc offline \
449 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
451 include $(BUILD_DROIDDOC)
453 static_doc_index_redirect := $(out_dir)/index.html
454 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
455 $(copy-file-to-target)
457 static_doc_properties := $(out_dir)/source.properties
458 $(static_doc_properties): \
459 $(LOCAL_PATH)/docs/source.properties | $(ACP)
460 $(hide) mkdir -p $(dir $@)
463 $(full_target): $(static_doc_index_redirect)
464 $(full_target): $(static_doc_properties)
465 $(full_target): $(framework_built)
468 # ==== docs for the web (on the androiddevdocs app engine server) =======================
469 include $(CLEAR_VARS)
471 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
472 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
473 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
474 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
475 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
476 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
477 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
478 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
479 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
480 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
481 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
483 LOCAL_MODULE := online-sdk
485 LOCAL_DROIDDOC_OPTIONS:= \
486 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
488 -hdf android.whichdoc online \
490 -hdf android.hasSamples true \
491 -samplesdir $(samples_dir)
493 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
495 include $(BUILD_DROIDDOC)
497 # ==== docs for the web (on the androiddevdocs app engine server) =======================
498 include $(CLEAR_VARS)
500 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
501 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
502 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
503 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
504 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
505 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
506 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
507 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
508 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
509 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
510 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
512 LOCAL_MODULE := online-system-api-sdk
514 LOCAL_DROIDDOC_OPTIONS:= \
515 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
517 -showAnnotation android.annotation.SystemApi \
518 -title "Android SDK - Including system APIs." \
523 -hdf android.whichdoc online \
525 -hdf android.hasSamples true \
526 -samplesdir $(samples_dir)
528 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
530 LOCAL_UNINSTALLABLE_MODULE := true
532 include $(BUILD_DROIDDOC)
534 # ==== docs for the web (on the devsite app engine server) =======================
535 include $(CLEAR_VARS)
536 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
537 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
538 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
539 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
540 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
541 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
542 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
543 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
544 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
545 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
546 # specify a second html input dir and an output path relative to OUT_DIR)
547 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
551 LOCAL_DROIDDOC_OPTIONS:= \
552 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
554 -hdf android.whichdoc online \
558 -hdf android.hasSamples true \
559 -samplesdir $(samples_dir)
561 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
563 include $(BUILD_DROIDDOC)
565 # ==== docs for the web (on the devsite app engine server) =======================
566 include $(CLEAR_VARS)
567 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
568 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
569 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
570 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
571 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
572 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
573 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
574 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
575 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
576 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
577 # specify a second html input dir and an output path relative to OUT_DIR)
578 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
580 LOCAL_MODULE := ds-static
582 LOCAL_DROIDDOC_OPTIONS:= \
583 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
584 -hdf android.whichdoc online \
590 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
592 include $(BUILD_DROIDDOC)
594 # ==== generates full navtree for resolving @links in ds postprocessing ====
595 include $(CLEAR_VARS)
597 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
598 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
599 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
600 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
601 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
602 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
603 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
604 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
605 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
607 LOCAL_MODULE := ds-ref-navtree
609 LOCAL_DROIDDOC_OPTIONS:= \
610 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
611 -hdf android.whichdoc online \
616 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
618 include $(BUILD_DROIDDOC)
620 # ==== site updates for docs (on the androiddevdocs app engine server) =======================
621 include $(CLEAR_VARS)
623 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
624 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
625 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
626 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
627 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
628 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
629 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
630 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
631 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
632 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
633 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
635 LOCAL_MODULE := online-sdk-dev
637 LOCAL_DROIDDOC_OPTIONS:= \
638 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
640 -hdf android.whichdoc online \
642 -hdf android.hasSamples true \
643 -samplesdir $(samples_dir)
645 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
647 include $(BUILD_DROIDDOC)
649 # ==== docs that have all of the stuff that's @hidden =======================
650 include $(CLEAR_VARS)
652 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
653 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
654 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
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)
662 LOCAL_MODULE := hidden
663 LOCAL_DROIDDOC_OPTIONS:=\
664 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
666 -title "Android SDK - Including hidden APIs."
669 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
671 include $(BUILD_DROIDDOC)
673 # ==== java proto device library (for test only) ==============================
674 include $(CLEAR_VARS)
675 LOCAL_MODULE := platformprotosnano
676 LOCAL_MODULE_TAGS := tests
677 LOCAL_PROTOC_OPTIMIZE_TYPE := nano
678 LOCAL_PROTOC_FLAGS := \
679 -Iexternal/protobuf/src
680 LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
681 store_unknown_fields = true
682 LOCAL_SDK_VERSION := current
684 $(call all-proto-files-under, core/proto) \
685 $(call all-proto-files-under, libs/incident/proto/android/os)
686 include $(BUILD_STATIC_JAVA_LIBRARY)
689 # ==== java proto device library (for test only) ==============================
690 include $(CLEAR_VARS)
691 LOCAL_MODULE := platformprotoslite
692 LOCAL_MODULE_TAGS := tests
693 LOCAL_PROTOC_OPTIMIZE_TYPE := lite
694 LOCAL_PROTOC_FLAGS := \
695 -Iexternal/protobuf/src
697 $(call all-proto-files-under, core/proto) \
698 $(call all-proto-files-under, libs/incident/proto/android/os)
699 # Protos have lots of MissingOverride and similar.
700 LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks
701 include $(BUILD_STATIC_JAVA_LIBRARY)
703 # ==== hiddenapi lists =======================================
704 include $(CLEAR_VARS)
706 # File names of final API lists
707 LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
708 LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
709 LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
711 # File names of source files we will use to generate the final API lists.
712 LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
713 LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
714 LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
715 LOCAL_SRC_PUBLIC_API := $(INTERNAL_PLATFORM_DEX_API_FILE)
716 LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
717 LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
720 $(LOCAL_SRC_GREYLIST) \
721 $(LOCAL_SRC_VENDOR_LIST) \
722 $(LOCAL_SRC_FORCE_BLACKLIST) \
723 $(LOCAL_SRC_PUBLIC_API) \
724 $(LOCAL_SRC_PRIVATE_API) \
725 $(LOCAL_SRC_REMOVED_API)
727 define assert-has-no-overlap
728 if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
729 echo "$(1) and $(2) should not overlap" 1>&2; \
730 comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
735 define assert-is-subset
736 if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
737 echo "$(1) must be a subset of $(2)" 1>&2; \
738 comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
743 define assert-has-no-duplicates
744 if [ ! -z "`sort $(1) | uniq -D`" ]; then \
745 echo "$(1) has duplicate entries" 1>&2; \
746 sort $(1) | uniq -D 1>&2; \
751 # The following rules build API lists in the build folder.
752 # By not using files from the source tree, ART buildbots can mock these lists
753 # or have alternative rules for building them. Other rules in the build system
754 # should depend on the files in the build folder.
756 # Merge light greylist from multiple files:
757 # (1) manual greylist LOCAL_SRC_GREYLIST
758 # (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
759 # (3) list of removed APIs in LOCAL_SRC_REMOVED_API
760 # @removed does not imply private in Doclava. We must take the subset also
761 # in LOCAL_SRC_PRIVATE_API.
762 # (4) list of serialization APIs
763 # Automatically adds all methods which match the signatures in
764 # REGEX_SERIALIZATION. These are greylisted in order to allow applications
765 # to write their own serializers.
766 $(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
767 "readObject\(Ljava/io/ObjectInputStream;\)V" \
768 "readObjectNoData\(\)V" \
769 "readResolve\(\)Ljava/lang/Object;" \
770 "serialVersionUID:J" \
771 "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
772 "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
773 "writeReplace\(\)Ljava/lang/Object;"
774 $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
775 sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \
776 <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
777 $(LOCAL_SRC_PRIVATE_API)) \
778 <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
780 $(call assert-has-no-duplicates,$@)
781 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
782 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
784 # Generate dark greylist as remaining classes and class members in the same
785 # package as classes listed in the light greylist.
786 # The algorithm is as follows:
787 # (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
788 # (2) strip everything after the last forward-slash,
789 # e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/'
790 # (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package
791 # name but do not contain another forward-slash in the class name, e.g.
792 # matching '^Lpackage/subpackage/[^/;]*;'
793 # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
794 $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
795 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
796 <(cat $(LOCAL_SRC_PUBLIC_API) $(LOCAL_LIGHT_GREYLIST) | \
797 sed 's/\->.*//' | sed 's/\(.*\/\).*/\1/' | sort | uniq | \
798 while read PKG_NAME; do \
799 grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \
800 done | sort | uniq) \
802 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
803 $(call assert-has-no-duplicates,$@)
804 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
805 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
807 # Generate blacklist as private API minus (light greylist plus dark greylist).
808 $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
809 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
810 <(sort $(LOCAL_SRC_PRIVATE_API)) \
812 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
813 $(call assert-has-no-duplicates,$@)
814 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
815 $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
816 $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
818 # Include subdirectory makefiles
819 # ============================================================
821 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
822 # team really wants is to build the stuff defined by this makefile.
823 ifeq (,$(ONE_SHOT_MAKEFILE))
824 include $(call first-makefiles-under,$(LOCAL_PATH))
827 endif # ANDROID_BUILD_EMBEDDED