blob: 0aed5d9abea9543c803810d33068d5cb67d251b1 [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.
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 Hansson867f94c2021-05-05 10:32:31 +010075 ":android-non-updatable-stub-sources",
Anton Hansson35c0b092021-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 Hansson35c0b092021-03-30 10:46:48 +010080 ":framework-appsearch-sources",
81 ":framework-connectivity-sources",
82 ":framework-graphics-srcs",
83 ":framework-mediaprovider-sources",
84 ":framework-permission-sources",
85 ":framework-permission-s-sources",
86 ":framework-scheduling-sources",
87 ":framework-sdkextensions-sources",
88 ":framework-statsd-sources",
89 ":framework-tethering-srcs",
90 ":framework-wifi-updatable-sources",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000091 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson35c0b092021-03-30 10:46:48 +010092 ":ike-srcs",
93 ":updatable-media-srcs",
94
95 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010096 ":android-test-base-sources",
97 ":android-test-mock-sources",
98 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090099 ],
100 libs: framework_docs_only_libs,
101 create_doc_stubs: true,
102 annotations_enabled: true,
Anton Hansson76ac4cc2021-05-05 19:22:52 +0100103 filter_packages: packages_to_document,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900104 api_levels_annotations_enabled: true,
105 api_levels_annotations_dirs: [
106 "sdk-dir",
107 "api-versions-jars-dir",
108 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +0100109 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900110 merge_annotations_dirs: [
111 "metalava-manual",
112 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700113 // TODO(b/169090544): remove below aidl includes.
114 aidl: {
115 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700116 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700117 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900118}
119
120droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +0100121 name: "android-non-updatable-doc-stubs",
122 defaults: ["android-non-updatable-doc-stubs-defaults"],
123 args: metalava_framework_docs_args,
124}
125
126droidstubs {
127 name: "android-non-updatable-doc-stubs-system",
128 defaults: ["android-non-updatable-doc-stubs-defaults"],
129 args: metalava_framework_docs_args +
130 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
131}
132
133droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900134 name: "framework-doc-stubs",
135 defaults: ["framework-doc-stubs-default"],
136 arg_files: [
137 "core/res/AndroidManifest.xml",
138 ],
Anton Hansson26c843f2021-05-05 11:11:57 +0100139 args: metalava_framework_docs_args,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900140 write_sdk_values: true,
141}
142
143droidstubs {
144 name: "framework-doc-system-stubs",
145 defaults: ["framework-doc-stubs-default"],
146 arg_files: [
147 "core/res/AndroidManifest.xml",
148 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000149 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000150 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900151 write_sdk_values: true,
152}
153
154/////////////////////////////////////////////////////////////////////
155// API docs are created from the generated stub source files
156// using droiddoc
157/////////////////////////////////////////////////////////////////////
158
159framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
160 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
161 "-overview $(location core/java/overview.html) " +
162 // Federate Support Library references against local API file.
163 "-federate SupportLib https://developer.android.com " +
164 "-federationapi SupportLib $(location :current-support-api) " +
165 // Federate Support Library references against local API file.
166 "-federate AndroidX https://developer.android.com " +
167 "-federationapi AndroidX $(location :current-androidx-api) "
168
169doc_defaults {
170 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000171 libs: framework_docs_only_libs + [
172 "stub-annotations",
173 "unsupportedappusage",
174 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900175 html_dirs: [
176 "docs/html",
177 ],
178 knowntags: [
179 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100180 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900181 ],
182 custom_template: "droiddoc-templates-sdk",
183 resourcesdir: "docs/html/reference/images/",
184 resourcesoutdir: "reference/android/images/",
185 hdf: [
186 "dac true",
187 "sdk.codename O",
188 "sdk.preview.version 1",
189 "sdk.version 7.0",
190 "sdk.rel.id 1",
191 "sdk.preview 0",
192 ],
193 arg_files: [
194 "core/res/AndroidManifest.xml",
195 "core/java/overview.html",
196 ":current-support-api",
197 ":current-androidx-api",
198 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700199 // TODO(b/169090544): remove below aidl includes.
200 aidl: {
201 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700202 include_dirs: ["frameworks/av/aidl"],
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}