blob: eddcadae456b1187ab11ffd5c12c2916d6d47304 [file] [log] [blame]
Bart Searsa8cc0582015-05-07 03:23:20 +00001#
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#
16LOCAL_PATH := $(call my-dir)
17
Colin Cross5f4dcf62017-11-16 00:15:28 -080018# Load framework-specific path mappings used later in the build.
19include $(LOCAL_PATH)/pathmap.mk
Bart Searsa8cc0582015-05-07 03:23:20 +000020
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
28ifneq ($(ANDROID_BUILD_EMBEDDED),true)
29
Bart Searsa8cc0582015-05-07 03:23:20 +000030# Copy AIDL files to be preprocessed and included in the SDK,
31# specified relative to the root of the build tree.
32# ============================================================
33include $(CLEAR_VARS)
34
Colin Cross77ebd082017-12-15 17:30:33 -080035aidl_parcelables :=
36define stubs-to-aidl-parcelables
37 gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl
38 aidl_parcelables += $$(gen)
Colin Crossfdbe7d12018-02-09 11:24:14 -080039 $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables
Colin Cross77ebd082017-12-15 17:30:33 -080040 @echo Extract SDK parcelables: $$@
41 rm -f $$@
42 $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
43endef
44
45$(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
46 $(eval $(call stubs-to-aidl-parcelables,$(stubs))))
47
Bart Searsa8cc0582015-05-07 03:23:20 +000048gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
Colin Cross77ebd082017-12-15 17:30:33 -080049.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,$@)
Bart Searsa8cc0582015-05-07 03:23:20 +000055
56# the documentation
57# ============================================================
58
59# TODO: deal with com/google/android/googleapps
60packages_to_document := \
Colin Cross5f4dcf62017-11-16 00:15:28 -080061 android \
62 javax/microedition/khronos \
63 org/apache/http/conn \
64 org/apache/http/params \
Bart Searsa8cc0582015-05-07 03:23:20 +000065
66# include definition of libcore_to_document
67include libcore/Docs.mk
68
Bart Searsa8cc0582015-05-07 03:23:20 +000069non_base_dirs := \
Colin Cross5f4dcf62017-11-16 00:15:28 -080070 ../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 \
Bart Searsa8cc0582015-05-07 03:23:20 +000074
Paul Duffinc08090f2017-06-29 14:58:43 +010075framework_base_android_test_mock_src_files := \
Paul Duffin69516f42017-11-15 11:39:14 +000076 $(call all-java-files-under, test-mock/src/android/test/mock)
Paul Duffinc08090f2017-06-29 14:58:43 +010077
78framework_base_android_test_runner_excluding_mock_src_files := \
Colin Cross5f4dcf62017-11-16 00:15:28 -080079 $(filter-out $(framework_base_android_test_mock_src_files), $(call all-java-files-under, test-runner/src))
Paul Duffinc08090f2017-06-29 14:58:43 +010080
Colin Cross5f4dcf62017-11-16 00:15:28 -080081# Find all files in specific directories (relative to frameworks/base)
82# to document and check apis
83files_to_check_apis := \
84 $(call find-other-java-files, \
Paul Duffin21418272017-11-16 15:47:05 +000085 test-base/src \
Colin Cross5f4dcf62017-11-16 00:15:28 -080086 $(non_base_dirs) \
87 )
Bart Searsa8cc0582015-05-07 03:23:20 +000088
Colin Cross5f4dcf62017-11-16 00:15:28 -080089# Find all files in specific packages that were used to compile
90# framework.jar to document and check apis
91files_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
Colin Cross0c760952017-12-04 13:45:19 -0800100files_to_check_apis_generated := \
101 $(filter $(OUT_DIR)/%,\
102 $(SOONG_FRAMEWORK_SRCS))
George Mountf6be9932015-12-03 07:39:55 -0800103
Bart Searsa8cc0582015-05-07 03:23:20 +0000104# These are relative to frameworks/base
105# FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
Colin Cross5f4dcf62017-11-16 00:15:28 -0800106files_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)
George Mountf6be9932015-12-03 07:39:55 -0800111
Bart Searsa8cc0582015-05-07 03:23:20 +0000112# These are relative to frameworks/base
113html_dirs := \
114 $(FRAMEWORKS_BASE_SUBDIRS) \
Colin Cross5f4dcf62017-11-16 00:15:28 -0800115 $(non_base_dirs) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000116
117# Common sources for doc check and api check
118common_src_files := \
119 $(call find-other-html-files, $(html_dirs)) \
Colin Cross5f4dcf62017-11-16 00:15:28 -0800120 $(addprefix ../../, $(libcore_to_document)) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000121
122# These are relative to frameworks/base
123framework_docs_LOCAL_SRC_FILES := \
Colin Cross5f4dcf62017-11-16 00:15:28 -0800124 $(files_to_document) \
125 $(common_src_files) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000126
127# These are relative to frameworks/base
128framework_docs_LOCAL_API_CHECK_SRC_FILES := \
Colin Cross5f4dcf62017-11-16 00:15:28 -0800129 $(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) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000133
134# This is used by ide.mk as the list of source files that are
135# always included.
136INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
137
138framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
139 $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
140
Colin Cross5f4dcf62017-11-16 00:15:28 -0800141framework_docs_LOCAL_SRCJARS := $(SOONG_FRAMEWORK_SRCJARS)
142
Colin Cross0c760952017-12-04 13:45:19 -0800143framework_docs_LOCAL_GENERATED_SOURCES := \
144 $(libcore_to_document_generated) \
145 $(files_to_check_apis_generated) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000146
147framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES := \
Piotr Jastrzebskicfa292e2015-02-17 16:58:52 +0000148 core-oj \
Bart Searsa8cc0582015-05-07 03:23:20 +0000149 core-libart \
150 conscrypt \
151 bouncycastle \
152 okhttp \
153 ext \
154 framework \
Paul Duffinc08090f2017-06-29 14:58:43 +0100155 voip-common \
156 android.test.mock \
Bart Searsa8cc0582015-05-07 03:23:20 +0000157
Alan Viverette2d362a52017-04-05 10:21:58 -0400158# 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.
Bart Searsa8cc0582015-05-07 03:23:20 +0000160framework_docs_LOCAL_JAVA_LIBRARIES := \
161 $(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES) \
162 $(FRAMEWORKS_SUPPORT_JAVA_LIBRARIES)
163
164framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
165framework_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.
171framework_docs_LOCAL_DROIDDOC_OPTIONS := \
Jeff Sharkey0f3f60b2017-04-24 18:06:20 -0600172 -android \
Bart Searsa8cc0582015-05-07 03:23:20 +0000173 -knowntags ./frameworks/base/docs/knowntags.txt \
Narayan Kamath2c4f2842015-07-27 14:02:11 +0100174 -knowntags ./libcore/known_oj_tags.txt \
Jeff Sharkeybfc4fcd2017-06-05 17:38:17 -0600175 -manifest ./frameworks/base/core/res/AndroidManifest.xml \
Tobias Thierer97bb6cf2018-03-05 22:55:32 +0000176 -hidePackage com.android.internal \
177 -hidePackage com.android.internal.util \
Jeff Sharkeybc4f48b2017-12-06 21:02:11 -0700178 -hidePackage com.android.okhttp \
Bart Searsa8cc0582015-05-07 03:23:20 +0000179 -hidePackage com.android.org.conscrypt \
Anton Hanssone5bf2062018-04-19 16:23:53 +0100180 -hidePackage com.android.server
181
182# Convert an sdk level to a "since" argument.
183since-arg = -since $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(1)/public/api/android.*) $(1)
184
185finalized_sdks := $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.xml,%,\
186 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.xml))
187finalized_sdks += $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.txt,%,\
188 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.txt))
189finalized_sdks := $(call numerically_sort,$(finalized_sdks))
190
191framework_docs_LOCAL_DROIDDOC_OPTIONS += $(foreach sdk,$(finalized_sdks),$(call since-arg,$(sdk)))
192ifneq ($(PLATFORM_VERSION_CODENAME),REL)
193 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
194 -since ./frameworks/base/api/current.txt $(PLATFORM_VERSION_CODENAME)
195endif
196framework_docs_LOCAL_DROIDDOC_OPTIONS += \
Jeff Sharkey2337aec2017-12-06 21:12:23 -0700197 -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
Anton Hanssone5bf2062018-04-19 16:23:53 +0100198 -overview $(LOCAL_PATH)/core/java/overview.html
Bart Searsa8cc0582015-05-07 03:23:20 +0000199
200framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
201 $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
202
203framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
Alan Viverette2d362a52017-04-05 10:21:58 -0400204 $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
Bart Searsa8cc0582015-05-07 03:23:20 +0000205
206framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
Narayan Kamathc21739a2015-07-14 13:39:23 +0100207 frameworks/base/docs/knowntags.txt \
Colin Cross72d359f2017-10-27 10:46:53 -0700208 $(libcore_to_document_generated)
Bart Searsa8cc0582015-05-07 03:23:20 +0000209
210samples_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.
215sample_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 \
Trevor Johns4cbe3592015-05-27 14:50:51 -0700225 -samplegroup System \
Bart Searsa8cc0582015-05-07 03:23:20 +0000226 -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)
smain@google.comdde8deb2016-08-29 18:36:50 -0700233framework_docs_SDK_VERSION:=7.0
Bart Searsa8cc0582015-05-07 03:23:20 +0000234 # release version (ie "Release x") (full releases only)
235framework_docs_SDK_REL_ID:=1
236
237framework_docs_LOCAL_DROIDDOC_OPTIONS += \
Billy Lamberta75dbc8f2017-03-03 13:09:15 -0800238 -hdf dac true \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700239 -hdf sdk.codename O \
240 -hdf sdk.preview.version 1 \
Bart Searsa8cc0582015-05-07 03:23:20 +0000241 -hdf sdk.version $(framework_docs_SDK_VERSION) \
242 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700243 -hdf sdk.preview 0 \
244 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
245 -resourcesoutdir reference/android/images/
Bart Searsa8cc0582015-05-07 03:23:20 +0000246
Alan Viverette2d362a52017-04-05 10:21:58 -0400247# Federate Support Library references against local API file.
248framework_docs_LOCAL_DROIDDOC_OPTIONS += \
249 -federate SupportLib https://developer.android.com \
250 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
251
Bart Searsa8cc0582015-05-07 03:23:20 +0000252
Bart Searsa8cc0582015-05-07 03:23:20 +0000253$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
Bart Searsa8cc0582015-05-07 03:23:20 +0000254$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
Michael Wrightb2b2c0e2015-11-06 15:21:13 +0000255$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
256
Bart Searsa8cc0582015-05-07 03:23:20 +0000257# ==== check javadoc comments but don't generate docs ========
258include $(CLEAR_VARS)
259
260LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800261LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800262LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000263LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
264LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
265LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
266LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
267LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
268LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
269
270LOCAL_MODULE := doc-comment-check
271
272LOCAL_DROIDDOC_OPTIONS:=\
273 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700274 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000275 -parsecomments
276
Scott Main15b85172017-02-21 14:30:58 -0800277LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000278
279LOCAL_UNINSTALLABLE_MODULE := true
280
281include $(BUILD_DROIDDOC)
282
Bart Searsa8cc0582015-05-07 03:23:20 +0000283# Run this for checkbuild
284checkbuild: doc-comment-check-docs
285# Check comment when you are updating the API
286update-api: doc-comment-check-docs
287
288# ==== static html in the sdk ==================================
289include $(CLEAR_VARS)
290
291LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800292LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800293LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000294LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
295LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
296LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
297LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
298LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
299LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
300
301LOCAL_MODULE := offline-sdk
302
303LOCAL_DROIDDOC_OPTIONS:=\
304 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
305 -offlinemode \
306 -title "Android SDK" \
307 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
smain@google.com00de8c52016-03-07 18:38:08 -0800308 -sdkvalues $(OUT_DOCS) \
smain@google.com8562ab52016-06-14 17:11:57 -0700309 -hdf android.whichdoc offline
310
Scott Main15b85172017-02-21 14:30:58 -0800311LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
smain@google.com8562ab52016-06-14 17:11:57 -0700312
313include $(BUILD_DROIDDOC)
314
315static_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)
smain@google.com8562ab52016-06-14 17:11:57 -0700322
323
324# ==== static html in the sdk ==================================
325include $(CLEAR_VARS)
326
327LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800328LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800329LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
smain@google.com8562ab52016-06-14 17:11:57 -0700330LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
331LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
332LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
333LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
334LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
335LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
336
337LOCAL_MODULE := offline-sdk-referenceonly
338
339LOCAL_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) \
smain@google.com00de8c52016-03-07 18:38:08 -0800345 -hdf android.whichdoc offline \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700346 -referenceonly
smain@google.com00de8c52016-03-07 18:38:08 -0800347
Scott Main15b85172017-02-21 14:30:58 -0800348LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
smain@google.com00de8c52016-03-07 18:38:08 -0800349
350include $(BUILD_DROIDDOC)
351
352static_doc_index_redirect := $(out_dir)/index.html
smain@google.com151833a2016-08-31 08:42:09 -0700353$(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
Dan Willemsen98ff0b72016-03-23 00:42:44 -0700354 $(copy-file-to-target)
smain@google.com00de8c52016-03-07 18:38:08 -0800355
smain@google.com2f2365d2016-09-21 14:05:50 -0700356static_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
smain@google.com00de8c52016-03-07 18:38:08 -0800362$(full_target): $(static_doc_index_redirect)
smain@google.com2f2365d2016-09-21 14:05:50 -0700363$(full_target): $(static_doc_properties)
smain@google.com00de8c52016-03-07 18:38:08 -0800364
smain@google.com7aca8be2016-03-10 14:13:30 -0800365
Bart Searsa8cc0582015-05-07 03:23:20 +0000366# ==== docs for the web (on the androiddevdocs app engine server) =======================
367include $(CLEAR_VARS)
368
369LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800370LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800371LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000372LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
373LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
374LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
375LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
376LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
377LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
378LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
379LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
380
381LOCAL_MODULE := online-sdk
382
383LOCAL_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
Scott Main15b85172017-02-21 14:30:58 -0800391LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000392
393include $(BUILD_DROIDDOC)
394
395# ==== docs for the web (on the androiddevdocs app engine server) =======================
Bart Searsa8cc0582015-05-07 03:23:20 +0000396include $(CLEAR_VARS)
397
398LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800399LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800400LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000401LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
402LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
403LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
404LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
405LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
406LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
407LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
408LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
409
410LOCAL_MODULE := online-system-api-sdk
411
412LOCAL_DROIDDOC_OPTIONS:= \
413 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700414 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000415 -showAnnotation android.annotation.SystemApi \
416 -title "Android SDK - Including system APIs." \
417 -toroot / \
Gina Dimino98ad8882016-05-31 17:25:48 -0700418 -hide 101 \
419 -hide 104 \
420 -hide 108 \
Bart Searsa8cc0582015-05-07 03:23:20 +0000421 -hdf android.whichdoc online \
422 $(sample_groups) \
423 -hdf android.hasSamples true \
424 -samplesdir $(samples_dir)
425
Scott Main15b85172017-02-21 14:30:58 -0800426LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Jeff Sharkey05461c02017-05-09 19:01:09 -0600427
Bart Searsa8cc0582015-05-07 03:23:20 +0000428LOCAL_UNINSTALLABLE_MODULE := true
429
430include $(BUILD_DROIDDOC)
Bart Searsa8cc0582015-05-07 03:23:20 +0000431
432# ==== docs for the web (on the devsite app engine server) =======================
433include $(CLEAR_VARS)
434LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800435LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800436LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000437LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
438LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
439LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
440LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
441LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
442LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
443LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
444# specify a second html input dir and an output path relative to OUT_DIR)
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700445LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
Bart Searsa8cc0582015-05-07 03:23:20 +0000446
447LOCAL_MODULE := ds
448
449LOCAL_DROIDDOC_OPTIONS:= \
450 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000451 -toroot / \
452 -hdf android.whichdoc online \
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700453 -devsite \
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700454 $(sample_groups) \
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700455 -hdf android.hasSamples true \
456 -samplesdir $(samples_dir)
Bart Searsa8cc0582015-05-07 03:23:20 +0000457
Scott Main15b85172017-02-21 14:30:58 -0800458LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000459
460include $(BUILD_DROIDDOC)
461
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700462# ==== docs for the web (on the devsite app engine server) =======================
463include $(CLEAR_VARS)
464LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800465LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800466LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700467LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
468LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
469LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
470LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
471LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
472LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
473LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
474# specify a second html input dir and an output path relative to OUT_DIR)
475LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
476
477LOCAL_MODULE := ds-static
478
479LOCAL_DROIDDOC_OPTIONS:= \
480 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
481 -hdf android.whichdoc online \
482 -staticonly \
483 -toroot / \
484 -devsite \
485 -ignoreJdLinks
486
Scott Main15b85172017-02-21 14:30:58 -0800487LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700488
489include $(BUILD_DROIDDOC)
490
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700491# ==== generates full navtree for resolving @links in ds postprocessing ====
492include $(CLEAR_VARS)
493
494LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800495LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800496LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700497LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
498LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
499LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
500LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
501LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
502LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
503
504LOCAL_MODULE := ds-ref-navtree
505
506LOCAL_DROIDDOC_OPTIONS:= \
507 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
508 -hdf android.whichdoc online \
509 -toroot / \
510 -atLinksNavtree \
511 -navtreeonly
512
Scott Main15b85172017-02-21 14:30:58 -0800513LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700514
515include $(BUILD_DROIDDOC)
516
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800517# ==== site updates for docs (on the androiddevdocs app engine server) =======================
Bart Searsa8cc0582015-05-07 03:23:20 +0000518include $(CLEAR_VARS)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800519
Bart Searsa8cc0582015-05-07 03:23:20 +0000520LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800521LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800522LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000523LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
524LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
525LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
526LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800527LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
Bart Searsa8cc0582015-05-07 03:23:20 +0000528LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
529LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800530LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
Bart Searsa8cc0582015-05-07 03:23:20 +0000531
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800532LOCAL_MODULE := online-sdk-dev
Bart Searsa8cc0582015-05-07 03:23:20 +0000533
534LOCAL_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
Scott Main15b85172017-02-21 14:30:58 -0800542LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000543
544include $(BUILD_DROIDDOC)
545
Bart Searsa8cc0582015-05-07 03:23:20 +0000546# ==== docs that have all of the stuff that's @hidden =======================
547include $(CLEAR_VARS)
548
549LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800550LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800551LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000552LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
553LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
554LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
555LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
556LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
557LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
558
559LOCAL_MODULE := hidden
560LOCAL_DROIDDOC_OPTIONS:=\
561 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700562 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000563 -title "Android SDK - Including hidden APIs."
564# -hidden
565
Scott Main15b85172017-02-21 14:30:58 -0800566LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000567
568include $(BUILD_DROIDDOC)
569
Joe Onorato1754d742016-11-21 17:51:35 -0800570# ==== java proto host library ==============================
571include $(CLEAR_VARS)
572LOCAL_MODULE := platformprotos
573LOCAL_PROTOC_OPTIMIZE_TYPE := full
574LOCAL_PROTOC_FLAGS := \
575 -Iexternal/protobuf/src
576LOCAL_SOURCE_FILES_ALL_GENERATED := true
577LOCAL_SRC_FILES := \
578 $(call all-proto-files-under, core/proto) \
579 $(call all-proto-files-under, libs/incident/proto)
Andreas Gampe7b9b5d72018-02-15 15:12:38 -0800580# b/72714520
581LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
Joe Onorato1754d742016-11-21 17:51:35 -0800582include $(BUILD_HOST_JAVA_LIBRARY)
583
Bart Searsa8cc0582015-05-07 03:23:20 +0000584
David Brazdil0649c8d2018-01-22 22:23:13 +0000585# ==== hiddenapi lists =======================================
David Brazdil74502c72018-05-08 15:04:20 +0100586include $(CLEAR_VARS)
David Brazdil0649c8d2018-01-22 22:23:13 +0000587
David Brazdil74502c72018-05-08 15:04:20 +0100588# File names of final API lists
589LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
590LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
591LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
592
593# File names of source files we will use to generate the final API lists.
594LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
595LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
David Brazdil259e1622018-05-08 16:49:02 +0100596LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
David Brazdil6f6a1262018-05-31 13:58:41 +0100597LOCAL_SRC_PUBLIC_API := $(INTERNAL_PLATFORM_DEX_API_FILE)
David Brazdil74502c72018-05-08 15:04:20 +0100598LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
599LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
600
601LOCAL_SRC_ALL := \
602 $(LOCAL_SRC_GREYLIST) \
603 $(LOCAL_SRC_VENDOR_LIST) \
David Brazdil259e1622018-05-08 16:49:02 +0100604 $(LOCAL_SRC_FORCE_BLACKLIST) \
David Brazdil6f6a1262018-05-31 13:58:41 +0100605 $(LOCAL_SRC_PUBLIC_API) \
David Brazdil74502c72018-05-08 15:04:20 +0100606 $(LOCAL_SRC_PRIVATE_API) \
607 $(LOCAL_SRC_REMOVED_API)
608
609define assert-has-no-overlap
610if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
611 echo "$(1) and $(2) should not overlap" 1>&2; \
612 comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
613 exit 1; \
614fi
615endef
616
617define assert-is-subset
618if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
619 echo "$(1) must be a subset of $(2)" 1>&2; \
620 comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
621 exit 1; \
622fi
623endef
624
625define assert-has-no-duplicates
626if [ ! -z "`sort $(1) | uniq -D`" ]; then \
627 echo "$(1) has duplicate entries" 1>&2; \
628 sort $(1) | uniq -D 1>&2; \
629 exit 1; \
630fi
631endef
632
633# The following rules build API lists in the build folder.
634# By not using files from the source tree, ART buildbots can mock these lists
635# or have alternative rules for building them. Other rules in the build system
636# should depend on the files in the build folder.
David Brazdilf16ac002018-01-26 11:13:35 +0000637
David Brazdild39b9be2018-05-05 11:43:29 +0100638# Merge light greylist from multiple files:
David Brazdil74502c72018-05-08 15:04:20 +0100639# (1) manual greylist LOCAL_SRC_GREYLIST
640# (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
641# (3) list of removed APIs in LOCAL_SRC_REMOVED_API
David Brazdild39b9be2018-05-05 11:43:29 +0100642# @removed does not imply private in Doclava. We must take the subset also
David Brazdil74502c72018-05-08 15:04:20 +0100643# in LOCAL_SRC_PRIVATE_API.
David Brazdild39b9be2018-05-05 11:43:29 +0100644# (4) list of serialization APIs
645# Automatically adds all methods which match the signatures in
646# REGEX_SERIALIZATION. These are greylisted in order to allow applications
647# to write their own serializers.
David Brazdil74502c72018-05-08 15:04:20 +0100648$(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
David Brazdild39b9be2018-05-05 11:43:29 +0100649 "readObject\(Ljava/io/ObjectInputStream;\)V" \
650 "readObjectNoData\(\)V" \
651 "readResolve\(\)Ljava/lang/Object;" \
652 "serialVersionUID:J" \
653 "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
654 "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
655 "writeReplace\(\)Ljava/lang/Object;"
David Brazdil74502c72018-05-08 15:04:20 +0100656$(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
657 sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) \
658 <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
659 $(LOCAL_SRC_PRIVATE_API)) \
660 <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
661 > $@
662 $(call assert-has-no-duplicates,$@)
663 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
David Brazdil259e1622018-05-08 16:49:02 +0100664 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
David Brazdild39b9be2018-05-05 11:43:29 +0100665
David Brazdilf24f0a92018-05-10 15:50:02 +0100666# Generate dark greylist as remaining classes and class members in the same
667# package as classes listed in the light greylist.
David Brazdil6afca532018-05-08 15:28:31 +0100668# The algorithm is as follows:
669# (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
David Brazdilf24f0a92018-05-10 15:50:02 +0100670# (2) strip everything after the last forward-slash,
671# e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/'
672# (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package
673# name but do not contain another forward-slash in the class name, e.g.
674# matching '^Lpackage/subpackage/[^/;]*;'
David Brazdil6afca532018-05-08 15:28:31 +0100675# (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
David Brazdil74502c72018-05-08 15:04:20 +0100676$(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
David Brazdil259e1622018-05-08 16:49:02 +0100677 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
David Brazdil6f6a1262018-05-31 13:58:41 +0100678 <(cat $(LOCAL_SRC_PUBLIC_API) $(LOCAL_LIGHT_GREYLIST) | \
679 sed 's/\->.*//' | sed 's/\(.*\/\).*/\1/' | sort | uniq | \
David Brazdilf24f0a92018-05-10 15:50:02 +0100680 while read PKG_NAME; do \
681 grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \
David Brazdil6afca532018-05-08 15:28:31 +0100682 done | sort | uniq) \
683 > $@
David Brazdil74502c72018-05-08 15:04:20 +0100684 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
685 $(call assert-has-no-duplicates,$@)
686 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
David Brazdil259e1622018-05-08 16:49:02 +0100687 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
David Brazdilf16ac002018-01-26 11:13:35 +0000688
David Brazdil74502c72018-05-08 15:04:20 +0100689# Generate blacklist as private API minus (light greylist plus dark greylist).
690$(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
691 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
692 <(sort $(LOCAL_SRC_PRIVATE_API)) \
693 > $@
694 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
695 $(call assert-has-no-duplicates,$@)
696 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
697 $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
David Brazdil259e1622018-05-08 16:49:02 +0100698 $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
David Brazdil0649c8d2018-01-22 22:23:13 +0000699
David Brazdilcc88bdc2018-05-02 15:47:32 +0100700# Build AOSP blacklist
701# ============================================================
702include $(CLEAR_VARS)
703
704LOCAL_LIGHT_GREYLIST_FILE := frameworks/base/config/hiddenapi-p-light-greylist.txt
705LOCAL_BLACKLIST_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-aosp-blacklist.txt
706
707.PHONY: hiddenapi-aosp-blacklist
708hiddenapi-aosp-blacklist: $(LOCAL_BLACKLIST_FILE)
709
710$(LOCAL_BLACKLIST_FILE): $(LOCAL_LIGHT_GREYLIST_FILE) $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
711 LC_COLLATE=C comm -13 <(sort $(LOCAL_LIGHT_GREYLIST_FILE)) \
712 <(sort $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)) > $@
713
Bart Searsa8cc0582015-05-07 03:23:20 +0000714# Include subdirectory makefiles
715# ============================================================
716
717# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
718# team really wants is to build the stuff defined by this makefile.
719ifeq (,$(ONE_SHOT_MAKEFILE))
720include $(call first-makefiles-under,$(LOCAL_PATH))
721endif
722
Holly Jiuyu Sunbbc85802017-12-21 18:44:59 -0800723endif # ANDROID_BUILD_EMBEDDED