blob: 17676787375c77de0dc24161ffd3fbe7fc571340 [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 Hanssonc7f5e7d2021-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.
63 "test-base/src/**/*.java",
64 "test-mock/src/**/*.java",
65 "test-runner/src/**/*.java",
66 ],
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 Hanssonc7f5e7d2021-05-05 10:32:31 +010075 ":android-non-updatable-stub-sources",
Anton Hansson703cde02021-03-30 10:46:48 +010076
77 // Module sources
Paul Duffin404b26a2020-09-16 14:26:47 +010078 ":art.module.public.api{.public.stubs.source}",
Paul Duffine55d4e32020-05-14 17:55:46 +010079 ":conscrypt.module.public.api{.public.stubs.source}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000080 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson703cde02021-03-30 10:46:48 +010081
82 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010083 ":android-test-base-sources",
84 ":android-test-mock-sources",
85 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090086 ],
Anton Hansson64921262021-09-17 16:09:08 +010087 arg_files: [
88 "core/res/AndroidManifest.xml",
89 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +090090 libs: framework_docs_only_libs,
91 create_doc_stubs: true,
92 annotations_enabled: true,
Anton Hansson76ac4cc2021-05-05 19:22:52 +010093 filter_packages: packages_to_document,
Jiyong Park7fb4b182019-12-20 14:35:43 +090094 api_levels_annotations_enabled: true,
95 api_levels_annotations_dirs: [
96 "sdk-dir",
97 "api-versions-jars-dir",
98 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +010099 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900100 merge_annotations_dirs: [
101 "metalava-manual",
102 ],
Anton Hansson64921262021-09-17 16:09:08 +0100103 write_sdk_values: true,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900104}
105
106droidstubs {
Anton Hanssonc7f5e7d2021-05-05 10:32:31 +0100107 name: "android-non-updatable-doc-stubs",
108 defaults: ["android-non-updatable-doc-stubs-defaults"],
109 args: metalava_framework_docs_args,
110}
111
Anton Hansson64921262021-09-17 16:09:08 +0100112// Defaults module for doc-stubs targets that use module source code as input.
113// This is the default/normal.
114stubs_defaults {
115 name: "framework-doc-stubs-sources-default",
116 defaults: ["framework-doc-stubs-default"],
117 srcs: [
118 ":framework-connectivity-sources",
119 ":framework-mediaprovider-sources",
120 ":framework-permission-sources",
121 ":framework-sdkextensions-sources",
122 ":framework-statsd-sources",
123 ":framework-tethering-srcs",
124 ":framework-wifi-updatable-sources",
125 ":ike-srcs",
126 ":updatable-media-srcs",
127 ],
128}
129
Anton Hanssonc7f5e7d2021-05-05 10:32:31 +0100130droidstubs {
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-stubs",
Anton Hansson64921262021-09-17 16:09:08 +0100139 defaults: ["framework-doc-stubs-sources-default"],
Anton Hansson26c843f2021-05-05 11:11:57 +0100140 args: metalava_framework_docs_args,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900141}
142
143droidstubs {
144 name: "framework-doc-system-stubs",
Anton Hansson64921262021-09-17 16:09:08 +0100145 defaults: ["framework-doc-stubs-sources-default"],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000146 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000147 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
satayevbc7c83e2021-06-29 22:27:06 +0100148 api_levels_sdk_type: "system",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900149}
150
Anton Hansson64921262021-09-17 16:09:08 +0100151// Experimental target building doc stubs with module stub source code as input.
152// This is intended to eventually replace framework-doc-stubs, once all diffs
153// have been eliminated.
154droidstubs {
155 name: "framework-doc-stubs-module-stubs",
156 defaults: ["framework-doc-stubs-default"],
157 args: metalava_framework_docs_args,
158 srcs: [
159 ":android.net.ipsec.ike{.public.stubs.source}",
160 ":framework-connectivity{.public.stubs.source}",
161 ":framework-media{.public.stubs.source}",
162 ":framework-mediaprovider{.public.stubs.source}",
163 ":framework-permission{.public.stubs.source}",
164 ":framework-sdkextensions{.public.stubs.source}",
165 ":framework-statsd{.public.stubs.source}",
166 ":framework-tethering{.public.stubs.source}",
167 ":framework-wifi{.public.stubs.source}",
168 ],
169 aidl: {
170 local_include_dirs: [
171 "apex/media/aidl/stable",
172 ],
173 include_dirs: [
174 "packages/modules/Connectivity/framework/aidl-export",
175 ],
176 },
177}
178
Jiyong Park7fb4b182019-12-20 14:35:43 +0900179/////////////////////////////////////////////////////////////////////
180// API docs are created from the generated stub source files
181// using droiddoc
182/////////////////////////////////////////////////////////////////////
183
184framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
185 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
186 "-overview $(location core/java/overview.html) " +
187 // Federate Support Library references against local API file.
188 "-federate SupportLib https://developer.android.com " +
189 "-federationapi SupportLib $(location :current-support-api) " +
190 // Federate Support Library references against local API file.
191 "-federate AndroidX https://developer.android.com " +
192 "-federationapi AndroidX $(location :current-androidx-api) "
193
194doc_defaults {
195 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000196 libs: framework_docs_only_libs + [
197 "stub-annotations",
198 "unsupportedappusage",
199 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900200 html_dirs: [
201 "docs/html",
202 ],
203 knowntags: [
204 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100205 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900206 ],
207 custom_template: "droiddoc-templates-sdk",
208 resourcesdir: "docs/html/reference/images/",
209 resourcesoutdir: "reference/android/images/",
210 hdf: [
211 "dac true",
212 "sdk.codename O",
213 "sdk.preview.version 1",
214 "sdk.version 7.0",
215 "sdk.rel.id 1",
216 "sdk.preview 0",
217 ],
218 arg_files: [
219 "core/res/AndroidManifest.xml",
220 "core/java/overview.html",
221 ":current-support-api",
222 ":current-androidx-api",
223 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900224}
225
226doc_defaults {
227 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900228}
229
230droiddoc {
231 name: "doc-comment-check-docs",
232 defaults: ["framework-docs-default"],
233 srcs: [
234 ":framework-doc-stubs",
235 ],
236 args: framework_docs_only_args + " -referenceonly -parsecomments",
237 installable: false,
238}
239
240droiddoc {
241 name: "offline-sdk-docs",
242 defaults: ["framework-docs-default"],
243 srcs: [
244 ":framework-doc-stubs",
245 ],
246 hdf: [
247 "android.whichdoc offline",
248 ],
atrostb1ee27b2020-02-03 11:03:16 +0000249 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900250 proofread_file: "offline-sdk-docs-proofrerad.txt",
251 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
252 static_doc_index_redirect: "docs/docs-preview-index.html",
253}
254
255droiddoc {
256 // Please sync with android-api-council@ before making any changes for the name property below.
257 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
258 // See b/116221385 for reference.
259 name: "offline-sdk-referenceonly-docs",
260 defaults: ["framework-docs-default"],
261 srcs: [
262 ":framework-doc-stubs",
263 ],
264 hdf: [
265 "android.whichdoc offline",
266 ],
267 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
268 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
269 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
270 static_doc_properties: "docs/source.properties",
271}
272
273droiddoc {
274 // Please sync with android-api-council@ before making any changes for the name property below.
275 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
276 // See b/116221385 for reference.
277 name: "offline-system-sdk-referenceonly-docs",
278 defaults: ["framework-docs-default"],
279 srcs: [
280 ":framework-doc-system-stubs",
281 ],
282 hdf: [
283 "android.whichdoc offline",
284 ],
285 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
286 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
287 " -offlinemode -title \"Android System SDK\" -referenceonly",
288 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
289 static_doc_properties: "docs/source.properties",
290}
291
292droiddoc {
293 name: "online-sdk-docs",
294 defaults: ["framework-docs-default"],
295 srcs: [
296 ":framework-doc-stubs",
297 ],
298 hdf: [
299 "android.whichdoc online",
300 "android.hasSamples true",
301 ],
302 proofread_file: "online-sdk-docs-proofrerad.txt",
303 args: framework_docs_only_args +
304 " -toroot / -samplegroup Admin " +
305 " -samplegroup Background " +
306 " -samplegroup Connectivity " +
307 " -samplegroup Content " +
308 " -samplegroup Input " +
309 " -samplegroup Media " +
310 " -samplegroup Notification " +
311 " -samplegroup RenderScript " +
312 " -samplegroup Security " +
313 " -samplegroup Sensors " +
314 " -samplegroup System " +
315 " -samplegroup Testing " +
316 " -samplegroup UI " +
317 " -samplegroup Views " +
318 " -samplegroup Wearable -samplesdir development/samples/browseable ",
319}
320
321droiddoc {
322 name: "online-system-api-sdk-docs",
323 defaults: ["framework-docs-default"],
324 srcs: [
325 ":framework-doc-system-stubs",
326 ],
327 hdf: [
328 "android.whichdoc online",
329 "android.hasSamples true",
330 ],
331 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
332 args: framework_docs_only_args +
333 " -referenceonly " +
334 " -title \"Android SDK - Including system APIs.\" " +
335 " -hide 101 " +
336 " -hide 104 " +
337 " -hide 108 " +
338 " -toroot / -samplegroup Admin " +
339 " -samplegroup Background " +
340 " -samplegroup Connectivity " +
341 " -samplegroup Content " +
342 " -samplegroup Input " +
343 " -samplegroup Media " +
344 " -samplegroup Notification " +
345 " -samplegroup RenderScript " +
346 " -samplegroup Security " +
347 " -samplegroup Sensors " +
348 " -samplegroup System " +
349 " -samplegroup Testing " +
350 " -samplegroup UI " +
351 " -samplegroup Views " +
352 " -samplegroup Wearable -samplesdir development/samples/browseable ",
353 installable: false,
354}
355
356droiddoc {
357 name: "ds-docs-java",
358 defaults: ["framework-docs-default"],
359 srcs: [
360 ":framework-doc-stubs",
361 ],
362 hdf: [
363 "android.whichdoc online",
364 "android.hasSamples true",
365 ],
366 proofread_file: "ds-docs-proofrerad.txt",
367 args: framework_docs_only_args +
368 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
369 " -samplegroup Background " +
370 " -samplegroup Connectivity " +
371 " -samplegroup Content " +
372 " -samplegroup Input " +
373 " -samplegroup Media " +
374 " -samplegroup Notification " +
375 " -samplegroup RenderScript " +
376 " -samplegroup Security " +
377 " -samplegroup Sensors " +
378 " -samplegroup System " +
379 " -samplegroup Testing " +
380 " -samplegroup UI " +
381 " -samplegroup Views " +
382 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
383}
384
385droiddoc {
386 name: "ds-docs-kt",
387 defaults: ["framework-dokka-docs-default"],
388 srcs: [
389 ":framework-doc-stubs",
390 ],
391 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700392 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900393 proofread_file: "ds-dokka-proofread.txt",
394 dokka_enabled: true,
395}
396
397java_genrule {
398 name: "ds-docs",
399 tools: [
400 "zip2zip",
401 "merge_zips",
402 ],
403 srcs: [
404 ":ds-docs-java{.docs.zip}",
405 ":ds-docs-kt{.docs.zip}",
406 ],
407 out: ["ds-docs.zip"],
408 dist: {
409 targets: ["docs"],
410 },
411 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 -0700412 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900413}
414
415java_genrule {
416 name: "ds-docs-switched",
417 tools: [
418 "switcher4",
419 "soong_zip",
420 ],
421 srcs: [
422 ":ds-docs-java{.docs.zip}",
423 ":ds-docs-kt{.docs.zip}",
424 ],
425 out: ["ds-docs-switched.zip"],
426 dist: {
427 targets: ["docs"],
428 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800429 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700430 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
431 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
432 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
433 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900434}
435
436droiddoc {
437 name: "ds-static-docs",
438 defaults: ["framework-docs-default"],
439 srcs: [
440 ":framework-doc-stubs",
441 ],
442 hdf: [
443 "android.whichdoc online",
444 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900445 args: framework_docs_only_args +
446 " -staticonly " +
447 " -toroot / " +
448 " -devsite " +
449 " -ignoreJdLinks ",
450}
451
452droiddoc {
453 name: "ds-ref-navtree-docs",
454 defaults: ["framework-docs-default"],
455 srcs: [
456 ":framework-doc-stubs",
457 ],
458 hdf: [
459 "android.whichdoc online",
460 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900461 args: framework_docs_only_args +
462 " -toroot / " +
463 " -atLinksNavtree " +
464 " -navtreeonly ",
465}
466
467droiddoc {
468 name: "online-sdk-dev-docs",
469 defaults: ["framework-docs-default"],
470 srcs: [
471 ":framework-doc-stubs",
472 ],
473 hdf: [
474 "android.whichdoc online",
475 "android.hasSamples true",
476 ],
477 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
478 args: framework_docs_only_args +
479 " -toroot / -samplegroup Admin " +
480 " -samplegroup Background " +
481 " -samplegroup Connectivity " +
482 " -samplegroup Content " +
483 " -samplegroup Input " +
484 " -samplegroup Media " +
485 " -samplegroup Notification " +
486 " -samplegroup RenderScript " +
487 " -samplegroup Security " +
488 " -samplegroup Sensors " +
489 " -samplegroup System " +
490 " -samplegroup Testing " +
491 " -samplegroup UI " +
492 " -samplegroup Views " +
493 " -samplegroup Wearable -samplesdir development/samples/browseable ",
494}
495
496droiddoc {
497 name: "hidden-docs",
498 defaults: ["framework-docs-default"],
499 srcs: [
500 ":framework-doc-stubs",
501 ],
502 proofread_file: "hidden-docs-proofrerad.txt",
503 args: framework_docs_only_args +
504 " -referenceonly " +
505 " -title \"Android SDK - Including hidden APIs.\"",
506}