blob: 0f218b581bbd58c8c51e751d0e0dcfc820321fd3 [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.
96 "test-base/src/**/*.java",
Jiyong Park7fb4b182019-12-20 14:35:43 +090097 "test-mock/src/**/*.java",
98 "test-runner/src/**/*.java",
99 ],
100 libs: framework_docs_only_libs,
101 create_doc_stubs: true,
102 annotations_enabled: true,
103 api_levels_annotations_enabled: true,
104 api_levels_annotations_dirs: [
105 "sdk-dir",
106 "api-versions-jars-dir",
107 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +0100108 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900109 merge_annotations_dirs: [
110 "metalava-manual",
111 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700112 // TODO(b/169090544): remove below aidl includes.
113 aidl: {
114 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700115 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700116 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900117}
118
119droidstubs {
Anton Hansson867f94c2021-05-05 10:32:31 +0100120 name: "android-non-updatable-doc-stubs",
121 defaults: ["android-non-updatable-doc-stubs-defaults"],
122 args: metalava_framework_docs_args,
123}
124
125droidstubs {
126 name: "android-non-updatable-doc-stubs-system",
127 defaults: ["android-non-updatable-doc-stubs-defaults"],
128 args: metalava_framework_docs_args +
129 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
130}
131
132droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900133 name: "framework-doc-stubs",
134 defaults: ["framework-doc-stubs-default"],
135 arg_files: [
136 "core/res/AndroidManifest.xml",
137 ],
Anton Hansson26c843f2021-05-05 11:11:57 +0100138 args: metalava_framework_docs_args,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900139 write_sdk_values: true,
140}
141
142droidstubs {
143 name: "framework-doc-system-stubs",
144 defaults: ["framework-doc-stubs-default"],
145 arg_files: [
146 "core/res/AndroidManifest.xml",
147 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000148 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000149 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900150 write_sdk_values: true,
151}
152
153/////////////////////////////////////////////////////////////////////
154// API docs are created from the generated stub source files
155// using droiddoc
156/////////////////////////////////////////////////////////////////////
157
158framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
159 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
160 "-overview $(location core/java/overview.html) " +
161 // Federate Support Library references against local API file.
162 "-federate SupportLib https://developer.android.com " +
163 "-federationapi SupportLib $(location :current-support-api) " +
164 // Federate Support Library references against local API file.
165 "-federate AndroidX https://developer.android.com " +
166 "-federationapi AndroidX $(location :current-androidx-api) "
167
168doc_defaults {
169 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000170 libs: framework_docs_only_libs + [
171 "stub-annotations",
172 "unsupportedappusage",
173 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900174 html_dirs: [
175 "docs/html",
176 ],
177 knowntags: [
178 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100179 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900180 ],
181 custom_template: "droiddoc-templates-sdk",
182 resourcesdir: "docs/html/reference/images/",
183 resourcesoutdir: "reference/android/images/",
184 hdf: [
185 "dac true",
186 "sdk.codename O",
187 "sdk.preview.version 1",
188 "sdk.version 7.0",
189 "sdk.rel.id 1",
190 "sdk.preview 0",
191 ],
192 arg_files: [
193 "core/res/AndroidManifest.xml",
194 "core/java/overview.html",
195 ":current-support-api",
196 ":current-androidx-api",
197 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700198 // TODO(b/169090544): remove below aidl includes.
199 aidl: {
200 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700201 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700202 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900203}
204
205doc_defaults {
206 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900207}
208
209droiddoc {
210 name: "doc-comment-check-docs",
211 defaults: ["framework-docs-default"],
212 srcs: [
213 ":framework-doc-stubs",
214 ],
215 args: framework_docs_only_args + " -referenceonly -parsecomments",
216 installable: false,
217}
218
219droiddoc {
220 name: "offline-sdk-docs",
221 defaults: ["framework-docs-default"],
222 srcs: [
223 ":framework-doc-stubs",
224 ],
225 hdf: [
226 "android.whichdoc offline",
227 ],
atrostb1ee27b2020-02-03 11:03:16 +0000228 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900229 proofread_file: "offline-sdk-docs-proofrerad.txt",
230 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
231 static_doc_index_redirect: "docs/docs-preview-index.html",
232}
233
234droiddoc {
235 // Please sync with android-api-council@ before making any changes for the name property below.
236 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
237 // See b/116221385 for reference.
238 name: "offline-sdk-referenceonly-docs",
239 defaults: ["framework-docs-default"],
240 srcs: [
241 ":framework-doc-stubs",
242 ],
243 hdf: [
244 "android.whichdoc offline",
245 ],
246 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
247 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
248 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
249 static_doc_properties: "docs/source.properties",
250}
251
252droiddoc {
253 // Please sync with android-api-council@ before making any changes for the name property below.
254 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
255 // See b/116221385 for reference.
256 name: "offline-system-sdk-referenceonly-docs",
257 defaults: ["framework-docs-default"],
258 srcs: [
259 ":framework-doc-system-stubs",
260 ],
261 hdf: [
262 "android.whichdoc offline",
263 ],
264 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
265 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
266 " -offlinemode -title \"Android System SDK\" -referenceonly",
267 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
268 static_doc_properties: "docs/source.properties",
269}
270
271droiddoc {
272 name: "online-sdk-docs",
273 defaults: ["framework-docs-default"],
274 srcs: [
275 ":framework-doc-stubs",
276 ],
277 hdf: [
278 "android.whichdoc online",
279 "android.hasSamples true",
280 ],
281 proofread_file: "online-sdk-docs-proofrerad.txt",
282 args: framework_docs_only_args +
283 " -toroot / -samplegroup Admin " +
284 " -samplegroup Background " +
285 " -samplegroup Connectivity " +
286 " -samplegroup Content " +
287 " -samplegroup Input " +
288 " -samplegroup Media " +
289 " -samplegroup Notification " +
290 " -samplegroup RenderScript " +
291 " -samplegroup Security " +
292 " -samplegroup Sensors " +
293 " -samplegroup System " +
294 " -samplegroup Testing " +
295 " -samplegroup UI " +
296 " -samplegroup Views " +
297 " -samplegroup Wearable -samplesdir development/samples/browseable ",
298}
299
300droiddoc {
301 name: "online-system-api-sdk-docs",
302 defaults: ["framework-docs-default"],
303 srcs: [
304 ":framework-doc-system-stubs",
305 ],
306 hdf: [
307 "android.whichdoc online",
308 "android.hasSamples true",
309 ],
310 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
311 args: framework_docs_only_args +
312 " -referenceonly " +
313 " -title \"Android SDK - Including system APIs.\" " +
314 " -hide 101 " +
315 " -hide 104 " +
316 " -hide 108 " +
317 " -toroot / -samplegroup Admin " +
318 " -samplegroup Background " +
319 " -samplegroup Connectivity " +
320 " -samplegroup Content " +
321 " -samplegroup Input " +
322 " -samplegroup Media " +
323 " -samplegroup Notification " +
324 " -samplegroup RenderScript " +
325 " -samplegroup Security " +
326 " -samplegroup Sensors " +
327 " -samplegroup System " +
328 " -samplegroup Testing " +
329 " -samplegroup UI " +
330 " -samplegroup Views " +
331 " -samplegroup Wearable -samplesdir development/samples/browseable ",
332 installable: false,
333}
334
335droiddoc {
336 name: "ds-docs-java",
337 defaults: ["framework-docs-default"],
338 srcs: [
339 ":framework-doc-stubs",
340 ],
341 hdf: [
342 "android.whichdoc online",
343 "android.hasSamples true",
344 ],
345 proofread_file: "ds-docs-proofrerad.txt",
346 args: framework_docs_only_args +
347 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
348 " -samplegroup Background " +
349 " -samplegroup Connectivity " +
350 " -samplegroup Content " +
351 " -samplegroup Input " +
352 " -samplegroup Media " +
353 " -samplegroup Notification " +
354 " -samplegroup RenderScript " +
355 " -samplegroup Security " +
356 " -samplegroup Sensors " +
357 " -samplegroup System " +
358 " -samplegroup Testing " +
359 " -samplegroup UI " +
360 " -samplegroup Views " +
361 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
362}
363
364droiddoc {
365 name: "ds-docs-kt",
366 defaults: ["framework-dokka-docs-default"],
367 srcs: [
368 ":framework-doc-stubs",
369 ],
370 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700371 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900372 proofread_file: "ds-dokka-proofread.txt",
373 dokka_enabled: true,
374}
375
376java_genrule {
377 name: "ds-docs",
378 tools: [
379 "zip2zip",
380 "merge_zips",
381 ],
382 srcs: [
383 ":ds-docs-java{.docs.zip}",
384 ":ds-docs-kt{.docs.zip}",
385 ],
386 out: ["ds-docs.zip"],
387 dist: {
388 targets: ["docs"],
389 },
390 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 -0700391 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900392}
393
394java_genrule {
395 name: "ds-docs-switched",
396 tools: [
397 "switcher4",
398 "soong_zip",
399 ],
400 srcs: [
401 ":ds-docs-java{.docs.zip}",
402 ":ds-docs-kt{.docs.zip}",
403 ],
404 out: ["ds-docs-switched.zip"],
405 dist: {
406 targets: ["docs"],
407 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800408 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700409 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
410 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
411 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
412 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900413}
414
415droiddoc {
416 name: "ds-static-docs",
417 defaults: ["framework-docs-default"],
418 srcs: [
419 ":framework-doc-stubs",
420 ],
421 hdf: [
422 "android.whichdoc online",
423 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900424 args: framework_docs_only_args +
425 " -staticonly " +
426 " -toroot / " +
427 " -devsite " +
428 " -ignoreJdLinks ",
429}
430
431droiddoc {
432 name: "ds-ref-navtree-docs",
433 defaults: ["framework-docs-default"],
434 srcs: [
435 ":framework-doc-stubs",
436 ],
437 hdf: [
438 "android.whichdoc online",
439 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900440 args: framework_docs_only_args +
441 " -toroot / " +
442 " -atLinksNavtree " +
443 " -navtreeonly ",
444}
445
446droiddoc {
447 name: "online-sdk-dev-docs",
448 defaults: ["framework-docs-default"],
449 srcs: [
450 ":framework-doc-stubs",
451 ],
452 hdf: [
453 "android.whichdoc online",
454 "android.hasSamples true",
455 ],
456 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
457 args: framework_docs_only_args +
458 " -toroot / -samplegroup Admin " +
459 " -samplegroup Background " +
460 " -samplegroup Connectivity " +
461 " -samplegroup Content " +
462 " -samplegroup Input " +
463 " -samplegroup Media " +
464 " -samplegroup Notification " +
465 " -samplegroup RenderScript " +
466 " -samplegroup Security " +
467 " -samplegroup Sensors " +
468 " -samplegroup System " +
469 " -samplegroup Testing " +
470 " -samplegroup UI " +
471 " -samplegroup Views " +
472 " -samplegroup Wearable -samplesdir development/samples/browseable ",
473}
474
475droiddoc {
476 name: "hidden-docs",
477 defaults: ["framework-docs-default"],
478 srcs: [
479 ":framework-doc-stubs",
480 ],
481 proofread_file: "hidden-docs-proofrerad.txt",
482 args: framework_docs_only_args +
483 " -referenceonly " +
484 " -title \"Android SDK - Including hidden APIs.\"",
485}