blob: 32d9e9b07fe99f0abe311d5e7de60d3ab9219a69 [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.
Sundong Ahn4ff08f62018-07-16 18:19:31 +0900183since-arg = -since $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/$(1)/public/api/android.$(2)) $(1)
Anton Hanssone5bf2062018-04-19 16:23:53 +0100184
Sundong Ahn4ff08f62018-07-16 18:19:31 +0900185finalized_xml_sdks := $(call numerically_sort,\
186 $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.xml,%,\
187 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.xml)))
188finalized_txt_sdks := $(call numerically_sort,\
189 $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/public/api/android.txt,%,\
190 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/public/api/android.txt)))
Anton Hanssone5bf2062018-04-19 16:23:53 +0100191
Sundong Ahn4ff08f62018-07-16 18:19:31 +0900192framework_docs_LOCAL_DROIDDOC_OPTIONS += $(foreach sdk,$(finalized_xml_sdks),$(call since-arg,$(sdk),xml))
193framework_docs_LOCAL_DROIDDOC_OPTIONS += $(foreach sdk,$(finalized_txt_sdks),$(call since-arg,$(sdk),txt))
Anton Hanssone5bf2062018-04-19 16:23:53 +0100194ifneq ($(PLATFORM_VERSION_CODENAME),REL)
195 framework_docs_LOCAL_DROIDDOC_OPTIONS += \
196 -since ./frameworks/base/api/current.txt $(PLATFORM_VERSION_CODENAME)
197endif
198framework_docs_LOCAL_DROIDDOC_OPTIONS += \
Jeff Sharkey2337aec2017-12-06 21:12:23 -0700199 -werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
Anton Hanssone5bf2062018-04-19 16:23:53 +0100200 -overview $(LOCAL_PATH)/core/java/overview.html
Bart Searsa8cc0582015-05-07 03:23:20 +0000201
202framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR:= \
203 $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
204
205framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= \
Alan Viverette2d362a52017-04-05 10:21:58 -0400206 $(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
Bart Searsa8cc0582015-05-07 03:23:20 +0000207
208framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
Narayan Kamathc21739a2015-07-14 13:39:23 +0100209 frameworks/base/docs/knowntags.txt \
Colin Cross72d359f2017-10-27 10:46:53 -0700210 $(libcore_to_document_generated)
Bart Searsa8cc0582015-05-07 03:23:20 +0000211
212samples_dir := development/samples/browseable
213
214# Whitelist of valid groups, used for default TOC grouping. Each sample must
215# belong to one (and only one) group. Assign samples to groups by setting
216# a sample.group var to one of these groups in the sample's _index.jd.
217sample_groups := -samplegroup Admin \
218 -samplegroup Background \
219 -samplegroup Connectivity \
220 -samplegroup Content \
221 -samplegroup Input \
222 -samplegroup Media \
223 -samplegroup Notification \
224 -samplegroup RenderScript \
225 -samplegroup Security \
226 -samplegroup Sensors \
Trevor Johns4cbe3592015-05-27 14:50:51 -0700227 -samplegroup System \
Bart Searsa8cc0582015-05-07 03:23:20 +0000228 -samplegroup Testing \
229 -samplegroup UI \
230 -samplegroup Views \
231 -samplegroup Wearable
232
233## SDK version identifiers used in the published docs
234 # major[.minor] version for current SDK. (full releases only)
smain@google.comdde8deb2016-08-29 18:36:50 -0700235framework_docs_SDK_VERSION:=7.0
Bart Searsa8cc0582015-05-07 03:23:20 +0000236 # release version (ie "Release x") (full releases only)
237framework_docs_SDK_REL_ID:=1
238
239framework_docs_LOCAL_DROIDDOC_OPTIONS += \
Billy Lamberta75dbc8f2017-03-03 13:09:15 -0800240 -hdf dac true \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700241 -hdf sdk.codename O \
242 -hdf sdk.preview.version 1 \
Bart Searsa8cc0582015-05-07 03:23:20 +0000243 -hdf sdk.version $(framework_docs_SDK_VERSION) \
244 -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700245 -hdf sdk.preview 0 \
246 -resourcesdir $(LOCAL_PATH)/docs/html/reference/images/ \
247 -resourcesoutdir reference/android/images/
Bart Searsa8cc0582015-05-07 03:23:20 +0000248
Alan Viverette2d362a52017-04-05 10:21:58 -0400249# Federate Support Library references against local API file.
250framework_docs_LOCAL_DROIDDOC_OPTIONS += \
251 -federate SupportLib https://developer.android.com \
252 -federationapi SupportLib prebuilts/sdk/current/support-api.txt
253
Bart Searsa8cc0582015-05-07 03:23:20 +0000254
Bart Searsa8cc0582015-05-07 03:23:20 +0000255$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
Bart Searsa8cc0582015-05-07 03:23:20 +0000256$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
Michael Wrightb2b2c0e72015-11-06 15:21:13 +0000257$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
258
Bart Searsa8cc0582015-05-07 03:23:20 +0000259# ==== check javadoc comments but don't generate docs ========
260include $(CLEAR_VARS)
261
262LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800263LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800264LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000265LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
266LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
267LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
268LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
269LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
270LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
271
272LOCAL_MODULE := doc-comment-check
273
274LOCAL_DROIDDOC_OPTIONS:=\
275 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700276 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000277 -parsecomments
278
Scott Main15b85172017-02-21 14:30:58 -0800279LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000280
281LOCAL_UNINSTALLABLE_MODULE := true
282
283include $(BUILD_DROIDDOC)
284
Bart Searsa8cc0582015-05-07 03:23:20 +0000285# Run this for checkbuild
286checkbuild: doc-comment-check-docs
287# Check comment when you are updating the API
288update-api: doc-comment-check-docs
289
290# ==== static html in the sdk ==================================
291include $(CLEAR_VARS)
292
293LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800294LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800295LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000296LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
297LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
298LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
299LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
300LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
301LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
302
303LOCAL_MODULE := offline-sdk
304
305LOCAL_DROIDDOC_OPTIONS:=\
306 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
307 -offlinemode \
308 -title "Android SDK" \
309 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
smain@google.com00de8c52016-03-07 18:38:08 -0800310 -sdkvalues $(OUT_DOCS) \
smain@google.com8562ab52016-06-14 17:11:57 -0700311 -hdf android.whichdoc offline
312
Scott Main15b85172017-02-21 14:30:58 -0800313LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
smain@google.com8562ab52016-06-14 17:11:57 -0700314
315include $(BUILD_DROIDDOC)
316
317static_doc_index_redirect := $(out_dir)/index.html
318$(static_doc_index_redirect): \
319 $(LOCAL_PATH)/docs/docs-preview-index.html | $(ACP)
320 $(hide) mkdir -p $(dir $@)
321 $(hide) $(ACP) $< $@
322
323$(full_target): $(static_doc_index_redirect)
smain@google.com8562ab52016-06-14 17:11:57 -0700324
325
326# ==== static html in the sdk ==================================
327include $(CLEAR_VARS)
328
329LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800330LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800331LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
smain@google.com8562ab52016-06-14 17:11:57 -0700332LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
333LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
334LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
335LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
336LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
337LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
338
339LOCAL_MODULE := offline-sdk-referenceonly
340
341LOCAL_DROIDDOC_OPTIONS:=\
342 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
343 -offlinemode \
344 -title "Android SDK" \
345 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
346 -sdkvalues $(OUT_DOCS) \
smain@google.com00de8c52016-03-07 18:38:08 -0800347 -hdf android.whichdoc offline \
Scott Mainf8cdfc82017-03-21 13:43:31 -0700348 -referenceonly
smain@google.com00de8c52016-03-07 18:38:08 -0800349
Scott Main15b85172017-02-21 14:30:58 -0800350LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
smain@google.com00de8c52016-03-07 18:38:08 -0800351
352include $(BUILD_DROIDDOC)
353
354static_doc_index_redirect := $(out_dir)/index.html
smain@google.com151833a2016-08-31 08:42:09 -0700355$(static_doc_index_redirect): $(LOCAL_PATH)/docs/docs-documentation-redirect.html
Dan Willemsen98ff0b72016-03-23 00:42:44 -0700356 $(copy-file-to-target)
smain@google.com00de8c52016-03-07 18:38:08 -0800357
smain@google.com2f2365d2016-09-21 14:05:50 -0700358static_doc_properties := $(out_dir)/source.properties
359$(static_doc_properties): \
360 $(LOCAL_PATH)/docs/source.properties | $(ACP)
361 $(hide) mkdir -p $(dir $@)
362 $(hide) $(ACP) $< $@
363
smain@google.com00de8c52016-03-07 18:38:08 -0800364$(full_target): $(static_doc_index_redirect)
smain@google.com2f2365d2016-09-21 14:05:50 -0700365$(full_target): $(static_doc_properties)
smain@google.com00de8c52016-03-07 18:38:08 -0800366
smain@google.com7aca8be2016-03-10 14:13:30 -0800367
Bart Searsa8cc0582015-05-07 03:23:20 +0000368# ==== docs for the web (on the androiddevdocs app engine server) =======================
369include $(CLEAR_VARS)
370
371LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800372LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800373LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000374LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
375LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
376LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
377LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
378LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
379LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
380LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
381LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
382
383LOCAL_MODULE := online-sdk
384
385LOCAL_DROIDDOC_OPTIONS:= \
386 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
387 -toroot / \
388 -hdf android.whichdoc online \
389 $(sample_groups) \
390 -hdf android.hasSamples true \
391 -samplesdir $(samples_dir)
392
Scott Main15b85172017-02-21 14:30:58 -0800393LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000394
395include $(BUILD_DROIDDOC)
396
397# ==== docs for the web (on the androiddevdocs app engine server) =======================
Bart Searsa8cc0582015-05-07 03:23:20 +0000398include $(CLEAR_VARS)
399
400LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800401LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800402LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000403LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
404LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
405LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
406LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
407LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
408LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
409LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
410LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
411
412LOCAL_MODULE := online-system-api-sdk
413
414LOCAL_DROIDDOC_OPTIONS:= \
415 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700416 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000417 -showAnnotation android.annotation.SystemApi \
418 -title "Android SDK - Including system APIs." \
419 -toroot / \
Gina Dimino98ad8882016-05-31 17:25:48 -0700420 -hide 101 \
421 -hide 104 \
422 -hide 108 \
Bart Searsa8cc0582015-05-07 03:23:20 +0000423 -hdf android.whichdoc online \
424 $(sample_groups) \
425 -hdf android.hasSamples true \
426 -samplesdir $(samples_dir)
427
Scott Main15b85172017-02-21 14:30:58 -0800428LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Jeff Sharkey05461c02017-05-09 19:01:09 -0600429
Bart Searsa8cc0582015-05-07 03:23:20 +0000430LOCAL_UNINSTALLABLE_MODULE := true
431
432include $(BUILD_DROIDDOC)
Bart Searsa8cc0582015-05-07 03:23:20 +0000433
434# ==== docs for the web (on the devsite app engine server) =======================
435include $(CLEAR_VARS)
436LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800437LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800438LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000439LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
440LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
441LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
442LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
443LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
444LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
445LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
446# specify a second html input dir and an output path relative to OUT_DIR)
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700447LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
Bart Searsa8cc0582015-05-07 03:23:20 +0000448
449LOCAL_MODULE := ds
450
451LOCAL_DROIDDOC_OPTIONS:= \
452 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
Bart Searsa8cc0582015-05-07 03:23:20 +0000453 -toroot / \
454 -hdf android.whichdoc online \
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700455 -devsite \
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700456 $(sample_groups) \
Dirk Dougherty3852c1f2016-04-10 02:05:09 -0700457 -hdf android.hasSamples true \
458 -samplesdir $(samples_dir)
Bart Searsa8cc0582015-05-07 03:23:20 +0000459
Scott Main15b85172017-02-21 14:30:58 -0800460LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000461
462include $(BUILD_DROIDDOC)
463
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700464# ==== docs for the web (on the devsite app engine server) =======================
465include $(CLEAR_VARS)
466LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800467LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800468LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700469LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
470LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
471LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
472LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
473LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
474LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
475LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
476# specify a second html input dir and an output path relative to OUT_DIR)
477LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
478
479LOCAL_MODULE := ds-static
480
481LOCAL_DROIDDOC_OPTIONS:= \
482 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
483 -hdf android.whichdoc online \
484 -staticonly \
485 -toroot / \
486 -devsite \
487 -ignoreJdLinks
488
Scott Main15b85172017-02-21 14:30:58 -0800489LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Dirk Doughertyb042ab12016-06-14 16:26:28 -0700490
491include $(BUILD_DROIDDOC)
492
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700493# ==== generates full navtree for resolving @links in ds postprocessing ====
494include $(CLEAR_VARS)
495
496LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800497LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800498LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700499LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
500LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
501LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
502LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
503LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
504LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
505
506LOCAL_MODULE := ds-ref-navtree
507
508LOCAL_DROIDDOC_OPTIONS:= \
509 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
510 -hdf android.whichdoc online \
511 -toroot / \
512 -atLinksNavtree \
513 -navtreeonly
514
Scott Main15b85172017-02-21 14:30:58 -0800515LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Dirk Dougherty7d47b552016-09-13 16:44:25 -0700516
517include $(BUILD_DROIDDOC)
518
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800519# ==== site updates for docs (on the androiddevdocs app engine server) =======================
Bart Searsa8cc0582015-05-07 03:23:20 +0000520include $(CLEAR_VARS)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800521
Bart Searsa8cc0582015-05-07 03:23:20 +0000522LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800523LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800524LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000525LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
526LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
527LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
528LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800529LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
Bart Searsa8cc0582015-05-07 03:23:20 +0000530LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
531LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800532LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
Bart Searsa8cc0582015-05-07 03:23:20 +0000533
Dirk Dougherty31ae1c512015-11-07 13:18:02 -0800534LOCAL_MODULE := online-sdk-dev
Bart Searsa8cc0582015-05-07 03:23:20 +0000535
536LOCAL_DROIDDOC_OPTIONS:= \
537 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
538 -toroot / \
539 -hdf android.whichdoc online \
540 $(sample_groups) \
541 -hdf android.hasSamples true \
542 -samplesdir $(samples_dir)
543
Scott Main15b85172017-02-21 14:30:58 -0800544LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000545
546include $(BUILD_DROIDDOC)
547
Bart Searsa8cc0582015-05-07 03:23:20 +0000548# ==== docs that have all of the stuff that's @hidden =======================
549include $(CLEAR_VARS)
550
551LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
Colin Cross0c760952017-12-04 13:45:19 -0800552LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
Colin Cross5f4dcf62017-11-16 00:15:28 -0800553LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
Bart Searsa8cc0582015-05-07 03:23:20 +0000554LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
555LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
556LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
557LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
558LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
559LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
560
561LOCAL_MODULE := hidden
562LOCAL_DROIDDOC_OPTIONS:=\
563 $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
smain@google.com534bfe12016-09-01 19:52:17 -0700564 -referenceonly \
Bart Searsa8cc0582015-05-07 03:23:20 +0000565 -title "Android SDK - Including hidden APIs."
566# -hidden
567
Scott Main15b85172017-02-21 14:30:58 -0800568LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Bart Searsa8cc0582015-05-07 03:23:20 +0000569
570include $(BUILD_DROIDDOC)
571
Joe Onorato1754d742016-11-21 17:51:35 -0800572# ==== java proto host library ==============================
573include $(CLEAR_VARS)
574LOCAL_MODULE := platformprotos
575LOCAL_PROTOC_OPTIMIZE_TYPE := full
576LOCAL_PROTOC_FLAGS := \
577 -Iexternal/protobuf/src
578LOCAL_SOURCE_FILES_ALL_GENERATED := true
579LOCAL_SRC_FILES := \
580 $(call all-proto-files-under, core/proto) \
581 $(call all-proto-files-under, libs/incident/proto)
Andreas Gampe7b9b5d72018-02-15 15:12:38 -0800582# b/72714520
583LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF
Joe Onorato1754d742016-11-21 17:51:35 -0800584include $(BUILD_HOST_JAVA_LIBRARY)
585
Bart Searsa8cc0582015-05-07 03:23:20 +0000586
David Brazdil0649c8d2018-01-22 22:23:13 +0000587# ==== hiddenapi lists =======================================
David Brazdil74502c72018-05-08 15:04:20 +0100588include $(CLEAR_VARS)
David Brazdil0649c8d2018-01-22 22:23:13 +0000589
David Brazdil74502c72018-05-08 15:04:20 +0100590# File names of final API lists
591LOCAL_LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
592LOCAL_DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
593LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
594
595# File names of source files we will use to generate the final API lists.
596LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt
597LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt
David Brazdil259e1622018-05-08 16:49:02 +0100598LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt
David Brazdil6f6a1262018-05-31 13:58:41 +0100599LOCAL_SRC_PUBLIC_API := $(INTERNAL_PLATFORM_DEX_API_FILE)
David Brazdil74502c72018-05-08 15:04:20 +0100600LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
601LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
602
603LOCAL_SRC_ALL := \
604 $(LOCAL_SRC_GREYLIST) \
605 $(LOCAL_SRC_VENDOR_LIST) \
David Brazdil259e1622018-05-08 16:49:02 +0100606 $(LOCAL_SRC_FORCE_BLACKLIST) \
David Brazdil6f6a1262018-05-31 13:58:41 +0100607 $(LOCAL_SRC_PUBLIC_API) \
David Brazdil74502c72018-05-08 15:04:20 +0100608 $(LOCAL_SRC_PRIVATE_API) \
609 $(LOCAL_SRC_REMOVED_API)
610
611define assert-has-no-overlap
612if [ ! -z "`comm -12 <(sort $(1)) <(sort $(2))`" ]; then \
613 echo "$(1) and $(2) should not overlap" 1>&2; \
614 comm -12 <(sort $(1)) <(sort $(2)) 1>&2; \
615 exit 1; \
616fi
617endef
618
619define assert-is-subset
620if [ ! -z "`comm -23 <(sort $(1)) <(sort $(2))`" ]; then \
621 echo "$(1) must be a subset of $(2)" 1>&2; \
622 comm -23 <(sort $(1)) <(sort $(2)) 1>&2; \
623 exit 1; \
624fi
625endef
626
627define assert-has-no-duplicates
628if [ ! -z "`sort $(1) | uniq -D`" ]; then \
629 echo "$(1) has duplicate entries" 1>&2; \
630 sort $(1) | uniq -D 1>&2; \
631 exit 1; \
632fi
633endef
634
635# The following rules build API lists in the build folder.
636# By not using files from the source tree, ART buildbots can mock these lists
637# or have alternative rules for building them. Other rules in the build system
638# should depend on the files in the build folder.
David Brazdilf16ac002018-01-26 11:13:35 +0000639
David Brazdild39b9be2018-05-05 11:43:29 +0100640# Merge light greylist from multiple files:
David Brazdil74502c72018-05-08 15:04:20 +0100641# (1) manual greylist LOCAL_SRC_GREYLIST
642# (2) list of usages from vendor apps LOCAL_SRC_VENDOR_LIST
643# (3) list of removed APIs in LOCAL_SRC_REMOVED_API
David Brazdild39b9be2018-05-05 11:43:29 +0100644# @removed does not imply private in Doclava. We must take the subset also
David Brazdil74502c72018-05-08 15:04:20 +0100645# in LOCAL_SRC_PRIVATE_API.
David Brazdild39b9be2018-05-05 11:43:29 +0100646# (4) list of serialization APIs
647# Automatically adds all methods which match the signatures in
648# REGEX_SERIALIZATION. These are greylisted in order to allow applications
649# to write their own serializers.
David Brazdil74502c72018-05-08 15:04:20 +0100650$(LOCAL_LIGHT_GREYLIST): REGEX_SERIALIZATION := \
David Brazdild39b9be2018-05-05 11:43:29 +0100651 "readObject\(Ljava/io/ObjectInputStream;\)V" \
652 "readObjectNoData\(\)V" \
653 "readResolve\(\)Ljava/lang/Object;" \
654 "serialVersionUID:J" \
655 "serialPersistentFields:\[Ljava/io/ObjectStreamField;" \
656 "writeObject\(Ljava/io/ObjectOutputStream;\)V" \
657 "writeReplace\(\)Ljava/lang/Object;"
David Brazdil74502c72018-05-08 15:04:20 +0100658$(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
Mathew Inwood1b045882018-07-11 15:55:32 +0100659 sort $(LOCAL_SRC_GREYLIST) $(LOCAL_SRC_VENDOR_LIST) $(PRIVATE_GREYLIST_INPUTS) \
David Brazdil74502c72018-05-08 15:04:20 +0100660 <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" \
661 $(LOCAL_SRC_PRIVATE_API)) \
662 <(comm -12 <(sort $(LOCAL_SRC_REMOVED_API)) <(sort $(LOCAL_SRC_PRIVATE_API))) \
663 > $@
664 $(call assert-has-no-duplicates,$@)
665 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
David Brazdil259e1622018-05-08 16:49:02 +0100666 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
David Brazdild39b9be2018-05-05 11:43:29 +0100667
David Brazdilf24f0a92018-05-10 15:50:02 +0100668# Generate dark greylist as remaining classes and class members in the same
669# package as classes listed in the light greylist.
David Brazdil6afca532018-05-08 15:28:31 +0100670# The algorithm is as follows:
671# (1) extract the class descriptor from each entry in LOCAL_LIGHT_GREYLIST
David Brazdilf24f0a92018-05-10 15:50:02 +0100672# (2) strip everything after the last forward-slash,
673# e.g. 'Lpackage/subpackage/class$inner;' turns into 'Lpackage/subpackage/'
674# (3) insert all entries from LOCAL_SRC_PRIVATE_API which begin with the package
675# name but do not contain another forward-slash in the class name, e.g.
676# matching '^Lpackage/subpackage/[^/;]*;'
David Brazdil6afca532018-05-08 15:28:31 +0100677# (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
David Brazdil74502c72018-05-08 15:04:20 +0100678$(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
David Brazdil259e1622018-05-08 16:49:02 +0100679 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
David Brazdil6f6a1262018-05-31 13:58:41 +0100680 <(cat $(LOCAL_SRC_PUBLIC_API) $(LOCAL_LIGHT_GREYLIST) | \
681 sed 's/\->.*//' | sed 's/\(.*\/\).*/\1/' | sort | uniq | \
David Brazdilf24f0a92018-05-10 15:50:02 +0100682 while read PKG_NAME; do \
683 grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \
David Brazdil6afca532018-05-08 15:28:31 +0100684 done | sort | uniq) \
685 > $@
David Brazdil74502c72018-05-08 15:04:20 +0100686 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
687 $(call assert-has-no-duplicates,$@)
688 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
David Brazdil259e1622018-05-08 16:49:02 +0100689 $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
David Brazdilf16ac002018-01-26 11:13:35 +0000690
David Brazdil74502c72018-05-08 15:04:20 +0100691# Generate blacklist as private API minus (light greylist plus dark greylist).
692$(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
693 comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)) \
694 <(sort $(LOCAL_SRC_PRIVATE_API)) \
695 > $@
696 $(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
697 $(call assert-has-no-duplicates,$@)
698 $(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
699 $(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
David Brazdil259e1622018-05-08 16:49:02 +0100700 $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
David Brazdil0649c8d2018-01-22 22:23:13 +0000701
David Brazdilcc88bdc2018-05-02 15:47:32 +0100702# Build AOSP blacklist
703# ============================================================
704include $(CLEAR_VARS)
705
706LOCAL_LIGHT_GREYLIST_FILE := frameworks/base/config/hiddenapi-p-light-greylist.txt
707LOCAL_BLACKLIST_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-aosp-blacklist.txt
708
709.PHONY: hiddenapi-aosp-blacklist
710hiddenapi-aosp-blacklist: $(LOCAL_BLACKLIST_FILE)
711
712$(LOCAL_BLACKLIST_FILE): $(LOCAL_LIGHT_GREYLIST_FILE) $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
713 LC_COLLATE=C comm -13 <(sort $(LOCAL_LIGHT_GREYLIST_FILE)) \
714 <(sort $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)) > $@
715
Bart Searsa8cc0582015-05-07 03:23:20 +0000716# Include subdirectory makefiles
717# ============================================================
718
719# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
720# team really wants is to build the stuff defined by this makefile.
721ifeq (,$(ONE_SHOT_MAKEFILE))
722include $(call first-makefiles-under,$(LOCAL_PATH))
723endif
724
Holly Jiuyu Sunbbc85802017-12-21 18:44:59 -0800725endif # ANDROID_BUILD_EMBEDDED