blob: 4b5f4739bbb9b849bebded10fd4e9702a5bc2623 [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",
60 defaults: ["android-non-updatable-stubs-defaults"],
61 srcs: [
62 // No longer part of the stubs, but are included in the docs.
Anton Hansson78549802022-01-17 18:14:55 +000063 ":android-test-base-sources",
64 ":android-test-mock-sources",
65 ":android-test-runner-sources",
Anton Hansson867f94c2021-05-05 10:32:31 +010066 ],
67 libs: framework_docs_only_libs,
68 create_doc_stubs: true,
69 write_sdk_values: true,
70}
71
72stubs_defaults {
Jiyong Park7fb4b182019-12-20 14:35:43 +090073 name: "framework-doc-stubs-default",
74 srcs: [
Anton Hansson867f94c2021-05-05 10:32:31 +010075 ":android-non-updatable-stub-sources",
Anton Hansson35c0b092021-03-30 10:46:48 +010076
Anton Hansson35c0b092021-03-30 10:46:48 +010077 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010078 ":android-test-base-sources",
79 ":android-test-mock-sources",
80 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090081 ],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010082 arg_files: [
83 "core/res/AndroidManifest.xml",
84 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +090085 libs: framework_docs_only_libs,
86 create_doc_stubs: true,
87 annotations_enabled: true,
Anton Hansson76ac4cc2021-05-05 19:22:52 +010088 filter_packages: packages_to_document,
Jiyong Park7fb4b182019-12-20 14:35:43 +090089 api_levels_annotations_enabled: true,
90 api_levels_annotations_dirs: [
91 "sdk-dir",
92 "api-versions-jars-dir",
93 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +010094 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +090095 merge_annotations_dirs: [
96 "metalava-manual",
97 ],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010098 write_sdk_values: true,
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -070099 // TODO(b/169090544): remove below aidl includes.
100 aidl: {
101 local_include_dirs: ["media/aidl"],
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600102 include_dirs: [
103 "frameworks/av/aidl",
104 "frameworks/native/libs/permission/aidl",
105 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700106 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900107}
108
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100109// Defaults module for doc-stubs targets that use module source code as input.
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100110stubs_defaults {
111 name: "framework-doc-stubs-sources-default",
112 defaults: ["framework-doc-stubs-default"],
113 srcs: [
Anton Hansson4468d7c2022-01-14 12:10:01 +0000114 ":art.module.public.api{.public.stubs.source}",
115 ":conscrypt.module.public.api{.public.stubs.source}",
116 ":i18n.module.public.api{.public.stubs.source}",
117
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100118 ":framework-appsearch-sources",
119 ":framework-connectivity-sources",
120 ":framework-graphics-srcs",
121 ":framework-mediaprovider-sources",
122 ":framework-permission-sources",
123 ":framework-permission-s-sources",
124 ":framework-scheduling-sources",
125 ":framework-sdkextensions-sources",
126 ":framework-statsd-sources",
127 ":framework-tethering-srcs",
128 ":framework-wifi-updatable-sources",
129 ":ike-srcs",
130 ":updatable-media-srcs",
131 ],
132}
133
Jiyong Park7fb4b182019-12-20 14:35:43 +0900134droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +0100135 name: "android-non-updatable-doc-stubs",
136 defaults: ["android-non-updatable-doc-stubs-defaults"],
137 args: metalava_framework_docs_args,
138}
139
140droidstubs {
141 name: "android-non-updatable-doc-stubs-system",
142 defaults: ["android-non-updatable-doc-stubs-defaults"],
143 args: metalava_framework_docs_args +
144 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
145}
146
147droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900148 name: "framework-doc-system-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100149 defaults: ["framework-doc-stubs-sources-default"],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000150 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000151 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
satayevbc7c83e2021-06-29 22:27:06 +0100152 api_levels_sdk_type: "system",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900153}
154
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100155droidstubs {
Anton Hansson111e1582021-10-26 14:12:10 +0000156 name: "framework-doc-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100157 defaults: ["framework-doc-stubs-default"],
Anton Hansson4468d7c2022-01-14 12:10:01 +0000158 srcs: [":all-modules-public-stubs-source"],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100159 args: metalava_framework_docs_args,
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100160 aidl: {
161 local_include_dirs: [
162 "apex/media/aidl/stable",
163 ],
164 include_dirs: [
165 "packages/modules/Connectivity/framework/aidl-export",
166 ],
167 },
168}
169
Jiyong Park7fb4b182019-12-20 14:35:43 +0900170/////////////////////////////////////////////////////////////////////
171// API docs are created from the generated stub source files
172// using droiddoc
173/////////////////////////////////////////////////////////////////////
174
175framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
176 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
177 "-overview $(location core/java/overview.html) " +
178 // Federate Support Library references against local API file.
179 "-federate SupportLib https://developer.android.com " +
180 "-federationapi SupportLib $(location :current-support-api) " +
181 // Federate Support Library references against local API file.
182 "-federate AndroidX https://developer.android.com " +
183 "-federationapi AndroidX $(location :current-androidx-api) "
184
185doc_defaults {
186 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000187 libs: framework_docs_only_libs + [
188 "stub-annotations",
189 "unsupportedappusage",
190 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900191 html_dirs: [
192 "docs/html",
193 ],
194 knowntags: [
195 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100196 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900197 ],
198 custom_template: "droiddoc-templates-sdk",
199 resourcesdir: "docs/html/reference/images/",
200 resourcesoutdir: "reference/android/images/",
201 hdf: [
202 "dac true",
203 "sdk.codename O",
204 "sdk.preview.version 1",
205 "sdk.version 7.0",
206 "sdk.rel.id 1",
207 "sdk.preview 0",
208 ],
209 arg_files: [
210 "core/res/AndroidManifest.xml",
211 "core/java/overview.html",
212 ":current-support-api",
213 ":current-androidx-api",
214 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700215 // TODO(b/169090544): remove below aidl includes.
216 aidl: {
217 local_include_dirs: ["media/aidl"],
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600218 include_dirs: [
219 "frameworks/av/aidl",
220 "frameworks/native/libs/permission/aidl",
221 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700222 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900223}
224
225doc_defaults {
226 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900227}
228
229droiddoc {
230 name: "doc-comment-check-docs",
231 defaults: ["framework-docs-default"],
232 srcs: [
233 ":framework-doc-stubs",
234 ],
235 args: framework_docs_only_args + " -referenceonly -parsecomments",
236 installable: false,
237}
238
239droiddoc {
240 name: "offline-sdk-docs",
241 defaults: ["framework-docs-default"],
242 srcs: [
243 ":framework-doc-stubs",
244 ],
245 hdf: [
246 "android.whichdoc offline",
247 ],
atrostb1ee27b2020-02-03 11:03:16 +0000248 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900249 proofread_file: "offline-sdk-docs-proofrerad.txt",
250 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
251 static_doc_index_redirect: "docs/docs-preview-index.html",
252}
253
254droiddoc {
255 // Please sync with android-api-council@ before making any changes for the name property below.
256 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
257 // See b/116221385 for reference.
258 name: "offline-sdk-referenceonly-docs",
259 defaults: ["framework-docs-default"],
260 srcs: [
261 ":framework-doc-stubs",
262 ],
263 hdf: [
264 "android.whichdoc offline",
265 ],
266 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
267 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
268 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
269 static_doc_properties: "docs/source.properties",
270}
271
272droiddoc {
273 // Please sync with android-api-council@ before making any changes for the name property below.
274 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
275 // See b/116221385 for reference.
276 name: "offline-system-sdk-referenceonly-docs",
277 defaults: ["framework-docs-default"],
278 srcs: [
279 ":framework-doc-system-stubs",
280 ],
281 hdf: [
282 "android.whichdoc offline",
283 ],
284 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
285 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
286 " -offlinemode -title \"Android System SDK\" -referenceonly",
287 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
288 static_doc_properties: "docs/source.properties",
289}
290
291droiddoc {
292 name: "online-sdk-docs",
293 defaults: ["framework-docs-default"],
294 srcs: [
295 ":framework-doc-stubs",
296 ],
297 hdf: [
298 "android.whichdoc online",
299 "android.hasSamples true",
300 ],
301 proofread_file: "online-sdk-docs-proofrerad.txt",
302 args: framework_docs_only_args +
303 " -toroot / -samplegroup Admin " +
304 " -samplegroup Background " +
305 " -samplegroup Connectivity " +
306 " -samplegroup Content " +
307 " -samplegroup Input " +
308 " -samplegroup Media " +
309 " -samplegroup Notification " +
310 " -samplegroup RenderScript " +
311 " -samplegroup Security " +
312 " -samplegroup Sensors " +
313 " -samplegroup System " +
314 " -samplegroup Testing " +
315 " -samplegroup UI " +
316 " -samplegroup Views " +
317 " -samplegroup Wearable -samplesdir development/samples/browseable ",
318}
319
320droiddoc {
321 name: "online-system-api-sdk-docs",
322 defaults: ["framework-docs-default"],
323 srcs: [
324 ":framework-doc-system-stubs",
325 ],
326 hdf: [
327 "android.whichdoc online",
328 "android.hasSamples true",
329 ],
330 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
331 args: framework_docs_only_args +
332 " -referenceonly " +
333 " -title \"Android SDK - Including system APIs.\" " +
334 " -hide 101 " +
335 " -hide 104 " +
336 " -hide 108 " +
337 " -toroot / -samplegroup Admin " +
338 " -samplegroup Background " +
339 " -samplegroup Connectivity " +
340 " -samplegroup Content " +
341 " -samplegroup Input " +
342 " -samplegroup Media " +
343 " -samplegroup Notification " +
344 " -samplegroup RenderScript " +
345 " -samplegroup Security " +
346 " -samplegroup Sensors " +
347 " -samplegroup System " +
348 " -samplegroup Testing " +
349 " -samplegroup UI " +
350 " -samplegroup Views " +
351 " -samplegroup Wearable -samplesdir development/samples/browseable ",
352 installable: false,
353}
354
355droiddoc {
356 name: "ds-docs-java",
357 defaults: ["framework-docs-default"],
358 srcs: [
359 ":framework-doc-stubs",
360 ],
361 hdf: [
362 "android.whichdoc online",
363 "android.hasSamples true",
364 ],
365 proofread_file: "ds-docs-proofrerad.txt",
366 args: framework_docs_only_args +
367 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
368 " -samplegroup Background " +
369 " -samplegroup Connectivity " +
370 " -samplegroup Content " +
371 " -samplegroup Input " +
372 " -samplegroup Media " +
373 " -samplegroup Notification " +
374 " -samplegroup RenderScript " +
375 " -samplegroup Security " +
376 " -samplegroup Sensors " +
377 " -samplegroup System " +
378 " -samplegroup Testing " +
379 " -samplegroup UI " +
380 " -samplegroup Views " +
381 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
382}
383
384droiddoc {
385 name: "ds-docs-kt",
386 defaults: ["framework-dokka-docs-default"],
387 srcs: [
388 ":framework-doc-stubs",
389 ],
390 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700391 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900392 proofread_file: "ds-dokka-proofread.txt",
393 dokka_enabled: true,
394}
395
396java_genrule {
397 name: "ds-docs",
398 tools: [
399 "zip2zip",
400 "merge_zips",
401 ],
402 srcs: [
403 ":ds-docs-java{.docs.zip}",
404 ":ds-docs-kt{.docs.zip}",
405 ],
406 out: ["ds-docs.zip"],
407 dist: {
408 targets: ["docs"],
409 },
410 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 -0700411 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900412}
413
414java_genrule {
415 name: "ds-docs-switched",
416 tools: [
417 "switcher4",
418 "soong_zip",
419 ],
420 srcs: [
421 ":ds-docs-java{.docs.zip}",
422 ":ds-docs-kt{.docs.zip}",
423 ],
424 out: ["ds-docs-switched.zip"],
425 dist: {
426 targets: ["docs"],
427 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800428 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700429 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
430 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
431 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
432 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900433}
434
435droiddoc {
436 name: "ds-static-docs",
437 defaults: ["framework-docs-default"],
438 srcs: [
439 ":framework-doc-stubs",
440 ],
441 hdf: [
442 "android.whichdoc online",
443 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900444 args: framework_docs_only_args +
445 " -staticonly " +
446 " -toroot / " +
447 " -devsite " +
448 " -ignoreJdLinks ",
449}
450
451droiddoc {
452 name: "ds-ref-navtree-docs",
453 defaults: ["framework-docs-default"],
454 srcs: [
455 ":framework-doc-stubs",
456 ],
457 hdf: [
458 "android.whichdoc online",
459 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900460 args: framework_docs_only_args +
461 " -toroot / " +
462 " -atLinksNavtree " +
463 " -navtreeonly ",
464}
465
466droiddoc {
467 name: "online-sdk-dev-docs",
468 defaults: ["framework-docs-default"],
469 srcs: [
470 ":framework-doc-stubs",
471 ],
472 hdf: [
473 "android.whichdoc online",
474 "android.hasSamples true",
475 ],
476 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
477 args: framework_docs_only_args +
478 " -toroot / -samplegroup Admin " +
479 " -samplegroup Background " +
480 " -samplegroup Connectivity " +
481 " -samplegroup Content " +
482 " -samplegroup Input " +
483 " -samplegroup Media " +
484 " -samplegroup Notification " +
485 " -samplegroup RenderScript " +
486 " -samplegroup Security " +
487 " -samplegroup Sensors " +
488 " -samplegroup System " +
489 " -samplegroup Testing " +
490 " -samplegroup UI " +
491 " -samplegroup Views " +
492 " -samplegroup Wearable -samplesdir development/samples/browseable ",
493}
494
495droiddoc {
496 name: "hidden-docs",
497 defaults: ["framework-docs-default"],
498 srcs: [
499 ":framework-doc-stubs",
500 ],
501 proofread_file: "hidden-docs-proofrerad.txt",
502 args: framework_docs_only_args +
503 " -referenceonly " +
504 " -title \"Android SDK - Including hidden APIs.\"",
505}