blob: a193b78cd4d15ecedbb4e5b6801688b8851b21e7 [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
23/////////////////////////////////////////////////////////////////////
24// stub source files are generated using metalava
25/////////////////////////////////////////////////////////////////////
26
27framework_docs_only_libs = [
28 "voip-common",
29 "android.test.mock",
30 "android-support-annotations",
31 "android-support-compat",
32 "android-support-core-ui",
33 "android-support-core-utils",
34 "android-support-design",
35 "android-support-dynamic-animation",
36 "android-support-exifinterface",
37 "android-support-fragment",
38 "android-support-media-compat",
39 "android-support-percent",
40 "android-support-transition",
41 "android-support-v7-cardview",
42 "android-support-v7-gridlayout",
43 "android-support-v7-mediarouter",
44 "android-support-v7-palette",
45 "android-support-v7-preference",
46 "android-support-v13",
47 "android-support-v14-preference",
48 "android-support-v17-leanback",
49 "android-support-vectordrawable",
50 "android-support-animatedvectordrawable",
51 "android-support-v7-appcompat",
52 "android-support-v7-recyclerview",
53 "android-support-v8-renderscript",
54 "android-support-multidex",
55 "android-support-multidex-instrumentation",
56]
57
58stubs_defaults {
Anton Hansson867f94c2021-05-05 10:32:31 +010059 name: "android-non-updatable-doc-stubs-defaults",
Anton Hansson9dce8322022-01-24 14:14:33 +000060 defaults: [
61 "android-non-updatable-stubs-defaults",
62 "module-classpath-stubs-defaults",
63 ],
Anton Hansson867f94c2021-05-05 10:32:31 +010064 srcs: [
65 // No longer part of the stubs, but are included in the docs.
Anton Hansson78549802022-01-17 18:14:55 +000066 ":android-test-base-sources",
67 ":android-test-mock-sources",
68 ":android-test-runner-sources",
Anton Hansson867f94c2021-05-05 10:32:31 +010069 ],
70 libs: framework_docs_only_libs,
71 create_doc_stubs: true,
72 write_sdk_values: true,
73}
74
75stubs_defaults {
Jiyong Park7fb4b182019-12-20 14:35:43 +090076 name: "framework-doc-stubs-default",
Anton Hansson87f04b82022-01-17 19:27:06 +000077 defaults: ["android-non-updatable-stubs-defaults"],
Jiyong Park7fb4b182019-12-20 14:35:43 +090078 srcs: [
Anton Hansson35c0b092021-03-30 10:46:48 +010079 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010080 ":android-test-base-sources",
81 ":android-test-mock-sources",
82 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090083 ],
84 libs: framework_docs_only_libs,
85 create_doc_stubs: true,
Jiyong Park7fb4b182019-12-20 14:35:43 +090086 api_levels_annotations_enabled: true,
87 api_levels_annotations_dirs: [
88 "sdk-dir",
89 "api-versions-jars-dir",
90 ],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010091 write_sdk_values: true,
Jiyong Park7fb4b182019-12-20 14:35:43 +090092}
93
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010094// Defaults module for doc-stubs targets that use module source code as input.
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010095stubs_defaults {
96 name: "framework-doc-stubs-sources-default",
97 defaults: ["framework-doc-stubs-default"],
98 srcs: [
Anton Hanssonecf9fc32022-01-14 12:10:01 +000099 ":art.module.public.api{.public.stubs.source}",
100 ":conscrypt.module.public.api{.public.stubs.source}",
101 ":i18n.module.public.api{.public.stubs.source}",
102
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100103 ":framework-appsearch-sources",
Frank Wang07861f72022-01-25 18:41:45 +0000104 ":framework-auxiliary-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100105 ":framework-connectivity-sources",
Roopa Sattiraju8e305772022-01-20 10:05:19 -0800106 ":framework-bluetooth-sources",
paulhuf45fe962021-12-14 23:09:55 +0800107 ":framework-connectivity-tiramisu-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100108 ":framework-graphics-srcs",
109 ":framework-mediaprovider-sources",
Chun Zhanga615ce52021-10-29 14:57:55 -0700110 ":framework-nearby-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100111 ":framework-permission-sources",
112 ":framework-permission-s-sources",
113 ":framework-scheduling-sources",
114 ":framework-sdkextensions-sources",
115 ":framework-statsd-sources",
Gavin Corkerybc006442021-11-16 22:33:10 +0000116 ":framework-supplementalprocess-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100117 ":framework-tethering-srcs",
Roshan Piusde6f1ca2021-10-14 07:34:07 -0700118 ":framework-uwb-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100119 ":framework-wifi-updatable-sources",
120 ":ike-srcs",
121 ":updatable-media-srcs",
122 ],
123}
124
Jiyong Park7fb4b182019-12-20 14:35:43 +0900125droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +0100126 name: "android-non-updatable-doc-stubs",
127 defaults: ["android-non-updatable-doc-stubs-defaults"],
128 args: metalava_framework_docs_args,
129}
130
131droidstubs {
132 name: "android-non-updatable-doc-stubs-system",
133 defaults: ["android-non-updatable-doc-stubs-defaults"],
134 args: metalava_framework_docs_args +
135 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
136}
137
138droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900139 name: "framework-doc-system-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100140 defaults: ["framework-doc-stubs-sources-default"],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000141 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000142 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
satayevbc7c83e2021-06-29 22:27:06 +0100143 api_levels_sdk_type: "system",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900144}
145
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100146droidstubs {
Anton Hansson111e1582021-10-26 14:12:10 +0000147 name: "framework-doc-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100148 defaults: ["framework-doc-stubs-default"],
Anton Hanssonecf9fc32022-01-14 12:10:01 +0000149 srcs: [":all-modules-public-stubs-source"],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100150 args: metalava_framework_docs_args,
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100151 aidl: {
152 local_include_dirs: [
153 "apex/media/aidl/stable",
154 ],
155 include_dirs: [
156 "packages/modules/Connectivity/framework/aidl-export",
157 ],
158 },
159}
160
Jiyong Park7fb4b182019-12-20 14:35:43 +0900161/////////////////////////////////////////////////////////////////////
162// API docs are created from the generated stub source files
163// using droiddoc
164/////////////////////////////////////////////////////////////////////
165
166framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
167 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
168 "-overview $(location core/java/overview.html) " +
169 // Federate Support Library references against local API file.
170 "-federate SupportLib https://developer.android.com " +
171 "-federationapi SupportLib $(location :current-support-api) " +
172 // Federate Support Library references against local API file.
173 "-federate AndroidX https://developer.android.com " +
174 "-federationapi AndroidX $(location :current-androidx-api) "
175
176doc_defaults {
177 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000178 libs: framework_docs_only_libs + [
179 "stub-annotations",
180 "unsupportedappusage",
181 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900182 html_dirs: [
183 "docs/html",
184 ],
185 knowntags: [
186 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100187 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900188 ],
189 custom_template: "droiddoc-templates-sdk",
190 resourcesdir: "docs/html/reference/images/",
191 resourcesoutdir: "reference/android/images/",
192 hdf: [
193 "dac true",
194 "sdk.codename O",
195 "sdk.preview.version 1",
196 "sdk.version 7.0",
197 "sdk.rel.id 1",
198 "sdk.preview 0",
199 ],
200 arg_files: [
201 "core/res/AndroidManifest.xml",
202 "core/java/overview.html",
203 ":current-support-api",
204 ":current-androidx-api",
205 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700206 // TODO(b/169090544): remove below aidl includes.
207 aidl: {
208 local_include_dirs: ["media/aidl"],
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600209 include_dirs: [
210 "frameworks/av/aidl",
211 "frameworks/native/libs/permission/aidl",
212 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700213 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900214}
215
216doc_defaults {
217 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900218}
219
220droiddoc {
221 name: "doc-comment-check-docs",
222 defaults: ["framework-docs-default"],
223 srcs: [
224 ":framework-doc-stubs",
225 ],
226 args: framework_docs_only_args + " -referenceonly -parsecomments",
227 installable: false,
228}
229
230droiddoc {
231 name: "offline-sdk-docs",
232 defaults: ["framework-docs-default"],
233 srcs: [
234 ":framework-doc-stubs",
235 ],
236 hdf: [
237 "android.whichdoc offline",
238 ],
atrostb1ee27b2020-02-03 11:03:16 +0000239 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900240 proofread_file: "offline-sdk-docs-proofrerad.txt",
241 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
242 static_doc_index_redirect: "docs/docs-preview-index.html",
243}
244
245droiddoc {
246 // Please sync with android-api-council@ before making any changes for the name property below.
247 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
248 // See b/116221385 for reference.
249 name: "offline-sdk-referenceonly-docs",
250 defaults: ["framework-docs-default"],
251 srcs: [
252 ":framework-doc-stubs",
253 ],
254 hdf: [
255 "android.whichdoc offline",
256 ],
257 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
258 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
259 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
260 static_doc_properties: "docs/source.properties",
261}
262
263droiddoc {
264 // Please sync with android-api-council@ before making any changes for the name property below.
265 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
266 // See b/116221385 for reference.
267 name: "offline-system-sdk-referenceonly-docs",
268 defaults: ["framework-docs-default"],
269 srcs: [
270 ":framework-doc-system-stubs",
271 ],
272 hdf: [
273 "android.whichdoc offline",
274 ],
275 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
276 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
277 " -offlinemode -title \"Android System SDK\" -referenceonly",
278 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
279 static_doc_properties: "docs/source.properties",
280}
281
282droiddoc {
283 name: "online-sdk-docs",
284 defaults: ["framework-docs-default"],
285 srcs: [
286 ":framework-doc-stubs",
287 ],
288 hdf: [
289 "android.whichdoc online",
290 "android.hasSamples true",
291 ],
292 proofread_file: "online-sdk-docs-proofrerad.txt",
293 args: framework_docs_only_args +
294 " -toroot / -samplegroup Admin " +
295 " -samplegroup Background " +
296 " -samplegroup Connectivity " +
297 " -samplegroup Content " +
298 " -samplegroup Input " +
299 " -samplegroup Media " +
300 " -samplegroup Notification " +
301 " -samplegroup RenderScript " +
302 " -samplegroup Security " +
303 " -samplegroup Sensors " +
304 " -samplegroup System " +
305 " -samplegroup Testing " +
306 " -samplegroup UI " +
307 " -samplegroup Views " +
308 " -samplegroup Wearable -samplesdir development/samples/browseable ",
309}
310
311droiddoc {
312 name: "online-system-api-sdk-docs",
313 defaults: ["framework-docs-default"],
314 srcs: [
315 ":framework-doc-system-stubs",
316 ],
317 hdf: [
318 "android.whichdoc online",
319 "android.hasSamples true",
320 ],
321 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
322 args: framework_docs_only_args +
323 " -referenceonly " +
324 " -title \"Android SDK - Including system APIs.\" " +
325 " -hide 101 " +
326 " -hide 104 " +
327 " -hide 108 " +
328 " -toroot / -samplegroup Admin " +
329 " -samplegroup Background " +
330 " -samplegroup Connectivity " +
331 " -samplegroup Content " +
332 " -samplegroup Input " +
333 " -samplegroup Media " +
334 " -samplegroup Notification " +
335 " -samplegroup RenderScript " +
336 " -samplegroup Security " +
337 " -samplegroup Sensors " +
338 " -samplegroup System " +
339 " -samplegroup Testing " +
340 " -samplegroup UI " +
341 " -samplegroup Views " +
342 " -samplegroup Wearable -samplesdir development/samples/browseable ",
343 installable: false,
344}
345
346droiddoc {
347 name: "ds-docs-java",
348 defaults: ["framework-docs-default"],
349 srcs: [
350 ":framework-doc-stubs",
351 ],
352 hdf: [
353 "android.whichdoc online",
354 "android.hasSamples true",
355 ],
356 proofread_file: "ds-docs-proofrerad.txt",
357 args: framework_docs_only_args +
358 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
359 " -samplegroup Background " +
360 " -samplegroup Connectivity " +
361 " -samplegroup Content " +
362 " -samplegroup Input " +
363 " -samplegroup Media " +
364 " -samplegroup Notification " +
365 " -samplegroup RenderScript " +
366 " -samplegroup Security " +
367 " -samplegroup Sensors " +
368 " -samplegroup System " +
369 " -samplegroup Testing " +
370 " -samplegroup UI " +
371 " -samplegroup Views " +
372 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
373}
374
375droiddoc {
376 name: "ds-docs-kt",
377 defaults: ["framework-dokka-docs-default"],
378 srcs: [
379 ":framework-doc-stubs",
380 ],
381 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700382 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900383 proofread_file: "ds-dokka-proofread.txt",
384 dokka_enabled: true,
385}
386
387java_genrule {
388 name: "ds-docs",
389 tools: [
390 "zip2zip",
391 "merge_zips",
392 ],
393 srcs: [
394 ":ds-docs-java{.docs.zip}",
395 ":ds-docs-kt{.docs.zip}",
396 ],
397 out: ["ds-docs.zip"],
398 dist: {
399 targets: ["docs"],
400 },
401 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 -0700402 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900403}
404
405java_genrule {
406 name: "ds-docs-switched",
407 tools: [
408 "switcher4",
409 "soong_zip",
410 ],
411 srcs: [
412 ":ds-docs-java{.docs.zip}",
413 ":ds-docs-kt{.docs.zip}",
414 ],
415 out: ["ds-docs-switched.zip"],
416 dist: {
417 targets: ["docs"],
418 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800419 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700420 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
421 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
422 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
423 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900424}
425
426droiddoc {
427 name: "ds-static-docs",
428 defaults: ["framework-docs-default"],
429 srcs: [
430 ":framework-doc-stubs",
431 ],
432 hdf: [
433 "android.whichdoc online",
434 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900435 args: framework_docs_only_args +
436 " -staticonly " +
437 " -toroot / " +
438 " -devsite " +
439 " -ignoreJdLinks ",
440}
441
442droiddoc {
443 name: "ds-ref-navtree-docs",
444 defaults: ["framework-docs-default"],
445 srcs: [
446 ":framework-doc-stubs",
447 ],
448 hdf: [
449 "android.whichdoc online",
450 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900451 args: framework_docs_only_args +
452 " -toroot / " +
453 " -atLinksNavtree " +
454 " -navtreeonly ",
455}
456
457droiddoc {
458 name: "online-sdk-dev-docs",
459 defaults: ["framework-docs-default"],
460 srcs: [
461 ":framework-doc-stubs",
462 ],
463 hdf: [
464 "android.whichdoc online",
465 "android.hasSamples true",
466 ],
467 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
468 args: framework_docs_only_args +
469 " -toroot / -samplegroup Admin " +
470 " -samplegroup Background " +
471 " -samplegroup Connectivity " +
472 " -samplegroup Content " +
473 " -samplegroup Input " +
474 " -samplegroup Media " +
475 " -samplegroup Notification " +
476 " -samplegroup RenderScript " +
477 " -samplegroup Security " +
478 " -samplegroup Sensors " +
479 " -samplegroup System " +
480 " -samplegroup Testing " +
481 " -samplegroup UI " +
482 " -samplegroup Views " +
483 " -samplegroup Wearable -samplesdir development/samples/browseable ",
484}
485
486droiddoc {
487 name: "hidden-docs",
488 defaults: ["framework-docs-default"],
489 srcs: [
490 ":framework-doc-stubs",
491 ],
492 proofread_file: "hidden-docs-proofrerad.txt",
493 args: framework_docs_only_args +
494 " -referenceonly " +
495 " -title \"Android SDK - Including hidden APIs.\"",
496}