OSDN Git Service

Merge "Fix failure in ExifInterface on certain HEIF files" into pi-dev
[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     -since $(SRC_API_DIR)/1.xml 1 \
173     -since $(SRC_API_DIR)/2.xml 2 \
174     -since $(SRC_API_DIR)/3.xml 3 \
175     -since $(SRC_API_DIR)/4.xml 4 \
176     -since $(SRC_API_DIR)/5.xml 5 \
177     -since $(SRC_API_DIR)/6.xml 6 \
178     -since $(SRC_API_DIR)/7.xml 7 \
179     -since $(SRC_API_DIR)/8.xml 8 \
180     -since $(SRC_API_DIR)/9.xml 9 \
181     -since $(SRC_API_DIR)/10.xml 10 \
182     -since $(SRC_API_DIR)/11.xml 11 \
183     -since $(SRC_API_DIR)/12.xml 12 \
184     -since $(SRC_API_DIR)/13.xml 13 \
185     -since $(SRC_API_DIR)/14.txt 14 \
186     -since $(SRC_API_DIR)/15.txt 15 \
187     -since $(SRC_API_DIR)/16.txt 16 \
188     -since $(SRC_API_DIR)/17.txt 17 \
189     -since $(SRC_API_DIR)/18.txt 18 \
190     -since $(SRC_API_DIR)/19.txt 19 \
191     -since $(SRC_API_DIR)/20.txt 20 \
192     -since $(SRC_API_DIR)/21.txt 21 \
193     -since $(SRC_API_DIR)/22.txt 22 \
194     -since $(SRC_API_DIR)/23.txt 23 \
195     -since $(SRC_API_DIR)/24.txt 24 \
196     -since $(SRC_API_DIR)/25.txt 25 \
197     -since $(SRC_API_DIR)/26.txt 26 \
198     -since $(SRC_API_DIR)/27.txt 27 \
199     -since $(SRC_API_DIR)/28.txt 28 \
200     -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
201     -overview $(LOCAL_PATH)/core/java/overview.html \
202
203 framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
204         $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
205
206 framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
207         $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
208
209 framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
210     frameworks/base/docs/knowntags.txt \
211     $(libcore_to_document_generated)
212
213 samples_dir := development/samples/browseable
214
215 # Whitelist of valid groups, used for default TOC grouping. Each sample must
216 # belong to one (and only one) group. Assign samples to groups by setting
217 # a sample.group var to one of these groups in the sample's _index.jd.
218 sample_groups := -samplegroup Admin \
219                  -samplegroup Background \
220                  -samplegroup Connectivity \
221                  -samplegroup Content \
222                  -samplegroup Input \
223                  -samplegroup Media \
224                  -samplegroup Notification \
225                  -samplegroup RenderScript \
226                  -samplegroup Security \
227                  -samplegroup Sensors \
228                  -samplegroup System \
229                  -samplegroup Testing \
230                  -samplegroup UI \
231                  -samplegroup Views \
232                  -samplegroup Wearable
233
234 ## SDK version identifiers used in the published docs
235   # major[.minor] version for current SDK. (full releases only)
236 framework_docs_SDK_VERSION:=7.0
237   # release version (ie "Release x")  (full releases only)
238 framework_docs_SDK_REL_ID:=1
239
240 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
241                 -hdf dac true \
242                 -hdf sdk.codename O \
243                 -hdf sdk.preview.version 1 \
244                 -hdf sdk.version $(framework_docs_SDK_VERSION) \
245                 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
246                 -hdf sdk.preview 0 \
247                 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
248                 -resourcesoutdir reference/android/images/
249
250 # Federate Support Library references against local API file.
251 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
252                 -federate SupportLib https://developer.android.com \
253                 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
254
255 # Federate AndroidX references against local API file.
256 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
257                 -federate AndroidX https://developer.android.com \
258                 -federationapi AndroidX prebuilts/sdk/current/androidx-api.txt
259
260 # ====  Public API diff ===========================
261 include $(CLEAR_VARS)
262
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)
272
273 LOCAL_MODULE := offline-sdk-referenceonly
274
275 last_released_sdk_version := $(lastword $(call numerically_sort, \
276                         $(filter-out current, \
277                                 $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
278                          )\
279                 ))
280
281 LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_API_DIR)/$(last_released_sdk_version)
282 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_API_FILE))
283
284 include $(BUILD_APIDIFF)
285
286 # Hack to get diffs included in docs output
287 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
288 $(out_zip): $(full_target)
289
290 # ====  System API diff ===========================
291 include $(CLEAR_VARS)
292
293 LOCAL_SRC_FILES := $(framework_docs_LOCAL_API_CHECK_SRC_FILES)
294 LOCAL_GENERATED_SOURCES := $(framework_docs_LOCAL_GENERATED_SOURCES)
295 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
296 LOCAL_JAVA_LIBRARIES := $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
297 LOCAL_MODULE_CLASS := $(framework_docs_LOCAL_MODULE_CLASS)
298 LOCAL_ADDITIONAL_JAVA_DIR := $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
299 LOCAL_ADDITIONAL_DEPENDENCIES := \
300         $(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES) \
301         $(INTERNAL_PLATFORM_SYSTEM_API_FILE)
302
303 LOCAL_MODULE := offline-system-sdk-referenceonly
304
305 last_released_sdk_version := $(lastword $(call numerically_sort, \
306                         $(filter-out current, \
307                                 $(patsubst $(SRC_SYSTEM_API_DIR)/%.txt,%, $(wildcard $(SRC_SYSTEM_API_DIR)/*.txt)) \
308                          )\
309                 ))
310
311 LOCAL_APIDIFF_OLDAPI := $(LOCAL_PATH)/../../$(SRC_SYSTEM_API_DIR)/$(last_released_sdk_version)
312 LOCAL_APIDIFF_NEWAPI := $(LOCAL_PATH)/../../$(basename $(INTERNAL_PLATFORM_SYSTEM_API_FILE))
313
314 include $(BUILD_APIDIFF)
315
316 # Hack to get diffs included in docs output
317 out_zip := $(OUT_DOCS)/$(LOCAL_MODULE)-docs.zip
318 $(out_zip): $(full_target)
319
320 # ====  the api stubs and current.xml ===========================
321 include $(CLEAR_VARS)
322
323 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
324 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
325 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
326 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
327 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
328 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
329 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
330 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
331 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
332
333 LOCAL_MODULE := api-stubs
334
335 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_stubs_current_intermediates/src
336
337 LOCAL_DROIDDOC_OPTIONS:=\
338                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
339                 -referenceonly \
340                 -api $(INTERNAL_PLATFORM_API_FILE) \
341                 -removedApi $(INTERNAL_PLATFORM_REMOVED_API_FILE) \
342                 -nodocs
343
344 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
345
346 LOCAL_UNINSTALLABLE_MODULE := true
347
348 include $(BUILD_DROIDDOC)
349
350 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_API_FILE) \
351                                           $(INTERNAL_PLATFORM_REMOVED_API_FILE)
352 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
353
354 # ====  the system api stubs ===================================
355 include $(CLEAR_VARS)
356
357 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
358 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
359 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
360 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
361 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
362 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
363 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
364 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
365 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
366
367 LOCAL_MODULE := system-api-stubs
368
369 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_system_stubs_current_intermediates/src
370
371 LOCAL_DROIDDOC_OPTIONS:=\
372                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
373                 -referenceonly \
374                 -showAnnotation android.annotation.SystemApi \
375                 -api $(INTERNAL_PLATFORM_SYSTEM_API_FILE) \
376                 -removedApi $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) \
377                 -exactApi $(INTERNAL_PLATFORM_SYSTEM_EXACT_API_FILE) \
378                 -nodocs
379
380 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
381
382 LOCAL_UNINSTALLABLE_MODULE := true
383
384 include $(BUILD_DROIDDOC)
385
386 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_SYSTEM_API_FILE) \
387                                           $(INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE) \
388                                           $(INTERNAL_PLATFORM_SYSTEM_EXACT_API_FILE)
389 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
390
391 # ====  the test api stubs ===================================
392 include $(CLEAR_VARS)
393
394 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
395 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
396 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
397 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
398 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
399 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
400 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
401 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
402 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
403
404 LOCAL_MODULE := test-api-stubs
405
406 LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_test_stubs_current_intermediates/src
407
408 LOCAL_DROIDDOC_OPTIONS:=\
409                $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
410                -referenceonly \
411                -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_test_stubs_current_intermediates/src \
412                -showAnnotation android.annotation.TestApi \
413                -api $(INTERNAL_PLATFORM_TEST_API_FILE) \
414                -removedApi $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE) \
415                -exactApi $(INTERNAL_PLATFORM_TEST_EXACT_API_FILE) \
416                -nodocs
417
418 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
419
420 LOCAL_UNINSTALLABLE_MODULE := true
421
422 include $(BUILD_DROIDDOC)
423
424 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_TEST_API_FILE) \
425                                           $(INTERNAL_PLATFORM_TEST_REMOVED_API_FILE) \
426                                           $(INTERNAL_PLATFORM_TEST_EXACT_API_FILE)
427 $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
428
429 # ====  the complete hidden api list ===================================
430 include $(CLEAR_VARS)
431
432 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
433 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
434 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
435 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
436 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
437 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
438 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
439 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
440 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
441
442 LOCAL_MODULE := hidden-api-list
443
444 LOCAL_DROIDDOC_OPTIONS:=\
445                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
446                 -referenceonly \
447                 -showUnannotated \
448                 -showAnnotation android.annotation.SystemApi \
449                 -showAnnotation android.annotation.TestApi \
450                 -privateDexApi $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
451                 -removedDexApi $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) \
452                 -nodocs
453
454 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
455
456 LOCAL_UNINSTALLABLE_MODULE := true
457
458 include $(BUILD_DROIDDOC)
459
460 $(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
461                                           $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
462
463 # ====  check javadoc comments but don't generate docs ========
464 include $(CLEAR_VARS)
465
466 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
467 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
468 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
469 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
470 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
471 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
472 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
473 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
474 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
475
476 LOCAL_MODULE := doc-comment-check
477
478 LOCAL_DROIDDOC_OPTIONS:=\
479                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
480                 -referenceonly \
481                 -parsecomments
482
483 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
484
485 LOCAL_UNINSTALLABLE_MODULE := true
486
487 include $(BUILD_DROIDDOC)
488
489 # Run this for checkbuild
490 checkbuild: doc-comment-check-docs
491 # Check comment when you are updating the API
492 update-api: doc-comment-check-docs
493
494 # ====  static html in the sdk ==================================
495 include $(CLEAR_VARS)
496
497 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
498 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
499 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
500 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
501 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
502 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
503 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
504 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
505 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
506
507 LOCAL_MODULE := offline-sdk
508
509 LOCAL_DROIDDOC_OPTIONS:=\
510                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
511                 -offlinemode \
512                 -title "Android SDK" \
513                 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
514                 -sdkvalues $(OUT_DOCS) \
515                 -hdf android.whichdoc offline
516
517 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
518
519 include $(BUILD_DROIDDOC)
520
521 static_doc_index_redirect := $(out_dir)/index.html
522 $(static_doc_index_redirect): \
523         $(LOCAL_PATH)/docs/docs-preview-index.html | $(ACP)
524         $(hide) mkdir -p $(dir $@)
525         $(hide) $(ACP) $< $@
526
527 $(full_target): $(static_doc_index_redirect)
528
529
530 # ==== Public API static reference docs ==================================
531 include $(CLEAR_VARS)
532
533 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
534 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
535 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
536 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
537 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
538 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
539 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
540 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
541 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
542
543 LOCAL_MODULE := offline-sdk-referenceonly
544
545 LOCAL_DROIDDOC_OPTIONS:=\
546                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
547                 -offlinemode \
548                 -title "Android SDK" \
549                 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
550                 -sdkvalues $(OUT_DOCS) \
551                 -hdf android.whichdoc offline \
552                 -referenceonly
553
554 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
555
556 include $(BUILD_DROIDDOC)
557
558 static_doc_index_redirect := $(out_dir)/index.html
559 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
560         $(copy-file-to-target)
561
562 static_doc_properties := $(out_dir)/source.properties
563 $(static_doc_properties): \
564         $(LOCAL_PATH)/docs/source.properties | $(ACP)
565         $(hide) mkdir -p $(dir $@)
566         $(hide) $(ACP) $< $@
567
568 $(full_target): $(static_doc_index_redirect)
569 $(full_target): $(static_doc_properties)
570
571
572 # ==== System API static reference docs ==================================
573 include $(CLEAR_VARS)
574
575 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
576 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
577 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
578 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
579 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
580 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
581 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
582 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
583 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
584
585 LOCAL_MODULE := offline-system-sdk-referenceonly
586
587 LOCAL_DROIDDOC_OPTIONS:=\
588                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
589                 -hide 101 -hide 104 -hide 108 \
590                 -showAnnotation android.annotation.SystemApi \
591                 -offlinemode \
592                 -title "Android System SDK" \
593                 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
594                 -sdkvalues $(OUT_DOCS) \
595                 -hdf android.whichdoc offline \
596                 -referenceonly
597
598 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
599
600 include $(BUILD_DROIDDOC)
601
602 static_doc_index_redirect := $(out_dir)/index.html
603 $(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
604         $(copy-file-to-target)
605
606 static_doc_properties := $(out_dir)/source.properties
607 $(static_doc_properties): \
608         $(LOCAL_PATH)/docs/source.properties | $(ACP)
609         $(hide) mkdir -p $(dir $@)
610         $(hide) $(ACP) $< $@
611
612 $(full_target): $(static_doc_index_redirect)
613 $(full_target): $(static_doc_properties)
614 $(full_target): $(framework_built)
615
616
617 # ==== docs for the web (on the androiddevdocs app engine server) =======================
618 include $(CLEAR_VARS)
619
620 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
621 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
622 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
623 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
624 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
625 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
626 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
627 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
628 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
629 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
630 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
631
632 LOCAL_MODULE := online-sdk
633
634 LOCAL_DROIDDOC_OPTIONS:= \
635                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
636                 -toroot / \
637                 -hdf android.whichdoc online \
638                 $(sample_groups) \
639                 -hdf android.hasSamples true \
640                 -samplesdir $(samples_dir)
641
642 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
643
644 include $(BUILD_DROIDDOC)
645
646 # ==== docs for the web (on the androiddevdocs app engine server) =======================
647 include $(CLEAR_VARS)
648
649 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
650 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
651 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
652 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
653 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
654 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
655 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
656 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
657 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
658 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
659 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
660
661 LOCAL_MODULE := online-system-api-sdk
662
663 LOCAL_DROIDDOC_OPTIONS:= \
664                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
665                 -referenceonly \
666                 -showAnnotation android.annotation.SystemApi \
667                 -title "Android SDK - Including system APIs." \
668                 -toroot / \
669                 -hide 101 \
670                 -hide 104 \
671                 -hide 108 \
672                 -hdf android.whichdoc online \
673                 $(sample_groups) \
674                 -hdf android.hasSamples true \
675                 -samplesdir $(samples_dir)
676
677 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
678
679 LOCAL_UNINSTALLABLE_MODULE := true
680
681 include $(BUILD_DROIDDOC)
682
683 # ==== docs for the web (on the devsite app engine server) =======================
684 include $(CLEAR_VARS)
685 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
686 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
687 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
688 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
689 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
690 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
691 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
692 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
693 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
694 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
695 # specify a second html input dir and an output path relative to OUT_DIR)
696 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
697
698 LOCAL_MODULE := ds
699
700 LOCAL_DROIDDOC_OPTIONS:= \
701                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
702                 -toroot / \
703                 -hdf android.whichdoc online \
704                 -devsite \
705                 -yamlV2 \
706                 $(sample_groups) \
707                 -hdf android.hasSamples true \
708                 -samplesdir $(samples_dir)
709
710 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
711
712 include $(BUILD_DROIDDOC)
713
714 # ==== docs for the web (on the devsite app engine server) =======================
715 include $(CLEAR_VARS)
716 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
717 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
718 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
719 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
720 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
721 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
722 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
723 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
724 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
725 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
726 # specify a second html input dir and an output path relative to OUT_DIR)
727 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
728
729 LOCAL_MODULE := ds-static
730
731 LOCAL_DROIDDOC_OPTIONS:= \
732                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
733                 -hdf android.whichdoc online \
734                 -staticonly \
735                 -toroot / \
736                 -devsite \
737                 -ignoreJdLinks
738
739 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
740
741 include $(BUILD_DROIDDOC)
742
743 # ==== generates full navtree for resolving @links in ds postprocessing ====
744 include $(CLEAR_VARS)
745
746 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
747 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
748 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
749 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
750 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
751 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
752 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
753 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
754 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
755
756 LOCAL_MODULE := ds-ref-navtree
757
758 LOCAL_DROIDDOC_OPTIONS:= \
759                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
760                 -hdf android.whichdoc online \
761                 -toroot / \
762                 -atLinksNavtree \
763                 -navtreeonly
764
765 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
766
767 include $(BUILD_DROIDDOC)
768
769 # ==== site updates for docs (on the androiddevdocs app engine server) =======================
770 include $(CLEAR_VARS)
771
772 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
773 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
774 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
775 LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
776 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
777 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
778 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
779 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
780 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
781 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
782 LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
783
784 LOCAL_MODULE := online-sdk-dev
785
786 LOCAL_DROIDDOC_OPTIONS:= \
787                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
788                 -toroot / \
789                 -hdf android.whichdoc online \
790                 $(sample_groups) \
791                 -hdf android.hasSamples true \
792                 -samplesdir $(samples_dir)
793
794 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
795
796 include $(BUILD_DROIDDOC)
797
798 # ==== docs that have all of the stuff that's @hidden =======================
799 include $(CLEAR_VARS)
800
801 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
802 LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
803 LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
804 LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
805 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
806 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
807 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
808 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
809 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
810
811 LOCAL_MODULE := hidden
812 LOCAL_DROIDDOC_OPTIONS:=\
813                 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
814                 -referenceonly \
815                 -title "Android SDK - Including hidden APIs."
816 #               -hidden
817
818 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
819
820 include $(BUILD_DROIDDOC)
821
822 # ====  java proto host library  ==============================
823 include $(CLEAR_VARS)
824 LOCAL_MODULE := platformprotos
825 LOCAL_PROTOC_OPTIMIZE_TYPE := full
826 LOCAL_PROTOC_FLAGS := \
827     -Iexternal/protobuf/src
828 LOCAL_SOURCE_FILES_ALL_GENERATED := true
829 LOCAL_SRC_FILES := \
830     cmds/am/proto/instrumentation_data.proto \
831     cmds/statsd/src/perfetto/perfetto_config.proto \
832     $(call all-proto-files-under, core/proto) \
833     $(call all-proto-files-under, libs/incident/proto) \
834     $(call all-proto-files-under, cmds/statsd/src)
835 # b/72714520
836 LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
837 include $(BUILD_HOST_JAVA_LIBRARY)
838
839 # ====  java proto device library (for test only)  ==============================
840 include $(CLEAR_VARS)
841 LOCAL_MODULE := platformprotosnano
842 LOCAL_MODULE_TAGS := tests
843 LOCAL_PROTOC_OPTIMIZE_TYPE := nano
844 LOCAL_PROTOC_FLAGS := \
845     -Iexternal/protobuf/src
846 LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
847     store_unknown_fields = true
848 LOCAL_SDK_VERSION := current
849 LOCAL_SRC_FILES := \
850     $(call all-proto-files-under, core/proto) \
851     $(call all-proto-files-under, libs/incident/proto/android/os)
852 include $(BUILD_STATIC_JAVA_LIBRARY)
853
854
855 # ====  java proto device library (for test only)  ==============================
856 include $(CLEAR_VARS)
857 LOCAL_MODULE := platformprotoslite
858 LOCAL_MODULE_TAGS := tests
859 LOCAL_PROTOC_OPTIMIZE_TYPE := lite
860 LOCAL_PROTOC_FLAGS := \
861     -Iexternal/protobuf/src
862 LOCAL_SRC_FILES := \
863     $(call all-proto-files-under, core/proto) \
864     $(call all-proto-files-under, libs/incident/proto/android/os)
865 # Protos have lots of MissingOverride and similar.
866 LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks
867 include $(BUILD_STATIC_JAVA_LIBRARY)
868
869 # ==== hiddenapi lists =======================================
870 include $(CLEAR_VARS)
871
872 # File names of final API lists
873 LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
874 LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
875 LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
876
877 # File names of source files we will use to generate the final API lists.
878 LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
879 LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
880 LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
881 LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
882 LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
883
884 LOCAL_SRC_ALL := \
885         $(LOCAL_SRC_GREYLIST) \
886         $(LOCAL_SRC_VENDOR_LIST) \
887         $(LOCAL_SRC_FORCE_BLACKLIST) \
888         $(LOCAL_SRC_PRIVATE_API) \
889         $(LOCAL_SRC_REMOVED_API)
890
891 define assert-has-no-overlap
892 if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
893         echo "$(1) and $(2) should not overlap" 1>&2; \
894         comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
895         exit 1; \
896 fi
897 endef
898
899 define assert-is-subset
900 if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
901         echo "$(1) must be a subset of $(2)" 1>&2; \
902         comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
903         exit 1; \
904 fi
905 endef
906
907 define assert-has-no-duplicates
908 if [ ! -z "`sort $(1) | uniq -D`" ]; then \
909         echo "$(1) has duplicate entries" 1>&2; \
910         sort $(1) | uniq -D 1>&2; \
911         exit 1; \
912 fi
913 endef
914
915 # The following rules build API lists in the build folder.
916 # By not using files from the source tree, ART buildbots can mock these lists
917 # or have alternative rules for building them. Other rules in the build system
918 # should depend on the files in the build folder.
919
920 # Merge light greylist from multiple files:
921 #  (1) manual greylist LOCAL_SRC_GREYLIST
922 #  (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
923 #  (3) list of removed APIs in LOCAL_SRC_REMOVED_API
924 #      @removed does not imply private in Doclava. We must take the subset also
925 #      in LOCAL_SRC_PRIVATE_API.
926 #  (4) list of serialization APIs
927 #      Automatically adds all methods which match the signatures in
928 #      REGEX_SERIALIZATION. These are greylisted in order to allow applications
929 #      to write their own serializers.
930 $(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
931     "readObject\(Ljava/io/ObjectInputStream;\)V" \
932     "readObjectNoData\(\)V" \
933     "readResolve\(\)Ljava/lang/Object;" \
934     "serialVersionUID:J" \
935     "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
936     "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
937     "writeReplace\(\)Ljava/lang/Object;"
938 $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
939         sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \
940              <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
941                        $(LOCAL_SRC_PRIVATE_API)) \
942              <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
943              > $@
944         $(call assert-has-no-duplicates,$@)
945         $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
946         $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
947
948 # Generate dark greylist as remaining members of classes on the light greylist,
949 # as well as the members of their inner classes.
950 # The algorithm is as follows:
951 #   (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
952 #   (2) strip the final semicolon and anything after (and including) a dollar sign,
953 #       e.g. 'Lpackage/class$inner;' turns into 'Lpackage/class'
954 #   (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the stripped
955 #       descriptor followed by a semi-colon or a dollar sign, e.g. matching a regex
956 #       '^Lpackage/class[;$]'
957 #   (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
958 $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
959         comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
960                  <(sed 's/;\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/$$.*//' | sort | uniq | \
961                        while read CLASS_DESC; do \
962                            grep -E "^$${CLASS_DESC}[;$$]" $(LOCAL_SRC_PRIVATE_API); \
963                        done | sort | uniq) \
964                  > $@
965         $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
966         $(call assert-has-no-duplicates,$@)
967         $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
968         $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
969
970 # Generate blacklist as private API minus (light greylist plus dark greylist).
971 $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
972         comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
973                  <(sort $(LOCAL_SRC_PRIVATE_API)) \
974                  > $@
975         $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
976         $(call assert-has-no-duplicates,$@)
977         $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
978         $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
979         $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
980
981 # Include subdirectory makefiles
982 # ============================================================
983
984 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
985 # team really wants is to build the stuff defined by this makefile.
986 ifeq (,$(ONE_SHOT_MAKEFILE))
987 include $(call first-makefiles-under,$(LOCAL_PATH))
988 endif
989
990 endif # ANDROID_BUILD_EMBEDDED
991