blob: c50d44634e43b2660b69027a0fb15fc7e8142e47 [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",
104 ":framework-connectivity-sources",
Roopa Sattiraju8e305772022-01-20 10:05:19 -0800105 ":framework-bluetooth-sources",
paulhuf45fe962021-12-14 23:09:55 +0800106 ":framework-connectivity-tiramisu-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100107 ":framework-graphics-srcs",
108 ":framework-mediaprovider-sources",
Chun Zhanga615ce52021-10-29 14:57:55 -0700109 ":framework-nearby-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100110 ":framework-permission-sources",
111 ":framework-permission-s-sources",
112 ":framework-scheduling-sources",
113 ":framework-sdkextensions-sources",
114 ":framework-statsd-sources",
Gavin Corkerybc006442021-11-16 22:33:10 +0000115 ":framework-supplementalprocess-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100116 ":framework-tethering-srcs",
Roshan Piusde6f1ca2021-10-14 07:34:07 -0700117 ":framework-uwb-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100118 ":framework-wifi-updatable-sources",
119 ":ike-srcs",
120 ":updatable-media-srcs",
121 ],
122}
123
Jiyong Park7fb4b182019-12-20 14:35:43 +0900124droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +0100125 name: "android-non-updatable-doc-stubs",
126 defaults: ["android-non-updatable-doc-stubs-defaults"],
127 args: metalava_framework_docs_args,
128}
129
130droidstubs {
131 name: "android-non-updatable-doc-stubs-system",
132 defaults: ["android-non-updatable-doc-stubs-defaults"],
133 args: metalava_framework_docs_args +
134 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
135}
136
137droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900138 name: "framework-doc-system-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100139 defaults: ["framework-doc-stubs-sources-default"],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000140 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000141 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
satayevbc7c83e2021-06-29 22:27:06 +0100142 api_levels_sdk_type: "system",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900143}
144
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100145droidstubs {
Anton Hansson111e1582021-10-26 14:12:10 +0000146 name: "framework-doc-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100147 defaults: ["framework-doc-stubs-default"],
Anton Hanssonecf9fc32022-01-14 12:10:01 +0000148 srcs: [":all-modules-public-stubs-source"],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100149 args: metalava_framework_docs_args,
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100150 aidl: {
151 local_include_dirs: [
152 "apex/media/aidl/stable",
153 ],
154 include_dirs: [
155 "packages/modules/Connectivity/framework/aidl-export",
156 ],
157 },
158}
159
Jiyong Park7fb4b182019-12-20 14:35:43 +0900160/////////////////////////////////////////////////////////////////////
161// API docs are created from the generated stub source files
162// using droiddoc
163/////////////////////////////////////////////////////////////////////
164
165framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
166 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
167 "-overview $(location core/java/overview.html) " +
168 // Federate Support Library references against local API file.
169 "-federate SupportLib https://developer.android.com " +
170 "-federationapi SupportLib $(location :current-support-api) " +
171 // Federate Support Library references against local API file.
172 "-federate AndroidX https://developer.android.com " +
173 "-federationapi AndroidX $(location :current-androidx-api) "
174
175doc_defaults {
176 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000177 libs: framework_docs_only_libs + [
178 "stub-annotations",
179 "unsupportedappusage",
180 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900181 html_dirs: [
182 "docs/html",
183 ],
184 knowntags: [
185 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100186 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900187 ],
188 custom_template: "droiddoc-templates-sdk",
189 resourcesdir: "docs/html/reference/images/",
190 resourcesoutdir: "reference/android/images/",
191 hdf: [
192 "dac true",
193 "sdk.codename O",
194 "sdk.preview.version 1",
195 "sdk.version 7.0",
196 "sdk.rel.id 1",
197 "sdk.preview 0",
198 ],
199 arg_files: [
200 "core/res/AndroidManifest.xml",
201 "core/java/overview.html",
202 ":current-support-api",
203 ":current-androidx-api",
204 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700205 // TODO(b/169090544): remove below aidl includes.
206 aidl: {
207 local_include_dirs: ["media/aidl"],
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600208 include_dirs: [
209 "frameworks/av/aidl",
210 "frameworks/native/libs/permission/aidl",
211 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700212 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900213}
214
215doc_defaults {
216 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900217}
218
219droiddoc {
220 name: "doc-comment-check-docs",
221 defaults: ["framework-docs-default"],
222 srcs: [
223 ":framework-doc-stubs",
224 ],
225 args: framework_docs_only_args + " -referenceonly -parsecomments",
226 installable: false,
227}
228
229droiddoc {
230 name: "offline-sdk-docs",
231 defaults: ["framework-docs-default"],
232 srcs: [
233 ":framework-doc-stubs",
234 ],
235 hdf: [
236 "android.whichdoc offline",
237 ],
atrostb1ee27b2020-02-03 11:03:16 +0000238 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900239 proofread_file: "offline-sdk-docs-proofrerad.txt",
240 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
241 static_doc_index_redirect: "docs/docs-preview-index.html",
242}
243
244droiddoc {
245 // Please sync with android-api-council@ before making any changes for the name property below.
246 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
247 // See b/116221385 for reference.
248 name: "offline-sdk-referenceonly-docs",
249 defaults: ["framework-docs-default"],
250 srcs: [
251 ":framework-doc-stubs",
252 ],
253 hdf: [
254 "android.whichdoc offline",
255 ],
256 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
257 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
258 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
259 static_doc_properties: "docs/source.properties",
260}
261
262droiddoc {
263 // Please sync with android-api-council@ before making any changes for the name property below.
264 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
265 // See b/116221385 for reference.
266 name: "offline-system-sdk-referenceonly-docs",
267 defaults: ["framework-docs-default"],
268 srcs: [
269 ":framework-doc-system-stubs",
270 ],
271 hdf: [
272 "android.whichdoc offline",
273 ],
274 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
275 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
276 " -offlinemode -title \"Android System SDK\" -referenceonly",
277 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
278 static_doc_properties: "docs/source.properties",
279}
280
281droiddoc {
282 name: "online-sdk-docs",
283 defaults: ["framework-docs-default"],
284 srcs: [
285 ":framework-doc-stubs",
286 ],
287 hdf: [
288 "android.whichdoc online",
289 "android.hasSamples true",
290 ],
291 proofread_file: "online-sdk-docs-proofrerad.txt",
292 args: framework_docs_only_args +
293 " -toroot / -samplegroup Admin " +
294 " -samplegroup Background " +
295 " -samplegroup Connectivity " +
296 " -samplegroup Content " +
297 " -samplegroup Input " +
298 " -samplegroup Media " +
299 " -samplegroup Notification " +
300 " -samplegroup RenderScript " +
301 " -samplegroup Security " +
302 " -samplegroup Sensors " +
303 " -samplegroup System " +
304 " -samplegroup Testing " +
305 " -samplegroup UI " +
306 " -samplegroup Views " +
307 " -samplegroup Wearable -samplesdir development/samples/browseable ",
308}
309
310droiddoc {
311 name: "online-system-api-sdk-docs",
312 defaults: ["framework-docs-default"],
313 srcs: [
314 ":framework-doc-system-stubs",
315 ],
316 hdf: [
317 "android.whichdoc online",
318 "android.hasSamples true",
319 ],
320 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
321 args: framework_docs_only_args +
322 " -referenceonly " +
323 " -title \"Android SDK - Including system APIs.\" " +
324 " -hide 101 " +
325 " -hide 104 " +
326 " -hide 108 " +
327 " -toroot / -samplegroup Admin " +
328 " -samplegroup Background " +
329 " -samplegroup Connectivity " +
330 " -samplegroup Content " +
331 " -samplegroup Input " +
332 " -samplegroup Media " +
333 " -samplegroup Notification " +
334 " -samplegroup RenderScript " +
335 " -samplegroup Security " +
336 " -samplegroup Sensors " +
337 " -samplegroup System " +
338 " -samplegroup Testing " +
339 " -samplegroup UI " +
340 " -samplegroup Views " +
341 " -samplegroup Wearable -samplesdir development/samples/browseable ",
342 installable: false,
343}
344
345droiddoc {
346 name: "ds-docs-java",
347 defaults: ["framework-docs-default"],
348 srcs: [
349 ":framework-doc-stubs",
350 ],
351 hdf: [
352 "android.whichdoc online",
353 "android.hasSamples true",
354 ],
355 proofread_file: "ds-docs-proofrerad.txt",
356 args: framework_docs_only_args +
357 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
358 " -samplegroup Background " +
359 " -samplegroup Connectivity " +
360 " -samplegroup Content " +
361 " -samplegroup Input " +
362 " -samplegroup Media " +
363 " -samplegroup Notification " +
364 " -samplegroup RenderScript " +
365 " -samplegroup Security " +
366 " -samplegroup Sensors " +
367 " -samplegroup System " +
368 " -samplegroup Testing " +
369 " -samplegroup UI " +
370 " -samplegroup Views " +
371 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
372}
373
374droiddoc {
375 name: "ds-docs-kt",
376 defaults: ["framework-dokka-docs-default"],
377 srcs: [
378 ":framework-doc-stubs",
379 ],
380 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700381 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900382 proofread_file: "ds-dokka-proofread.txt",
383 dokka_enabled: true,
384}
385
386java_genrule {
387 name: "ds-docs",
388 tools: [
389 "zip2zip",
390 "merge_zips",
391 ],
392 srcs: [
393 ":ds-docs-java{.docs.zip}",
394 ":ds-docs-kt{.docs.zip}",
395 ],
396 out: ["ds-docs.zip"],
397 dist: {
398 targets: ["docs"],
399 },
400 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 -0700401 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900402}
403
404java_genrule {
405 name: "ds-docs-switched",
406 tools: [
407 "switcher4",
408 "soong_zip",
409 ],
410 srcs: [
411 ":ds-docs-java{.docs.zip}",
412 ":ds-docs-kt{.docs.zip}",
413 ],
414 out: ["ds-docs-switched.zip"],
415 dist: {
416 targets: ["docs"],
417 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800418 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700419 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
420 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
421 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
422 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900423}
424
425droiddoc {
426 name: "ds-static-docs",
427 defaults: ["framework-docs-default"],
428 srcs: [
429 ":framework-doc-stubs",
430 ],
431 hdf: [
432 "android.whichdoc online",
433 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900434 args: framework_docs_only_args +
435 " -staticonly " +
436 " -toroot / " +
437 " -devsite " +
438 " -ignoreJdLinks ",
439}
440
441droiddoc {
442 name: "ds-ref-navtree-docs",
443 defaults: ["framework-docs-default"],
444 srcs: [
445 ":framework-doc-stubs",
446 ],
447 hdf: [
448 "android.whichdoc online",
449 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900450 args: framework_docs_only_args +
451 " -toroot / " +
452 " -atLinksNavtree " +
453 " -navtreeonly ",
454}
455
456droiddoc {
457 name: "online-sdk-dev-docs",
458 defaults: ["framework-docs-default"],
459 srcs: [
460 ":framework-doc-stubs",
461 ],
462 hdf: [
463 "android.whichdoc online",
464 "android.hasSamples true",
465 ],
466 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
467 args: framework_docs_only_args +
468 " -toroot / -samplegroup Admin " +
469 " -samplegroup Background " +
470 " -samplegroup Connectivity " +
471 " -samplegroup Content " +
472 " -samplegroup Input " +
473 " -samplegroup Media " +
474 " -samplegroup Notification " +
475 " -samplegroup RenderScript " +
476 " -samplegroup Security " +
477 " -samplegroup Sensors " +
478 " -samplegroup System " +
479 " -samplegroup Testing " +
480 " -samplegroup UI " +
481 " -samplegroup Views " +
482 " -samplegroup Wearable -samplesdir development/samples/browseable ",
483}
484
485droiddoc {
486 name: "hidden-docs",
487 defaults: ["framework-docs-default"],
488 srcs: [
489 ":framework-doc-stubs",
490 ],
491 proofread_file: "hidden-docs-proofrerad.txt",
492 args: framework_docs_only_args +
493 " -referenceonly " +
494 " -title \"Android SDK - Including hidden APIs.\"",
495}