blob: 83ace022950d6b68000377bf36565015e5a59000 [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}",
Anton Hansson703cde02021-03-30 10:46:48 +010080 ":framework-connectivity-sources",
81 ":framework-mediaprovider-sources",
82 ":framework-permission-sources",
83 ":framework-sdkextensions-sources",
84 ":framework-statsd-sources",
85 ":framework-tethering-srcs",
86 ":framework-wifi-updatable-sources",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000087 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson703cde02021-03-30 10:46:48 +010088 ":ike-srcs",
89 ":updatable-media-srcs",
90
91 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010092 ":android-test-base-sources",
93 ":android-test-mock-sources",
94 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090095 ],
96 libs: framework_docs_only_libs,
97 create_doc_stubs: true,
98 annotations_enabled: true,
Anton Hansson76ac4cc2021-05-05 19:22:52 +010099 filter_packages: packages_to_document,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900100 api_levels_annotations_enabled: true,
101 api_levels_annotations_dirs: [
102 "sdk-dir",
103 "api-versions-jars-dir",
104 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +0100105 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900106 merge_annotations_dirs: [
107 "metalava-manual",
108 ],
109}
110
111droidstubs {
Anton Hanssonc7f5e7d2021-05-05 10:32:31 +0100112 name: "android-non-updatable-doc-stubs",
113 defaults: ["android-non-updatable-doc-stubs-defaults"],
114 args: metalava_framework_docs_args,
115}
116
117droidstubs {
118 name: "android-non-updatable-doc-stubs-system",
119 defaults: ["android-non-updatable-doc-stubs-defaults"],
120 args: metalava_framework_docs_args +
121 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
122}
123
124droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900125 name: "framework-doc-stubs",
126 defaults: ["framework-doc-stubs-default"],
127 arg_files: [
128 "core/res/AndroidManifest.xml",
129 ],
Anton Hansson26c843f2021-05-05 11:11:57 +0100130 args: metalava_framework_docs_args,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900131 write_sdk_values: true,
132}
133
134droidstubs {
135 name: "framework-doc-system-stubs",
136 defaults: ["framework-doc-stubs-default"],
137 arg_files: [
138 "core/res/AndroidManifest.xml",
139 ],
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\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900142 write_sdk_values: true,
143}
144
145/////////////////////////////////////////////////////////////////////
146// API docs are created from the generated stub source files
147// using droiddoc
148/////////////////////////////////////////////////////////////////////
149
150framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
151 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
152 "-overview $(location core/java/overview.html) " +
153 // Federate Support Library references against local API file.
154 "-federate SupportLib https://developer.android.com " +
155 "-federationapi SupportLib $(location :current-support-api) " +
156 // Federate Support Library references against local API file.
157 "-federate AndroidX https://developer.android.com " +
158 "-federationapi AndroidX $(location :current-androidx-api) "
159
160doc_defaults {
161 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000162 libs: framework_docs_only_libs + [
163 "stub-annotations",
164 "unsupportedappusage",
165 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900166 html_dirs: [
167 "docs/html",
168 ],
169 knowntags: [
170 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100171 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900172 ],
173 custom_template: "droiddoc-templates-sdk",
174 resourcesdir: "docs/html/reference/images/",
175 resourcesoutdir: "reference/android/images/",
176 hdf: [
177 "dac true",
178 "sdk.codename O",
179 "sdk.preview.version 1",
180 "sdk.version 7.0",
181 "sdk.rel.id 1",
182 "sdk.preview 0",
183 ],
184 arg_files: [
185 "core/res/AndroidManifest.xml",
186 "core/java/overview.html",
187 ":current-support-api",
188 ":current-androidx-api",
189 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900190}
191
192doc_defaults {
193 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900194}
195
196droiddoc {
197 name: "doc-comment-check-docs",
198 defaults: ["framework-docs-default"],
199 srcs: [
200 ":framework-doc-stubs",
201 ],
202 args: framework_docs_only_args + " -referenceonly -parsecomments",
203 installable: false,
204}
205
206droiddoc {
207 name: "offline-sdk-docs",
208 defaults: ["framework-docs-default"],
209 srcs: [
210 ":framework-doc-stubs",
211 ],
212 hdf: [
213 "android.whichdoc offline",
214 ],
atrostb1ee27b2020-02-03 11:03:16 +0000215 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900216 proofread_file: "offline-sdk-docs-proofrerad.txt",
217 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
218 static_doc_index_redirect: "docs/docs-preview-index.html",
219}
220
221droiddoc {
222 // Please sync with android-api-council@ before making any changes for the name property below.
223 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
224 // See b/116221385 for reference.
225 name: "offline-sdk-referenceonly-docs",
226 defaults: ["framework-docs-default"],
227 srcs: [
228 ":framework-doc-stubs",
229 ],
230 hdf: [
231 "android.whichdoc offline",
232 ],
233 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
234 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
235 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
236 static_doc_properties: "docs/source.properties",
237}
238
239droiddoc {
240 // Please sync with android-api-council@ before making any changes for the name property below.
241 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
242 // See b/116221385 for reference.
243 name: "offline-system-sdk-referenceonly-docs",
244 defaults: ["framework-docs-default"],
245 srcs: [
246 ":framework-doc-system-stubs",
247 ],
248 hdf: [
249 "android.whichdoc offline",
250 ],
251 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
252 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
253 " -offlinemode -title \"Android System SDK\" -referenceonly",
254 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
255 static_doc_properties: "docs/source.properties",
256}
257
258droiddoc {
259 name: "online-sdk-docs",
260 defaults: ["framework-docs-default"],
261 srcs: [
262 ":framework-doc-stubs",
263 ],
264 hdf: [
265 "android.whichdoc online",
266 "android.hasSamples true",
267 ],
268 proofread_file: "online-sdk-docs-proofrerad.txt",
269 args: framework_docs_only_args +
270 " -toroot / -samplegroup Admin " +
271 " -samplegroup Background " +
272 " -samplegroup Connectivity " +
273 " -samplegroup Content " +
274 " -samplegroup Input " +
275 " -samplegroup Media " +
276 " -samplegroup Notification " +
277 " -samplegroup RenderScript " +
278 " -samplegroup Security " +
279 " -samplegroup Sensors " +
280 " -samplegroup System " +
281 " -samplegroup Testing " +
282 " -samplegroup UI " +
283 " -samplegroup Views " +
284 " -samplegroup Wearable -samplesdir development/samples/browseable ",
285}
286
287droiddoc {
288 name: "online-system-api-sdk-docs",
289 defaults: ["framework-docs-default"],
290 srcs: [
291 ":framework-doc-system-stubs",
292 ],
293 hdf: [
294 "android.whichdoc online",
295 "android.hasSamples true",
296 ],
297 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
298 args: framework_docs_only_args +
299 " -referenceonly " +
300 " -title \"Android SDK - Including system APIs.\" " +
301 " -hide 101 " +
302 " -hide 104 " +
303 " -hide 108 " +
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 installable: false,
320}
321
322droiddoc {
323 name: "ds-docs-java",
324 defaults: ["framework-docs-default"],
325 srcs: [
326 ":framework-doc-stubs",
327 ],
328 hdf: [
329 "android.whichdoc online",
330 "android.hasSamples true",
331 ],
332 proofread_file: "ds-docs-proofrerad.txt",
333 args: framework_docs_only_args +
334 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
335 " -samplegroup Background " +
336 " -samplegroup Connectivity " +
337 " -samplegroup Content " +
338 " -samplegroup Input " +
339 " -samplegroup Media " +
340 " -samplegroup Notification " +
341 " -samplegroup RenderScript " +
342 " -samplegroup Security " +
343 " -samplegroup Sensors " +
344 " -samplegroup System " +
345 " -samplegroup Testing " +
346 " -samplegroup UI " +
347 " -samplegroup Views " +
348 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
349}
350
351droiddoc {
352 name: "ds-docs-kt",
353 defaults: ["framework-dokka-docs-default"],
354 srcs: [
355 ":framework-doc-stubs",
356 ],
357 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700358 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900359 proofread_file: "ds-dokka-proofread.txt",
360 dokka_enabled: true,
361}
362
363java_genrule {
364 name: "ds-docs",
365 tools: [
366 "zip2zip",
367 "merge_zips",
368 ],
369 srcs: [
370 ":ds-docs-java{.docs.zip}",
371 ":ds-docs-kt{.docs.zip}",
372 ],
373 out: ["ds-docs.zip"],
374 dist: {
375 targets: ["docs"],
376 },
377 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 -0700378 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900379}
380
381java_genrule {
382 name: "ds-docs-switched",
383 tools: [
384 "switcher4",
385 "soong_zip",
386 ],
387 srcs: [
388 ":ds-docs-java{.docs.zip}",
389 ":ds-docs-kt{.docs.zip}",
390 ],
391 out: ["ds-docs-switched.zip"],
392 dist: {
393 targets: ["docs"],
394 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800395 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700396 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
397 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
398 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
399 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900400}
401
402droiddoc {
403 name: "ds-static-docs",
404 defaults: ["framework-docs-default"],
405 srcs: [
406 ":framework-doc-stubs",
407 ],
408 hdf: [
409 "android.whichdoc online",
410 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900411 args: framework_docs_only_args +
412 " -staticonly " +
413 " -toroot / " +
414 " -devsite " +
415 " -ignoreJdLinks ",
416}
417
418droiddoc {
419 name: "ds-ref-navtree-docs",
420 defaults: ["framework-docs-default"],
421 srcs: [
422 ":framework-doc-stubs",
423 ],
424 hdf: [
425 "android.whichdoc online",
426 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900427 args: framework_docs_only_args +
428 " -toroot / " +
429 " -atLinksNavtree " +
430 " -navtreeonly ",
431}
432
433droiddoc {
434 name: "online-sdk-dev-docs",
435 defaults: ["framework-docs-default"],
436 srcs: [
437 ":framework-doc-stubs",
438 ],
439 hdf: [
440 "android.whichdoc online",
441 "android.hasSamples true",
442 ],
443 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
444 args: framework_docs_only_args +
445 " -toroot / -samplegroup Admin " +
446 " -samplegroup Background " +
447 " -samplegroup Connectivity " +
448 " -samplegroup Content " +
449 " -samplegroup Input " +
450 " -samplegroup Media " +
451 " -samplegroup Notification " +
452 " -samplegroup RenderScript " +
453 " -samplegroup Security " +
454 " -samplegroup Sensors " +
455 " -samplegroup System " +
456 " -samplegroup Testing " +
457 " -samplegroup UI " +
458 " -samplegroup Views " +
459 " -samplegroup Wearable -samplesdir development/samples/browseable ",
460}
461
462droiddoc {
463 name: "hidden-docs",
464 defaults: ["framework-docs-default"],
465 srcs: [
466 ":framework-doc-stubs",
467 ],
468 proofread_file: "hidden-docs-proofrerad.txt",
469 args: framework_docs_only_args +
470 " -referenceonly " +
471 " -title \"Android SDK - Including hidden APIs.\"",
472}