blob: ca019ee1786b7884c30c91415a297eb2dc65933e [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
Anton Hansson5aa59332022-01-21 16:32:31 +000058// These defaults enable doc-stub generation, api lint database generation and sdk value generation.
Jiyong Park7fb4b182019-12-20 14:35:43 +090059stubs_defaults {
Anton Hansson867f94c2021-05-05 10:32:31 +010060 name: "android-non-updatable-doc-stubs-defaults",
Anton Hansson87f04b82022-01-17 19:27:06 +000061 defaults: ["android-non-updatable-stubs-defaults"],
Jiyong Park7fb4b182019-12-20 14:35:43 +090062 srcs: [
Anton Hansson35c0b092021-03-30 10:46:48 +010063 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010064 ":android-test-base-sources",
65 ":android-test-mock-sources",
66 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090067 ],
68 libs: framework_docs_only_libs,
69 create_doc_stubs: true,
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010070 write_sdk_values: true,
Jiyong Park7fb4b182019-12-20 14:35:43 +090071}
72
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010073// Defaults module for doc-stubs targets that use module source code as input.
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010074stubs_defaults {
75 name: "framework-doc-stubs-sources-default",
Anton Hansson5aa59332022-01-21 16:32:31 +000076 defaults: ["android-non-updatable-doc-stubs-defaults"],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010077 srcs: [
Anton Hansson4468d7c2022-01-14 12:10:01 +000078 ":art.module.public.api{.public.stubs.source}",
79 ":conscrypt.module.public.api{.public.stubs.source}",
80 ":i18n.module.public.api{.public.stubs.source}",
81
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010082 ":framework-appsearch-sources",
83 ":framework-connectivity-sources",
paulhuc100db52021-12-14 23:09:55 +080084 ":framework-connectivity-tiramisu-updatable-sources",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +010085 ":framework-graphics-srcs",
86 ":framework-mediaprovider-sources",
87 ":framework-permission-sources",
88 ":framework-permission-s-sources",
89 ":framework-scheduling-sources",
90 ":framework-sdkextensions-sources",
91 ":framework-statsd-sources",
92 ":framework-tethering-srcs",
93 ":framework-wifi-updatable-sources",
94 ":ike-srcs",
95 ":updatable-media-srcs",
96 ],
97}
98
Jiyong Park7fb4b182019-12-20 14:35:43 +090099droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +0100100 name: "android-non-updatable-doc-stubs",
Anton Hansson5aa59332022-01-21 16:32:31 +0000101 defaults: [
102 "android-non-updatable-doc-stubs-defaults",
103 "module-classpath-stubs-defaults",
104 ],
Anton Hansson867f94c2021-05-05 10:32:31 +0100105 args: metalava_framework_docs_args,
106}
107
108droidstubs {
109 name: "android-non-updatable-doc-stubs-system",
Anton Hansson5aa59332022-01-21 16:32:31 +0000110 defaults: [
111 "android-non-updatable-doc-stubs-defaults",
112 "module-classpath-stubs-defaults",
113 ],
Anton Hansson867f94c2021-05-05 10:32:31 +0100114 args: metalava_framework_docs_args +
115 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
116}
117
118droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900119 name: "framework-doc-system-stubs",
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100120 defaults: ["framework-doc-stubs-sources-default"],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000121 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000122 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Anton Hansson5aa59332022-01-21 16:32:31 +0000123 api_levels_annotations_enabled: true,
124 api_levels_annotations_dirs: [
125 "sdk-dir",
126 "api-versions-jars-dir",
127 ],
satayevbc7c83e2021-06-29 22:27:06 +0100128 api_levels_sdk_type: "system",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900129}
130
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100131droidstubs {
Anton Hansson111e1582021-10-26 14:12:10 +0000132 name: "framework-doc-stubs",
Anton Hansson5aa59332022-01-21 16:32:31 +0000133 defaults: ["android-non-updatable-doc-stubs-defaults"],
Anton Hansson4468d7c2022-01-14 12:10:01 +0000134 srcs: [":all-modules-public-stubs-source"],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100135 args: metalava_framework_docs_args,
Anton Hansson5aa59332022-01-21 16:32:31 +0000136 api_levels_annotations_enabled: true,
137 api_levels_annotations_dirs: [
138 "sdk-dir",
139 "api-versions-jars-dir",
140 ],
Anton Hanssonfa5d0bc2021-09-17 16:09:08 +0100141 aidl: {
142 local_include_dirs: [
143 "apex/media/aidl/stable",
144 ],
145 include_dirs: [
146 "packages/modules/Connectivity/framework/aidl-export",
147 ],
148 },
149}
150
Jiyong Park7fb4b182019-12-20 14:35:43 +0900151/////////////////////////////////////////////////////////////////////
152// API docs are created from the generated stub source files
153// using droiddoc
154/////////////////////////////////////////////////////////////////////
155
156framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
157 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
158 "-overview $(location core/java/overview.html) " +
159 // Federate Support Library references against local API file.
160 "-federate SupportLib https://developer.android.com " +
161 "-federationapi SupportLib $(location :current-support-api) " +
162 // Federate Support Library references against local API file.
163 "-federate AndroidX https://developer.android.com " +
164 "-federationapi AndroidX $(location :current-androidx-api) "
165
166doc_defaults {
167 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000168 libs: framework_docs_only_libs + [
169 "stub-annotations",
170 "unsupportedappusage",
171 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900172 html_dirs: [
173 "docs/html",
174 ],
175 knowntags: [
176 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100177 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900178 ],
179 custom_template: "droiddoc-templates-sdk",
180 resourcesdir: "docs/html/reference/images/",
181 resourcesoutdir: "reference/android/images/",
182 hdf: [
183 "dac true",
184 "sdk.codename O",
185 "sdk.preview.version 1",
186 "sdk.version 7.0",
187 "sdk.rel.id 1",
188 "sdk.preview 0",
189 ],
190 arg_files: [
191 "core/res/AndroidManifest.xml",
192 "core/java/overview.html",
193 ":current-support-api",
194 ":current-androidx-api",
195 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700196 // TODO(b/169090544): remove below aidl includes.
197 aidl: {
198 local_include_dirs: ["media/aidl"],
Jeff Sharkey75d4f932021-07-26 15:41:01 -0600199 include_dirs: [
200 "frameworks/av/aidl",
201 "frameworks/native/libs/permission/aidl",
202 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700203 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900204}
205
206doc_defaults {
207 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900208}
209
210droiddoc {
211 name: "doc-comment-check-docs",
212 defaults: ["framework-docs-default"],
213 srcs: [
214 ":framework-doc-stubs",
215 ],
216 args: framework_docs_only_args + " -referenceonly -parsecomments",
217 installable: false,
218}
219
220droiddoc {
221 name: "offline-sdk-docs",
222 defaults: ["framework-docs-default"],
223 srcs: [
224 ":framework-doc-stubs",
225 ],
226 hdf: [
227 "android.whichdoc offline",
228 ],
atrostb1ee27b2020-02-03 11:03:16 +0000229 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900230 proofread_file: "offline-sdk-docs-proofrerad.txt",
231 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
232 static_doc_index_redirect: "docs/docs-preview-index.html",
233}
234
235droiddoc {
236 // Please sync with android-api-council@ before making any changes for the name property below.
237 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
238 // See b/116221385 for reference.
239 name: "offline-sdk-referenceonly-docs",
240 defaults: ["framework-docs-default"],
241 srcs: [
242 ":framework-doc-stubs",
243 ],
244 hdf: [
245 "android.whichdoc offline",
246 ],
247 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
248 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
249 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
250 static_doc_properties: "docs/source.properties",
251}
252
253droiddoc {
254 // Please sync with android-api-council@ before making any changes for the name property below.
255 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
256 // See b/116221385 for reference.
257 name: "offline-system-sdk-referenceonly-docs",
258 defaults: ["framework-docs-default"],
259 srcs: [
260 ":framework-doc-system-stubs",
261 ],
262 hdf: [
263 "android.whichdoc offline",
264 ],
265 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
266 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
267 " -offlinemode -title \"Android System SDK\" -referenceonly",
268 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
269 static_doc_properties: "docs/source.properties",
270}
271
272droiddoc {
273 name: "online-sdk-docs",
274 defaults: ["framework-docs-default"],
275 srcs: [
276 ":framework-doc-stubs",
277 ],
278 hdf: [
279 "android.whichdoc online",
280 "android.hasSamples true",
281 ],
282 proofread_file: "online-sdk-docs-proofrerad.txt",
283 args: framework_docs_only_args +
284 " -toroot / -samplegroup Admin " +
285 " -samplegroup Background " +
286 " -samplegroup Connectivity " +
287 " -samplegroup Content " +
288 " -samplegroup Input " +
289 " -samplegroup Media " +
290 " -samplegroup Notification " +
291 " -samplegroup RenderScript " +
292 " -samplegroup Security " +
293 " -samplegroup Sensors " +
294 " -samplegroup System " +
295 " -samplegroup Testing " +
296 " -samplegroup UI " +
297 " -samplegroup Views " +
298 " -samplegroup Wearable -samplesdir development/samples/browseable ",
299}
300
301droiddoc {
302 name: "online-system-api-sdk-docs",
303 defaults: ["framework-docs-default"],
304 srcs: [
305 ":framework-doc-system-stubs",
306 ],
307 hdf: [
308 "android.whichdoc online",
309 "android.hasSamples true",
310 ],
311 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
312 args: framework_docs_only_args +
313 " -referenceonly " +
314 " -title \"Android SDK - Including system APIs.\" " +
315 " -hide 101 " +
316 " -hide 104 " +
317 " -hide 108 " +
318 " -toroot / -samplegroup Admin " +
319 " -samplegroup Background " +
320 " -samplegroup Connectivity " +
321 " -samplegroup Content " +
322 " -samplegroup Input " +
323 " -samplegroup Media " +
324 " -samplegroup Notification " +
325 " -samplegroup RenderScript " +
326 " -samplegroup Security " +
327 " -samplegroup Sensors " +
328 " -samplegroup System " +
329 " -samplegroup Testing " +
330 " -samplegroup UI " +
331 " -samplegroup Views " +
332 " -samplegroup Wearable -samplesdir development/samples/browseable ",
333 installable: false,
334}
335
336droiddoc {
337 name: "ds-docs-java",
338 defaults: ["framework-docs-default"],
339 srcs: [
340 ":framework-doc-stubs",
341 ],
342 hdf: [
343 "android.whichdoc online",
344 "android.hasSamples true",
345 ],
346 proofread_file: "ds-docs-proofrerad.txt",
347 args: framework_docs_only_args +
348 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
349 " -samplegroup Background " +
350 " -samplegroup Connectivity " +
351 " -samplegroup Content " +
352 " -samplegroup Input " +
353 " -samplegroup Media " +
354 " -samplegroup Notification " +
355 " -samplegroup RenderScript " +
356 " -samplegroup Security " +
357 " -samplegroup Sensors " +
358 " -samplegroup System " +
359 " -samplegroup Testing " +
360 " -samplegroup UI " +
361 " -samplegroup Views " +
362 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
363}
364
365droiddoc {
366 name: "ds-docs-kt",
367 defaults: ["framework-dokka-docs-default"],
368 srcs: [
369 ":framework-doc-stubs",
370 ],
371 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700372 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900373 proofread_file: "ds-dokka-proofread.txt",
374 dokka_enabled: true,
375}
376
377java_genrule {
378 name: "ds-docs",
379 tools: [
380 "zip2zip",
381 "merge_zips",
382 ],
383 srcs: [
384 ":ds-docs-java{.docs.zip}",
385 ":ds-docs-kt{.docs.zip}",
386 ],
387 out: ["ds-docs.zip"],
388 dist: {
389 targets: ["docs"],
390 },
391 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 -0700392 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900393}
394
395java_genrule {
396 name: "ds-docs-switched",
397 tools: [
398 "switcher4",
399 "soong_zip",
400 ],
401 srcs: [
402 ":ds-docs-java{.docs.zip}",
403 ":ds-docs-kt{.docs.zip}",
404 ],
405 out: ["ds-docs-switched.zip"],
406 dist: {
407 targets: ["docs"],
408 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800409 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700410 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
411 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
412 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
413 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900414}
415
416droiddoc {
417 name: "ds-static-docs",
418 defaults: ["framework-docs-default"],
419 srcs: [
420 ":framework-doc-stubs",
421 ],
422 hdf: [
423 "android.whichdoc online",
424 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900425 args: framework_docs_only_args +
426 " -staticonly " +
427 " -toroot / " +
428 " -devsite " +
429 " -ignoreJdLinks ",
430}
431
432droiddoc {
433 name: "ds-ref-navtree-docs",
434 defaults: ["framework-docs-default"],
435 srcs: [
436 ":framework-doc-stubs",
437 ],
438 hdf: [
439 "android.whichdoc online",
440 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900441 args: framework_docs_only_args +
442 " -toroot / " +
443 " -atLinksNavtree " +
444 " -navtreeonly ",
445}
446
447droiddoc {
448 name: "online-sdk-dev-docs",
449 defaults: ["framework-docs-default"],
450 srcs: [
451 ":framework-doc-stubs",
452 ],
453 hdf: [
454 "android.whichdoc online",
455 "android.hasSamples true",
456 ],
457 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
458 args: framework_docs_only_args +
459 " -toroot / -samplegroup Admin " +
460 " -samplegroup Background " +
461 " -samplegroup Connectivity " +
462 " -samplegroup Content " +
463 " -samplegroup Input " +
464 " -samplegroup Media " +
465 " -samplegroup Notification " +
466 " -samplegroup RenderScript " +
467 " -samplegroup Security " +
468 " -samplegroup Sensors " +
469 " -samplegroup System " +
470 " -samplegroup Testing " +
471 " -samplegroup UI " +
472 " -samplegroup Views " +
473 " -samplegroup Wearable -samplesdir development/samples/browseable ",
474}
475
476droiddoc {
477 name: "hidden-docs",
478 defaults: ["framework-docs-default"],
479 srcs: [
480 ":framework-doc-stubs",
481 ],
482 proofread_file: "hidden-docs-proofrerad.txt",
483 args: framework_docs_only_args +
484 " -referenceonly " +
485 " -title \"Android SDK - Including hidden APIs.\"",
486}