OSDN Git Service

Merge "Add ability to log last 2 digits of dialed numbers in userdebug builds." am...
[android-x86/frameworks-base.git] / Android.mk
1 #
2 # Copyright (C) 2008 The Android Open Source Project
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 LOCAL_PATH := $(call my-dir)
17
18 # Load framework-specific path mappings used later in the build.
19 include $(LOCAL_PATH)/pathmap.mk
20
21 # Build the master framework library.
22 # The framework contains too many method references (>64K) for poor old DEX.
23 # So we first build the framework as a monolithic static library then split it
24 # up into smaller pieces.
25 # ============================================================
26
27 # embedded builds use nothing in frameworks/base
28 ifneq ($(ANDROID_BUILD_EMBEDDED),true)
29
30 # Copy AIDL files to be preprocessed and included in the SDK,
31 # specified relative to the root of the build tree.
32 # ============================================================
33 include $(CLEAR_VARS)
34
35 aidl_parcelables :=
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: $$@
41         rm -f $$@
42         $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
43 endef
44
45 $(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
46   $(eval $(call stubs-to-aidl-parcelables,$(stubs))))
47
48 gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
49 .KATI_RESTAT: $(gen)
50 $(gen): $(aidl_parcelables)
51         @echo Combining SDK parcelables: $@
52         rm -f $@.tmp
53         cat $^ | sort -u > $@.tmp
54         $(call commit-change-for-toc,$@)
55
56 # the documentation
57 # ============================================================
58
59 # TODO: deal with com/google/android/googleapps
60 packages_to_document := \
61   android \
62   javax/microedition/khronos \
63   org/apache/http/conn \
64   org/apache/http/params \
65
66 # include definition of libcore_to_document
67 include libcore/Docs.mk
68
69 non_base_dirs := \
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 \
74
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, \
79     $(non_base_dirs) \
80   )
81
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 += \
85   $(addprefix ../../,\
86     $(filter \
87       $(foreach dir,$(FRAMEWORKS_BASE_JAVA_SRC_DIRS),\
88         $(foreach package,$(packages_to_document),\
89           $(dir)/$(package)/%.java)),\
90       $(SOONG_FRAMEWORK_SRCS)))
91
92 # Find all generated files that were used to compile framework.jar
93 files_to_check_apis_generated := \
94   $(filter $(OUT_DIR)/%,\
95     $(SOONG_FRAMEWORK_SRCS))
96
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,\
102     test-base/src \
103     test-mock/src \
104     test-runner/src)
105
106 # These are relative to frameworks/base
107 html_dirs := \
108         $(FRAMEWORKS_BASE_SUBDIRS) \
109         $(non_base_dirs) \
110
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)) \
115
116 # These are relative to frameworks/base
117 framework_docs_LOCAL_SRC_FILES := \
118   $(files_to_document) \
119   $(common_src_files) \
120
121 # These are relative to frameworks/base
122 framework_docs_LOCAL_API_CHECK_SRC_FILES := \
123   $(files_to_check_apis) \
124   $(common_src_files) \
125
126 # This is used by ide.mk as the list of source files that are
127 # always included.
128 INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
129
130 framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
131         $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
132
133 framework_docs_LOCAL_SRCJARS := $(SOONG_FRAMEWORK_SRCJARS)
134
135 framework_docs_LOCAL_GENERATED_SOURCES := \
136   $(libcore_to_document_generated) \
137   $(files_to_check_apis_generated) \
138
139 framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES := \
140         core-oj \
141         core-libart \
142         conscrypt \
143         bouncycastle \
144         okhttp \
145         ext \
146         framework \
147         voip-common \
148
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)
154
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.
159 #
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 := \
163     -android \
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
173 # Convert an sdk level to a "since" argument.
174 since-arg = -since $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(1)/public/api/android.*) $(1)
175
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))
181
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)
186 endif
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
190
191 framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
192         $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
193
194 framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
195         $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
196
197 framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
198     frameworks/base/docs/knowntags.txt \
199     $(libcore_to_document_generated)
200
201 samples_dir := development/samples/browseable
202
203 # Whitelist of valid groups, used for default TOC grouping. Each sample must
204 # belong to one (and only one) group. Assign samples to groups by setting
205 # a sample.group var to one of these groups in the sample's _index.jd.
206 sample_groups := -samplegroup Admin \
207                  -samplegroup Background \
208                  -samplegroup Connectivity \
209                  -samplegroup Content \
210                  -samplegroup Input \
211                  -samplegroup Media \
212                  -samplegroup Notification \
213                  -samplegroup RenderScript \
214                  -samplegroup Security \
215                  -samplegroup Sensors \
216                  -samplegroup System \
217                  -samplegroup Testing \
218                  -samplegroup UI \
219                  -samplegroup Views \
220                  -samplegroup Wearable
221
222 ## SDK version identifiers used in the published docs
223   # major[.minor] version for current SDK. (full releases only)
224 framework_docs_SDK_VERSION:=7.0
225   # release version (ie "Release x")  (full releases only)
226 framework_docs_SDK_REL_ID:=1
227
228 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
229                 -hdf dac true \
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) \
234                 -hdf sdk.preview 0 \
235                 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
236                 -resourcesoutdir reference/android/images/
237
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
242
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
247
248 # ====  Public API diff ===========================
249 include $(CLEAR_VARS)
250
251 LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
252 LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
253 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
254 LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
255 LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
256 LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
257 LOCAL_ADDITIONAL_DEPENDENCIES := \
258         $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
259         $(INTERNAL_PLATFORM_API_FILE)
260
261 LOCAL_MODULE := offline-sdk-referenceonly
262
263 last_released_sdk_version := $(lastword $(call numerically_sort, \
264                         $(filter-out current, \
265                                 $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
266                          )\
267                 ))
268
269 LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_API_DIR)/$(last_released_sdk_version)
270 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_API_FILE))
271
272 include $(BUILD_APIDIFF)
273
274 # Hack to get diffs included in docs output
275 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
276 $(out_zip): $(full_target)
277
278 # ====  System API diff ===========================
279 include $(CLEAR_VARS)
280
281 LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
282 LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
283 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
284 LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
285 LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
286 LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
287 LOCAL_ADDITIONAL_DEPENDENCIES := \
288         $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
289         $(INTERNAL_PLATFORM_SYSTEM_API_FILE)
290
291 LOCAL_MODULE := offline-system-sdk-referenceonly
292
293 last_released_sdk_version := $(lastword $(call numerically_sort, \
294                         $(filter-out current, \
295                                 $(patsubst $(SRC_SYSTEM_API_DIR)/%.txt,%, $(wildcard $(SRC_SYSTEM_API_DIR)/*.txt)) \
296                          )\
297                 ))
298
299 LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_SYSTEM_API_DIR)/$(last_released_sdk_version)
300 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_SYSTEM_API_FILE))
301
302 include $(BUILD_APIDIFF)
303
304 # Hack to get diffs included in docs output
305 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
306 $(out_zip): $(full_target)
307
308 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
309 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
310 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
311
312 # ====  the complete hidden api list ===================================
313 include $(CLEAR_VARS)
314
315 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
316 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
317 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
318 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
319 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
320 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
321 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
322 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
323 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
324
325 LOCAL_MODULE := hidden-api-list
326
327 LOCAL_DROIDDOC_OPTIONS:=\
328                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
329                 -referenceonly \
330                 -showUnannotated \
331                 -showAnnotation android.annotation.SystemApi \
332                 -showAnnotation android.annotation.TestApi \
333                 -privateDexApi $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
334                 -nodocs
335
336 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
337
338 LOCAL_UNINSTALLABLE_MODULE := true
339
340 include $(BUILD_DROIDDOC)
341
342 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
343
344 # ====  check javadoc comments but don't generate docs ========
345 include $(CLEAR_VARS)
346
347 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
348 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
349 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
350 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
351 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
352 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
353 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
354 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
355 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
356
357 LOCAL_MODULE := doc-comment-check
358
359 LOCAL_DROIDDOC_OPTIONS:=\
360                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
361                 -referenceonly \
362                 -parsecomments
363
364 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
365
366 LOCAL_UNINSTALLABLE_MODULE := true
367
368 include $(BUILD_DROIDDOC)
369
370 # Run this for checkbuild
371 checkbuild: doc-comment-check-docs
372 # Check comment when you are updating the API
373 update-api: doc-comment-check-docs
374
375 # ====  static html in the sdk ==================================
376 include $(CLEAR_VARS)
377
378 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
379 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
380 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
381 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
382 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
383 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
384 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
385 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
386 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
387
388 LOCAL_MODULE := offline-sdk
389
390 LOCAL_DROIDDOC_OPTIONS:=\
391                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
392                 -offlinemode \
393                 -title "Android SDK" \
394                 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
395                 -sdkvalues $(OUT_DOCS) \
396                 -hdf android.whichdoc offline
397
398 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
399
400 include $(BUILD_DROIDDOC)
401
402 static_doc_index_redirect := $(out_dir)/index.html
403 $(static_doc_index_redirect): \
404         $(LOCAL_PATH)/docs/docs-preview-index.html | $(ACP)
405         $(hide) mkdir -p $(dir $@)
406         $(hide) $(ACP) $< $@
407
408 $(full_target): $(static_doc_index_redirect)
409
410
411 # ==== Public API static reference docs ==================================
412 include $(CLEAR_VARS)
413
414 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
415 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
416 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
417 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
418 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
419 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
420 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
421 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
422 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
423
424 LOCAL_MODULE := offline-sdk-referenceonly
425
426 LOCAL_DROIDDOC_OPTIONS:=\
427                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
428                 -offlinemode \
429                 -title "Android SDK" \
430                 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
431                 -sdkvalues $(OUT_DOCS) \
432                 -hdf android.whichdoc offline \
433                 -referenceonly
434
435 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
436
437 include $(BUILD_DROIDDOC)
438
439 static_doc_index_redirect := $(out_dir)/index.html
440 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
441         $(copy-file-to-target)
442
443 static_doc_properties := $(out_dir)/source.properties
444 $(static_doc_properties): \
445         $(LOCAL_PATH)/docs/source.properties | $(ACP)
446         $(hide) mkdir -p $(dir $@)
447         $(hide) $(ACP) $< $@
448
449 $(full_target): $(static_doc_index_redirect)
450 $(full_target): $(static_doc_properties)
451
452
453 # ==== System API static reference docs ==================================
454 include $(CLEAR_VARS)
455
456 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
457 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
458 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
459 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
460 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
461 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
462 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
463 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
464 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
465
466 LOCAL_MODULE := offline-system-sdk-referenceonly
467
468 LOCAL_DROIDDOC_OPTIONS:=\
469                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
470                 -hide 101 -hide 104 -hide 108 \
471                 -showAnnotation android.annotation.SystemApi \
472                 -offlinemode \
473                 -title "Android System SDK" \
474                 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
475                 -sdkvalues $(OUT_DOCS) \
476                 -hdf android.whichdoc offline \
477                 -referenceonly
478
479 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
480
481 include $(BUILD_DROIDDOC)
482
483 static_doc_index_redirect := $(out_dir)/index.html
484 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
485         $(copy-file-to-target)
486
487 static_doc_properties := $(out_dir)/source.properties
488 $(static_doc_properties): \
489         $(LOCAL_PATH)/docs/source.properties | $(ACP)
490         $(hide) mkdir -p $(dir $@)
491         $(hide) $(ACP) $< $@
492
493 $(full_target): $(static_doc_index_redirect)
494 $(full_target): $(static_doc_properties)
495 $(full_target): $(framework_built)
496
497
498 # ==== docs for the web (on the androiddevdocs app engine server) =======================
499 include $(CLEAR_VARS)
500
501 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
502 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
503 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
504 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
505 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
506 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
507 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
508 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
509 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
510 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
511 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
512
513 LOCAL_MODULE := online-sdk
514
515 LOCAL_DROIDDOC_OPTIONS:= \
516                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
517                 -toroot / \
518                 -hdf android.whichdoc online \
519                 $(sample_groups) \
520                 -hdf android.hasSamples true \
521                 -samplesdir $(samples_dir)
522
523 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
524
525 include $(BUILD_DROIDDOC)
526
527 # ==== docs for the web (on the androiddevdocs app engine server) =======================
528 include $(CLEAR_VARS)
529
530 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
531 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
532 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
533 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
534 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
535 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
536 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
537 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
538 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
539 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
540 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
541
542 LOCAL_MODULE := online-system-api-sdk
543
544 LOCAL_DROIDDOC_OPTIONS:= \
545                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
546                 -referenceonly \
547                 -showAnnotation android.annotation.SystemApi \
548                 -title "Android SDK - Including system APIs." \
549                 -toroot / \
550                 -hide 101 \
551                 -hide 104 \
552                 -hide 108 \
553                 -hdf android.whichdoc online \
554                 $(sample_groups) \
555                 -hdf android.hasSamples true \
556                 -samplesdir $(samples_dir)
557
558 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
559
560 LOCAL_UNINSTALLABLE_MODULE := true
561
562 include $(BUILD_DROIDDOC)
563
564 # ==== docs for the web (on the devsite app engine server) =======================
565 include $(CLEAR_VARS)
566 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
567 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
568 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
569 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
570 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
571 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
572 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
573 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
574 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
575 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
576 # specify a second html input dir and an output path relative to OUT_DIR)
577 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
578
579 LOCAL_MODULE := ds
580
581 LOCAL_DROIDDOC_OPTIONS:= \
582                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
583                 -toroot / \
584                 -hdf android.whichdoc online \
585                 -devsite \
586                 -yamlV2 \
587                 $(sample_groups) \
588                 -hdf android.hasSamples true \
589                 -samplesdir $(samples_dir)
590
591 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
592
593 include $(BUILD_DROIDDOC)
594
595 # ==== docs for the web (on the devsite app engine server) =======================
596 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_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
605 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
606 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
607 # specify a second html input dir and an output path relative to OUT_DIR)
608 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
609
610 LOCAL_MODULE := ds-static
611
612 LOCAL_DROIDDOC_OPTIONS:= \
613                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
614                 -hdf android.whichdoc online \
615                 -staticonly \
616                 -toroot / \
617                 -devsite \
618                 -ignoreJdLinks
619
620 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
621
622 include $(BUILD_DROIDDOC)
623
624 # ==== generates full navtree for resolving @links in ds postprocessing ====
625 include $(CLEAR_VARS)
626
627 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
628 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
629 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
630 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
631 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
632 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
633 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
634 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
635 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
636
637 LOCAL_MODULE := ds-ref-navtree
638
639 LOCAL_DROIDDOC_OPTIONS:= \
640                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
641                 -hdf android.whichdoc online \
642                 -toroot / \
643                 -atLinksNavtree \
644                 -navtreeonly
645
646 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
647
648 include $(BUILD_DROIDDOC)
649
650 # ==== site updates for docs (on the androiddevdocs app engine server) =======================
651 include $(CLEAR_VARS)
652
653 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
654 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
655 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
656 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
657 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
658 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
659 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
660 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
661 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
662 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
663 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
664
665 LOCAL_MODULE := online-sdk-dev
666
667 LOCAL_DROIDDOC_OPTIONS:= \
668                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
669                 -toroot / \
670                 -hdf android.whichdoc online \
671                 $(sample_groups) \
672                 -hdf android.hasSamples true \
673                 -samplesdir $(samples_dir)
674
675 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
676
677 include $(BUILD_DROIDDOC)
678
679 # ==== docs that have all of the stuff that's @hidden =======================
680 include $(CLEAR_VARS)
681
682 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
683 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
684 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
685 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
686 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
687 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
688 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
689 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
690 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
691
692 LOCAL_MODULE := hidden
693 LOCAL_DROIDDOC_OPTIONS:=\
694                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
695                 -referenceonly \
696                 -title "Android SDK - Including hidden APIs."
697 #               -hidden
698
699 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
700
701 include $(BUILD_DROIDDOC)
702
703 # ====  java proto host library  ==============================
704 include $(CLEAR_VARS)
705 LOCAL_MODULE := platformprotos
706 LOCAL_PROTOC_OPTIMIZE_TYPE := full
707 LOCAL_PROTOC_FLAGS := \
708     -Iexternal/protobuf/src
709 LOCAL_SOURCE_FILES_ALL_GENERATED := true
710 LOCAL_SRC_FILES := \
711     cmds/am/proto/instrumentation_data.proto \
712     cmds/statsd/src/perfetto/perfetto_config.proto \
713     $(call all-proto-files-under, core/proto) \
714     $(call all-proto-files-under, libs/incident/proto) \
715     $(call all-proto-files-under, cmds/statsd/src)
716 # b/72714520
717 LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
718 include $(BUILD_HOST_JAVA_LIBRARY)
719
720 # ====  java proto device library (for test only)  ==============================
721 include $(CLEAR_VARS)
722 LOCAL_MODULE := platformprotosnano
723 LOCAL_MODULE_TAGS := tests
724 LOCAL_PROTOC_OPTIMIZE_TYPE := nano
725 LOCAL_PROTOC_FLAGS := \
726     -Iexternal/protobuf/src
727 LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
728     store_unknown_fields = true
729 LOCAL_SDK_VERSION := current
730 LOCAL_SRC_FILES := \
731     $(call all-proto-files-under, core/proto) \
732     $(call all-proto-files-under, libs/incident/proto/android/os)
733 include $(BUILD_STATIC_JAVA_LIBRARY)
734
735
736 # ====  java proto device library (for test only)  ==============================
737 include $(CLEAR_VARS)
738 LOCAL_MODULE := platformprotoslite
739 LOCAL_MODULE_TAGS := tests
740 LOCAL_PROTOC_OPTIMIZE_TYPE := lite
741 LOCAL_PROTOC_FLAGS := \
742     -Iexternal/protobuf/src
743 LOCAL_SRC_FILES := \
744     $(call all-proto-files-under, core/proto) \
745     $(call all-proto-files-under, libs/incident/proto/android/os)
746 # Protos have lots of MissingOverride and similar.
747 LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks
748 include $(BUILD_STATIC_JAVA_LIBRARY)
749
750 # ==== hiddenapi lists =======================================
751
752 # Copy light and dark greylist over into the build folder.
753 # This is for ART buildbots which need to mock these lists and have alternative
754 # rules for building them. Other rules in the build system should depend on the
755 # files in the build folder.
756
757 # Automatically add all methods which match the following signatures.
758 # These need to be greylisted in order to allow applications to write their
759 # own serializers.
760 $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
761     "readObject\(Ljava/io/ObjectInputStream;\)V" \
762     "readObjectNoData\(\)V" \
763     "readResolve\(\)Ljava/lang/Object;" \
764     "serialVersionUID:J" \
765     "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
766     "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
767     "writeReplace\(\)Ljava/lang/Object;"
768 $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
769 # Temporarily merge light greylist from two files. Vendor list will become dark
770 # grey once we remove the UI toast.
771 $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): frameworks/base/config/hiddenapi-light-greylist.txt \
772                                                frameworks/base/config/hiddenapi-vendor-list.txt \
773                                                $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
774         sort frameworks/base/config/hiddenapi-light-greylist.txt \
775              frameworks/base/config/hiddenapi-vendor-list.txt \
776              <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" $(PRIVATE_API)) \
777         > $@
778
779 $(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\
780                             $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)))
781
782 # Generate dark greylist as private API minus (blacklist plus light greylist).
783
784 $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
785 $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
786 $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
787 $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
788                                           $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) \
789                                           $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
790         if [ ! -z "`comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST))`" ]; then \
791                 echo "There should be no overlap between $(LIGHT_GREYLIST) and $(DARK_GREYLIST)" 1>&2; \
792                 comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST)) 1>&2; \
793                 exit 1; \
794         elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST))`" ]; then \
795                 echo "$(LIGHT_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
796                 comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST)) 1>&2; \
797                 exit 2; \
798         elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \
799                 echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
800                 comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST)) 1>&2; \
801                 exit 3; \
802         fi
803         comm -23 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST) $(DARK_GREYLIST)) > $@
804
805 # Include subdirectory makefiles
806 # ============================================================
807
808 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
809 # team really wants is to build the stuff defined by this makefile.
810 ifeq (,$(ONE_SHOT_MAKEFILE))
811 include $(call first-makefiles-under,$(LOCAL_PATH))
812 endif
813
814 endif # ANDROID_BUILD_EMBEDDED
815