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