OSDN Git Service

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