blob: 796c8412b26c50b8f37a7eeb0f22f8d8ca2e5d47 [file] [log] [blame]
Jiyong Park7fb4b182019-12-20 14:35:43 +09001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// How API docs are generated:
16//
17// raw source files --(metalava)--> stub source files --(doclava)--> API doc
18//
19// The metalava conversion is done by droidstub modules framework-doc-*-stubs.
20// The API doc generation is done by the various droiddoc modules each of which
21// is for different format.
22
Anton Hansson5aa59332022-01-21 16:32:31 +000023// These defaults enable doc-stub generation, api lint database generation and sdk value generation.
Jiyong Park7fb4b182019-12-20 14:35:43 +090024stubs_defaults {
Anton Hansson867f94c2021-05-05 10:32:31 +010025 name: "android-non-updatable-doc-stubs-defaults",
Anton Hansson87f04b82022-01-17 19:27:06 +000026 defaults: ["android-non-updatable-stubs-defaults"],
Jiyong Park7fb4b182019-12-20 14:35:43 +090027 srcs: [
Anton Hansson35c0b092021-03-30 10:46:48 +010028 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010029 ":android-test-base-sources",
30 ":android-test-mock-sources",
31 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090032 ],
Anton Hansson25c8ca62023-10-27 14:57:30 +000033 flags: [
34 // These errors are suppressed in the doc stubs as it isn't easy to suppress them.
35 // They remain unsuppressed/active in the "main" stubs build (the jar stubs).
36 // These can be removed when either a) all the issues have been fixed or
37 // b) these reporting of these issues is gated behind api lint being enabled in metalava.
38 "--hide BroadcastBehavior",
39 "--hide DeprecationMismatch",
40 "--hide MissingPermission",
41 "--hide RequiresPermission",
42 "--hide SdkConstant",
43 "--hide Todo",
44 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +090045 create_doc_stubs: true,
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010046 write_sdk_values: true,
Jiyong Park7fb4b182019-12-20 14:35:43 +090047}
48
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010049// Defaults module for doc-stubs targets that use module source code as input.
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010050stubs_defaults {
51 name: "framework-doc-stubs-sources-default",
Anton Hansson5aa59332022-01-21 16:32:31 +000052 defaults: ["android-non-updatable-doc-stubs-defaults"],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010053 srcs: [
Anton Hanssonecf9fc32022-01-14 12:10:01 +000054 ":art.module.public.api{.public.stubs.source}",
55 ":conscrypt.module.public.api{.public.stubs.source}",
56 ":i18n.module.public.api{.public.stubs.source}",
57
Neha Pattanfa46dd22022-02-18 19:46:09 +000058 ":framework-adservices-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010059 ":framework-appsearch-sources",
60 ":framework-connectivity-sources",
Roopa Sattiraju8e305772022-01-20 10:05:19 -080061 ":framework-bluetooth-sources",
paulhuf45fe962021-12-14 23:09:55 +080062 ":framework-connectivity-tiramisu-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010063 ":framework-graphics-srcs",
64 ":framework-mediaprovider-sources",
Chun Zhanga615ce52021-10-29 14:57:55 -070065 ":framework-nearby-sources",
Roshan Pius05836fa2023-12-07 10:54:05 -080066 ":framework-nfc-updatable-sources",
Frank Wange97ff9e2022-02-13 07:06:31 +000067 ":framework-ondevicepersonalization-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010068 ":framework-permission-sources",
69 ":framework-permission-s-sources",
Yisroel Fortab0540e82024-01-30 16:22:06 +000070 ":framework-profiling-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010071 ":framework-scheduling-sources",
72 ":framework-sdkextensions-sources",
73 ":framework-statsd-sources",
Nikita Ioffe59029ad2022-02-24 01:56:44 +000074 ":framework-sdksandbox-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010075 ":framework-tethering-srcs",
Roshan Piusde6f1ca2021-10-14 07:34:07 -070076 ":framework-uwb-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010077 ":framework-wifi-updatable-sources",
78 ":ike-srcs",
79 ":updatable-media-srcs",
80 ],
81}
82
Jiyong Park7fb4b182019-12-20 14:35:43 +090083droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +010084 name: "android-non-updatable-doc-stubs",
Anton Hansson5aa59332022-01-21 16:32:31 +000085 defaults: [
86 "android-non-updatable-doc-stubs-defaults",
87 "module-classpath-stubs-defaults",
88 ],
Anton Hansson867f94c2021-05-05 10:32:31 +010089}
90
91droidstubs {
92 name: "android-non-updatable-doc-stubs-system",
Anton Hansson5aa59332022-01-21 16:32:31 +000093 defaults: [
94 "android-non-updatable-doc-stubs-defaults",
95 "module-classpath-stubs-defaults",
96 ],
Anton Hansson84a0e712023-10-23 09:17:45 +000097 flags: ["--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\)"],
Anton Hansson867f94c2021-05-05 10:32:31 +010098}
99
100droidstubs {
Cole Faustdcda3702022-10-04 14:46:35 -0700101 name: "android-non-updatable-doc-stubs-module-lib",
102 defaults: [
103 "android-non-updatable-doc-stubs-defaults",
104 "module-classpath-stubs-defaults",
Anton Hansson5aa59332022-01-21 16:32:31 +0000105 ],
Anton Hansson84a0e712023-10-23 09:17:45 +0000106 flags: [
107 "--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\)",
108 "--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES\\)",
109 ],
Cole Faustdcda3702022-10-04 14:46:35 -0700110 generate_stubs: false, // We're only using this module for the annotations.zip output, disable doc-stubs.
111 write_sdk_values: false,
112}
113
114droidstubs {
115 name: "android-non-updatable-doc-stubs-system-server",
116 defaults: [
117 "android-non-updatable-doc-stubs-defaults",
118 "module-classpath-stubs-defaults",
119 ],
Anton Hansson84a0e712023-10-23 09:17:45 +0000120 flags: [
121 "--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\)",
122 "--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES\\)",
123 "--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)",
124 ],
Cole Faustdcda3702022-10-04 14:46:35 -0700125 generate_stubs: false, // We're only using this module for the annotations.zip output, disable doc-stubs.
126 write_sdk_values: false,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900127}
128
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100129droidstubs {
Anton Hansson111e1582021-10-26 14:12:10 +0000130 name: "framework-doc-stubs",
Anton Hansson5aa59332022-01-21 16:32:31 +0000131 defaults: ["android-non-updatable-doc-stubs-defaults"],
Paul Duffind772be22024-12-09 16:54:48 +0000132 flags: [
133 // Ignore any compatibility errors, see check_api.last_released below for more information.
134 "--hide-category Compatibility",
135 ],
Jihoon Kange4553d02024-11-07 19:40:30 +0000136 srcs: [":all-modules-public-stubs-source-exportable"],
Anton Hansson247c5f22022-05-09 09:53:12 +0000137 api_levels_module: "api_versions_public",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100138 aidl: {
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100139 include_dirs: [
140 "packages/modules/Connectivity/framework/aidl-export",
Baligh Uddinb8b46fd2022-02-11 14:20:10 +0000141 "packages/modules/Media/apex/aidl/stable",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100142 ],
143 },
Paul Duffind772be22024-12-09 16:54:48 +0000144
145 // Pass the previously released API to support reverting flagged APIs. Without this, reverting
146 // a flagged API will cause it to be removed, even if it had previously been released. This
147 // has the side effect of causing compatibility issues to be reported but they are already
148 // checked elsewhere so they will be ignored, see `--hide-category Compatibility` above.
149 check_api: {
150 last_released: {
151 api_file: ":android.api.combined.public.latest",
152 removed_api_file: ":android-removed.api.combined.public.latest",
153 },
154 },
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100155}
156
Cole Faustdcda3702022-10-04 14:46:35 -0700157droidstubs {
158 name: "framework-doc-system-stubs",
159 defaults: ["framework-doc-stubs-sources-default"],
Paul Duffind772be22024-12-09 16:54:48 +0000160 flags: [
161 "--show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\)",
162 // Ignore any compatibility errors, see check_api.last_released below for more information.
163 "--hide-category Compatibility",
164 ],
Paul Duffindd97b782023-10-16 18:37:12 +0100165 api_levels_module: "api_versions_system",
Paul Duffind772be22024-12-09 16:54:48 +0000166
167 // Pass the previously released API to support reverting flagged APIs. Without this, reverting
168 // a flagged API will cause it to be removed, even if it had previously been released. This
169 // has the side effect of causing compatibility issues to be reported but they are already
170 // checked elsewhere so they will be ignored, see `--hide-category Compatibility` above.
171 check_api: {
172 last_released: {
173 api_file: ":android.api.combined.system.latest",
174 removed_api_file: ":android-removed.api.combined.system.latest",
175 },
176 },
Cole Faustdcda3702022-10-04 14:46:35 -0700177}
178
Jiyong Park7fb4b182019-12-20 14:35:43 +0900179/////////////////////////////////////////////////////////////////////
180// API docs are created from the generated stub source files
181// using droiddoc
182/////////////////////////////////////////////////////////////////////
183
Jiyong Park7fb4b182019-12-20 14:35:43 +0900184doc_defaults {
185 name: "framework-docs-default",
Anton Hansson65370ed2023-10-11 13:46:34 +0000186 sdk_version: "none",
187 system_modules: "none",
Anton Hanssonba8f3c22023-10-10 18:52:20 +0000188 libs: [
Artur Satayevffd7f952020-01-13 16:16:27 +0000189 "stub-annotations",
190 "unsupportedappusage",
191 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900192 html_dirs: [
193 "docs/html",
194 ],
195 knowntags: [
196 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100197 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900198 ],
199 custom_template: "droiddoc-templates-sdk",
200 resourcesdir: "docs/html/reference/images/",
201 resourcesoutdir: "reference/android/images/",
Anton Hansson0a715502023-10-03 12:13:25 +0000202 lint_baseline: "javadoc-lint-baseline",
Anton Hansson84a0e712023-10-23 09:17:45 +0000203 flags: [
204 "-android",
205 "-manifest $(location :frameworks-base-core-AndroidManifest.xml)",
206 "-metalavaApiSince",
207 "-werror",
208 "-lerror",
209 "-overview $(location :frameworks-base-java-overview)",
210 // Federate Support Library references against local API file.
211 "-federate SupportLib https://developer.android.com",
212 "-federationapi SupportLib $(location :current-support-api)",
213 // Federate Support Library references against local API file.
214 "-federate AndroidX https://developer.android.com",
215 "-federationapi AndroidX $(location :current-androidx-api)",
216 // doclava contains checks for a few issues that are have been migrated to metalava.
217 // disable them in doclava, to avoid mistriggering or double triggering.
Mårten Kongstade2da2d62024-01-11 09:53:59 +0100218 "-hide 101", // TODO: turn Lint 101 back into an error again
Anton Hansson84a0e712023-10-23 09:17:45 +0000219 "-hide 111", // HIDDEN_SUPERCLASS
220 "-hide 113", // DEPRECATION_MISMATCH
221 "-hide 125", // REQUIRES_PERMISSION
222 "-hide 126", // BROADCAST_BEHAVIOR
223 "-hide 127", // SDK_CONSTANT
224 "-hide 128", // TODO
225 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900226 hdf: [
227 "dac true",
228 "sdk.codename O",
229 "sdk.preview.version 1",
230 "sdk.version 7.0",
231 "sdk.rel.id 1",
232 "sdk.preview 0",
233 ],
234 arg_files: [
Anton Hanssonca6e67a2023-03-03 17:55:09 +0000235 ":frameworks-base-core-AndroidManifest.xml",
236 ":frameworks-base-java-overview",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900237 ":current-support-api",
238 ":current-androidx-api",
239 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700240 // TODO(b/169090544): remove below aidl includes.
241 aidl: {
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600242 include_dirs: [
243 "frameworks/av/aidl",
Anton Hanssonca6e67a2023-03-03 17:55:09 +0000244 "frameworks/base/media/aidl",
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600245 "frameworks/native/libs/permission/aidl",
246 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700247 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900248}
249
Jiyong Park7fb4b182019-12-20 14:35:43 +0900250droiddoc {
251 name: "offline-sdk-docs",
252 defaults: ["framework-docs-default"],
253 srcs: [
Jihoon Kang2a829bb2024-02-01 22:01:15 +0000254 ":framework-doc-stubs{.exportable}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900255 ],
256 hdf: [
257 "android.whichdoc offline",
258 ],
atrostb1ee27b2020-02-03 11:03:16 +0000259 compat_config: ":global-compat-config",
Mårten Kongstad2598fe02022-03-30 12:31:33 +0000260 proofread_file: "offline-sdk-docs-proofread.txt",
Anton Hansson84a0e712023-10-23 09:17:45 +0000261 flags: [
262 "-offlinemode",
263 "-title \"Android SDK\"",
264 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900265 static_doc_index_redirect: "docs/docs-preview-index.html",
266}
267
268droiddoc {
269 // Please sync with android-api-council@ before making any changes for the name property below.
270 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
271 // See b/116221385 for reference.
272 name: "offline-sdk-referenceonly-docs",
273 defaults: ["framework-docs-default"],
274 srcs: [
Jihoon Kang2a829bb2024-02-01 22:01:15 +0000275 ":framework-doc-stubs{.exportable}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900276 ],
277 hdf: [
278 "android.whichdoc offline",
279 ],
Mårten Kongstad2598fe02022-03-30 12:31:33 +0000280 proofread_file: "offline-sdk-referenceonly-docs-proofread.txt",
Anton Hansson84a0e712023-10-23 09:17:45 +0000281 flags: [
282 "-offlinemode",
283 "-title \"Android SDK\"",
284 "-referenceonly",
285 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900286 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
287 static_doc_properties: "docs/source.properties",
288}
289
290droiddoc {
291 // Please sync with android-api-council@ before making any changes for the name property below.
292 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
293 // See b/116221385 for reference.
294 name: "offline-system-sdk-referenceonly-docs",
295 defaults: ["framework-docs-default"],
296 srcs: [
297 ":framework-doc-system-stubs",
298 ],
299 hdf: [
300 "android.whichdoc offline",
301 ],
Mårten Kongstad2598fe02022-03-30 12:31:33 +0000302 proofread_file: "offline-system-sdk-referenceonly-docs-proofread.txt",
Anton Hansson84a0e712023-10-23 09:17:45 +0000303 flags: [
304 "-hide 101",
305 "-hide 104",
306 "-hide 108",
307 "-offlinemode",
308 "-title \"Android System SDK\"",
309 "-referenceonly",
310 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900311 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
312 static_doc_properties: "docs/source.properties",
313}
314
315droiddoc {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900316 name: "ds-docs-java",
317 defaults: ["framework-docs-default"],
318 srcs: [
Jihoon Kang2a829bb2024-02-01 22:01:15 +0000319 ":framework-doc-stubs{.exportable}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900320 ],
321 hdf: [
322 "android.whichdoc online",
323 "android.hasSamples true",
324 ],
Mårten Kongstad2598fe02022-03-30 12:31:33 +0000325 proofread_file: "ds-docs-proofread.txt",
Anton Hansson84a0e712023-10-23 09:17:45 +0000326 flags: [
327 " -toroot /",
328 "-yamlV2",
329 "-samplegroup Admin",
330 "-samplegroup Background",
331 "-samplegroup Connectivity",
332 "-samplegroup Content",
333 "-samplegroup Input",
334 "-samplegroup Media",
335 "-samplegroup Notification",
336 "-samplegroup RenderScript",
337 "-samplegroup Security",
338 "-samplegroup Sensors",
339 "-samplegroup System",
340 "-samplegroup Testing",
341 "-samplegroup UI",
342 "-samplegroup Views",
343 "-samplegroup Wearable",
344 "-devsite",
345 "-samplesdir",
346 "development/samples/browseable",
347 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900348}
349
350droiddoc {
351 name: "ds-docs-kt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900352 srcs: [
Jihoon Kang2a829bb2024-02-01 22:01:15 +0000353 ":framework-doc-stubs{.exportable}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900354 ],
Anton Hansson84a0e712023-10-23 09:17:45 +0000355 flags: [
356 "-noJdkLink",
357 "-links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list",
Dan Willemsencece97c2020-04-20 22:32:45 -0700358 "-noStdlibLink",
Anton Hansson84a0e712023-10-23 09:17:45 +0000359 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900360 proofread_file: "ds-dokka-proofread.txt",
361 dokka_enabled: true,
362}
363
364java_genrule {
365 name: "ds-docs",
366 tools: [
367 "zip2zip",
368 "merge_zips",
369 ],
370 srcs: [
371 ":ds-docs-java{.docs.zip}",
372 ":ds-docs-kt{.docs.zip}",
373 ],
374 out: ["ds-docs.zip"],
375 dist: {
376 targets: ["docs"],
377 },
378 cmd: "$(location zip2zip) -i $(location :ds-docs-kt{.docs.zip}) -o $(genDir)/ds-docs-kt-moved.zip **/*:en/reference/kotlin && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700379 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900380}
381
Sorin Basca2fd4b162023-03-14 20:51:48 +0000382java_genrule {
383 name: "ds-docs-switched",
384 tools: [
385 "switcher4",
386 "soong_zip",
387 ],
388 srcs: [
389 ":ds-docs-java{.docs.zip}",
390 ":ds-docs-kt{.docs.zip}",
391 ],
392 out: ["ds-docs-switched.zip"],
393 dist: {
394 targets: ["docs"],
395 },
396 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
397 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
398 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
399 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
400 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
401}
Jiyong Park7fb4b182019-12-20 14:35:43 +0900402
403droiddoc {
404 name: "ds-static-docs",
405 defaults: ["framework-docs-default"],
406 srcs: [
Jihoon Kang2a829bb2024-02-01 22:01:15 +0000407 ":framework-doc-stubs{.exportable}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900408 ],
409 hdf: [
410 "android.whichdoc online",
411 ],
Anton Hansson84a0e712023-10-23 09:17:45 +0000412 flags: [
413 "-staticonly",
414 "-toroot /",
415 "-devsite",
416 "-ignoreJdLinks",
417 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900418}
419
420droiddoc {
421 name: "ds-ref-navtree-docs",
422 defaults: ["framework-docs-default"],
423 srcs: [
Jihoon Kang2a829bb2024-02-01 22:01:15 +0000424 ":framework-doc-stubs{.exportable}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900425 ],
426 hdf: [
427 "android.whichdoc online",
428 ],
Anton Hansson84a0e712023-10-23 09:17:45 +0000429 flags: [
430 "-toroot /",
431 "-atLinksNavtree",
432 "-navtreeonly",
433 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900434}